Skip to main content
POST
Create a refund

Authorizations

Authorization
string
header
required

Use your secret API key as the Bearer token. Test mode keys start with api_test_sk_ and live mode keys start with api_live_sk_. Both modes use the same API host; the mode is determined by the key.

Headers

Idempotency-Key
string
required

A unique key to ensure the request is processed only once. If a request with the same idempotency key and the same body has already been processed successfully, the original response is returned. Non-2xx responses are not cached, so callers may retry after errors. Keys expire after 24 hours.

For one-shot requests, such as creating a payment from a checkout button, a random UUIDv4 is fine. For requests tied to a specific business operation, such as refunding an order, a deterministic key is preferred so retries collapse correctly across processes.

Maximum string length: 255

Body

application/json
payment_id
string
required

Unique opaque identifier for a payment (pay_ prefix + random alphanumeric suffix).

Pattern: ^pay_[A-Za-z0-9]{24}$
Example:

"pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"

amount
integer<int64>
required

Refund amount in minor units, in the same currency as the original payment. Use the remaining refundable amount for a full refund.

Required range: x >= 1
Example:

1500

reason
string
required

Merchant-provided refund reason passed to the payment provider as the refund comment. Limited to 50 characters by WhiteLark.

Required string length: 1 - 50
Example:

"Full refund verification"

merchant_reference
integer<int64>

Optional merchant-side reconciliation reference. The value must contain exactly 10 decimal digits and does not provide idempotency by itself.

Required range: 1000000000 <= x <= 9999999999
Example:

1234567890

Response

Refund accepted and a Refund object was created. The refund may still be PENDING or PROCESSING; use the returned status, subsequent payment retrievals, or webhooks to track completion.

A refund against a payment.

id
string
required

Unique opaque identifier for a refund (ref_ prefix + random alphanumeric suffix).

Pattern: ^ref_[A-Za-z0-9]{24}$
Example:

"ref_L9xQ4wE2rT8yU6iO3pA7sD1f"

payment_id
string
required

Unique opaque identifier for a payment (pay_ prefix + random alphanumeric suffix).

Pattern: ^pay_[A-Za-z0-9]{24}$
Example:

"pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"

amount
integer<int64>
required

Refund amount in minor units.

Required range: x >= 1
Example:

1500

currency
enum<string>
required

Three-letter ISO 4217 currency code. Currently supported for card acquiring: EUR.

Available options:
EUR
Example:

"EUR"

reason
string
required

Merchant-provided refund reason stored with the refund.

Maximum string length: 50
Example:

"Full refund verification"

refund_type
enum<string>
required

Whether the refund covers the full original payment amount or only part of it.

Available options:
FULL,
PARTIAL
Example:

"FULL"

status
enum<string>
required

Current refund lifecycle status. Refunds normally move from PENDING to PROCESSING, then to SUCCEEDED or FAILED.

Available options:
PENDING,
PROCESSING,
SUCCEEDED,
FAILED
Example:

"PENDING"

created_at
integer<int64>
required

Unix timestamp when the refund was created.

Example:

1719795600

updated_at
integer<int64>
required

Unix timestamp when the refund was last updated.

Example:

1719795660

livemode
boolean
required

Whether this refund was created using a live API key.

Example:

false

merchant_reference
integer<int64> | null

Merchant-side reconciliation reference for this refund, if provided.

Required range: 1000000000 <= x <= 9999999999
Example:

1234567890

failure
object | null

Refund failure details when the refund reaches FAILED.

completed_at
integer<int64> | null

Unix timestamp when the refund reached a terminal status.

Example:

1719799200