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. A payment made without a payment intent, such as a subscription renewal, is refunded by its transaction intent instead.
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_intentoptional, stringThe 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. Send either this or `transaction_intent`.
transaction_intentoptional, stringThe transaction being (partially) refunded (ti_...). Use it for a payment that has no payment intent, such as a subscription renewal: an invoice names its payment in `transaction_intent`. Send either this or `payment_intent`.
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.
currencystringThe 3-letter lowercase ISO currency of the refund, e.g. usd, eur, gbp. 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, stringA free-form key, unique within your tenant. Sending it again returns the refund it first created, with `200 OK`, instead of refunding twice.
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 or transaction 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_...), or null for a payment made without one.
transaction_intentstringThe transaction that was refunded (ti_...).
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",
"transaction_intent": "ti_eu1_4f0c2a9e7b1d4e8a9c3b5d6e7f8a9b0c",
"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",
"transaction_intent": "ti_eu1_4f0c2a9e7b1d4e8a9c3b5d6e7f8a9b0c",
"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_...), or null for a payment made without one.
transaction_intentstringThe transaction that was refunded (ti_...).
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",
"transaction_intent": "ti_eu1_4f0c2a9e7b1d4e8a9c3b5d6e7f8a9b0c",
"status": "success",
"amount": 20000,
"currency": "USD",
"created_at": "2026-07-01T12:00:00Z",
"gateway_transaction_id": "a1e8c3f60d2b95743f0e"
}