Create a refund
Refunds a payment that has already succeeded. The amount is always
required. To refund the full payment, set amount to the payment’s
remaining refundable amount. The refund uses the same currency as the
original payment; currency is not accepted on the refund request.
A payment can be refunded multiple times as long as the accumulated refunded amount does not exceed the original.
The create call submits the Refund before responding. A 201 response
therefore contains the Refund in PROCESSING, or already in terminal
FAILED when submission was definitively rejected. Monitor a
PROCESSING Refund via subsequent GET /v1/payments/{id} calls. It
transitions to SUCCEEDED when confirmed or FAILED when it cannot be
completed.
Every refund is recorded with a mandatory reason and is linked to the
original payment via payment_id.
Idempotency
Use the Idempotency-Key header to safely retry refund requests. The
idempotency contract uses the Refund’s effective request identity: a
retry with equivalent payment_id, amount, merchant_reference, and
reason returns the original response, while a retry with the same key
but a different identity is rejected
with 409 and error.code: "idempotency_key_reused". Pick a
deterministic key tied to the Refund operation and preserve its
effective identity on retries.
Authorizations
Use the secret API key for the intended merchant and mode as the Bearer
token. Sandbox keys start with api_test_sk_. Send the key only from
your server environment.
Headers
A unique key to ensure one effective operation is processed only once.
If the same key and an equivalent operation-specific effective request
identity have already completed successfully, the original response is
returned. A different identity returns 409 idempotency_key_reused.
Non-2xx responses are not cached, so callers may retry after errors. No
fixed retention period is promised by this contract.
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.
255Body
Unique opaque identifier for a payment (pay_ prefix + random alphanumeric suffix).
^pay_[A-Za-z0-9]{24}$"pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"
Refund amount in minor units, in the same currency as the original
payment. Minor units follow that currency's ISO 4217 exponent, so
4999 is EUR 49.99 (exponent 2) but JPY 4999 (exponent 0). Do not
assume two decimal places. Use the remaining refundable amount for a
full refund.
x >= 11500
Merchant-provided refund reason. The API accepts at most 50 characters.
1 - 50"Full refund verification"
Optional merchant-side reconciliation reference. The value must contain exactly 10 decimal digits and does not provide idempotency by itself.
1000000000 <= x <= 99999999991234567890
Response
Refund created and submitted. Inspect the returned status:
continue retrieval through the parent Payment for PROCESSING, or
handle the nested failure when the Refund is already FAILED.
A refund against a payment.
Unique opaque identifier for a refund (ref_ prefix + random alphanumeric suffix).
^ref_[A-Za-z0-9]{24}$"ref_L9xQ4wE2rT8yU6iO3pA7sD1f"
Unique opaque identifier for a payment (pay_ prefix + random alphanumeric suffix).
^pay_[A-Za-z0-9]{24}$"pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E"
Refund amount in the currency's minor units, per its ISO 4217 exponent: 4999 is EUR 49.99 but JPY 4999.
x >= 11500
Canonical uppercase three-letter ISO 4217 currency code. Responses always return the original currency the payment was created in; a provider response never replaces it.
3^[A-Z]{3}$"EUR"
Merchant-provided refund reason stored with the refund.
50"Full refund verification"
Whether the refund covers the full original payment amount or only part of it.
FULL, PARTIAL "FULL"
Current refund lifecycle status. Refunds normally move from PENDING
to PROCESSING, then to SUCCEEDED or FAILED.
PENDING, PROCESSING, SUCCEEDED, FAILED "PENDING"
Unix timestamp when the refund was created.
1719795600
Unix timestamp when the refund was last updated.
1719795660
Always false for a Refund created in Sandbox.
false
Merchant-side reconciliation reference for this refund, if provided.
1000000000 <= x <= 99999999991234567890
Refund failure details when the refund reaches FAILED.
Unix timestamp when the refund reached a terminal status.
1719799200