Refunds API
The Refunds API allows you to create and query refund objects. Refunds can be created against a successful payment intent, either as full or partial refunds.
Create a refund
Creates a new refund object against a successful payment intent. You can create multiple refunds for a given payment intent as long as the total amount of all refunds does not exceed the amount that was paid.
Parameters
payment_intentstringThe payment intent being (partially) refunded (pi_...). This is the same id returned when you created the payment intent; we resolve it to the underlying successful payment on our end.
amountintegerThe amount refunded to the customer in cents, as an integer. E.g. a $100.25 payment will use 10025 as its amount, a $27 payment will use 2700 as its amount, etc.
currencystringA 3 letter ISO currency that governs this transaction, e.g. USD, EUR, GBP, etc. Must match the currency that was paid.
webhooksoptional, arrayWebhook endpoints to notify about this refund's events. Each endpoint is configured independently.
refund_sla_timeoutoptional, integerThe point after which an outstanding refund that still has a mutable status becomes automatically canceled, in seconds. Default is 3 days.
idempotency_keyoptional, stringAn idempotency key provided by you to ensure the refund is not created multiple times.
Status Codes
201 Created: A new refund was successfully created200 OK: An existing refund was found (when using idempotency_key)400 Bad Request: Invalid request (see Error Codes below)404 Not Found: No payment intent with the given reference exists
Error Codes
REFUND_TX_MUST_BE_SUCCESSFUL: The payment intent must have a successful paymentREFUND_CCY_MISMATCH: Currency must match the payment currencyREFUND_RQST_AMT_GREATER_THAN_TX_AMT: Refund amount exceeds available balance
const response = await fetch('https://api-{region}.orchestrapay.com/v202607/refunds', {
method: 'POST',
headers: {
'Authorization': 'Bearer orch_sk_live_eu1_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_intent: 'pi_eu1_b8b5be0f481f42b4b7f5972118777c5f',
amount: 20000,
currency: 'usd',
webhooks: [
{
url: 'https://yoursite.com/webhooks/orchestrapay',
secret: 'your_webhook_secret',
events: ['refund.success', 'refund.canceled']
}
],
refund_sla_timeout: 259200,
idempotency_key: 'refund-order-123'
})
});Response Parameters
refundstringThe typed, region-coded identifier of the refund that was created (re_...).
payment_intentstringThe payment intent that was refunded (pi_...).
statusstringThe refund status. Typically pending on creation.
amountintegerThe refunded amount, in cents, echoed back.
currencystringThe 3-letter ISO currency, echoed back.
refundable_amount_leftintegerAmount left (in cents) that can still be requested for further refunds on this payment intent.
resource_createdbooleanWhether the resource was created, or already existed (matched via its idempotency key).
{
"refund": "re_eu1_582f94c6856c447b9b2cfbbd9a528c9d",
"payment_intent": "pi_eu1_b8b5be0f481f42b4b7f5972118777c5f",
"status": "pending",
"amount": 20000,
"currency": "usd",
"refundable_amount_left": 2700,
"resource_created": true
}Query refunds
Returns a list of refunds, most recent first. Results are cursor-paginated and can be narrowed with a fixed set of filters.
Query Parameters
limitoptional, integer, default is 25How many refunds to return, 1 to 100.
starting_afteroptional, stringA cursor for pagination: a refund id (re_...). Returns the page of results immediately after this object.
ending_beforeoptional, stringA cursor for pagination: a refund id (re_...). Returns the page of results immediately before this object.
payment_intentoptional, stringOnly return refunds for this payment intent (pi_...).
statusoptional, stringOnly return refunds with this status: pending, success, or canceled.
createdoptional, objectFilter by creation time. Pass a Unix timestamp (or ISO 8601) for an exact match, or a range object.
currencyoptional, stringOnly return refunds in this 3-letter ISO currency.
Notes
- Results are ordered by creation time, most recent first.
- Pagination is cursor-based: pass the last item's
re_id asstarting_afterto get the next page.
const params = new URLSearchParams({
limit: '25',
status: 'success',
payment_intent: 'pi_eu1_b8b5be0f481f42b4b7f5972118777c5f'
});
const response = await fetch(
'https://api-{region}.orchestrapay.com/v202607/refunds?' + params,
{ headers: { 'Authorization': 'Bearer orch_sk_live_eu1_...' } }
);Response Parameters
dataarrayThe list of refunds, most recent first.
has_morebooleantrue if there are more results after this page.
{
"data": [
{
"refund": "re_eu1_582f94c6856c447b9b2cfbbd9a528c9d",
"payment_intent": "pi_eu1_b8b5be0f481f42b4b7f5972118777c5f",
"status": "success",
"amount": 20000,
"currency": "USD",
"created_at": "2026-07-01T12:00:00Z"
}
],
"has_more": false
}Get a refund
Retrieves a single refund by its reference.
Parameters
refundstringThe refund reference to retrieve (re_...).
const response = await fetch('https://api-{region}.orchestrapay.com/v202607/refunds/re_eu1_582f94c6856c447b9b2cfbbd9a528c9d', {
headers: { 'Authorization': 'Bearer orch_sk_live_eu1_...' }
});Response Parameters
refundstringThe refund reference (re_...).
payment_intentstringThe payment intent that was refunded (pi_...).
statusstringpending, success, or canceled.
amountintegerAmount in cents.
currencystringThree-letter ISO currency code.
created_atstringISO 8601 creation timestamp.
gateway_transaction_idstringThe gateway's own reference for this refund, for reconciliation.
{
"refund": "re_eu1_582f94c6856c447b9b2cfbbd9a528c9d",
"payment_intent": "pi_eu1_b8b5be0f481f42b4b7f5972118777c5f",
"status": "success",
"amount": 20000,
"currency": "USD",
"created_at": "2026-07-01T12:00:00Z",
"gateway_transaction_id": "a1e8c3f60d2b95743f0e"
}