List refunds
const url = 'https://api.example.com/v1/refunds?limit=10';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.example.com/v1/refunds?limit=10' \ --header 'Authorization: Bearer <token>'Your refunds in this key’s mode, oldest first.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”How many objects to return, from 1 to 100.
A next_cursor from the previous page.
Only this intent’s refunds.
Responses
Section titled “Responses”A page of refunds.
object
Pass back as cursor for the next page. null on the last page.
object
A three-letter ISO 4217 code, in lower case.
created for the moment it is made, processing while it is on its way, then
succeeded or failed. awaiting_approval while the platform’s risk team looks at it
before it is sent: it then goes on, or fails as risk_declined. Nothing is refunded while
it waits, and the amount stays held against what the payment has left to refund.
Why it failed, when it did.
Your own key-value pairs, returned as given and carried in webhooks: up to 50 keys of up to 40 characters without square brackets, each with a text value of up to 500 characters.
object
A Unix timestamp.
Example
{ "object": "list", "data": [ { "id": "re_01j9x3a1b2c3d4e5f6g7h8j9k0", "object": "refund", "currency": "php", "status": "created", "reason": "requested_by_customer", "failure_reason": "declined", "metadata": { "order_id": "1042" } } ]}validation_failure: invalid_parameter for a parameter missing or not valid, named in param; invalid_json for a body that is not JSON; unsupported_media_type for a body that is not sent as JSON; not_acceptable when the request will not accept JSON; method_not_allowed for an HTTP method the path does not take.
object
object
A stable name for this refusal. Branch on this, never on message.
For the developer reading a log. May be reworded.
The field or parameter at fault, when there is one.
Example
{ "error": { "type": "validation_failure", "code": "invalid_parameter", "message": "A whole number of minor units, from 1 to 999999999999999999.", "param": "amount", "request_id": "req_4f1c0b2e9a7d" }}authentication_failure: access_token_required when no token was sent, invalid_access_token when it is not valid, has expired, or is a client secret. Sent with a WWW-Authenticate: Bearer header, which adds error="invalid_token" when a token was sent.
object
object
A stable name for this refusal. Branch on this, never on message.
For the developer reading a log. May be reworded.
The field or parameter at fault, when there is one.
Example
{ "error": { "type": "validation_failure" }}authorization_failure with merchant_mismatch: a Merchant-Id header, query parameter or body field names a merchant or tenant other than the key’s.
object
object
A stable name for this refusal. Branch on this, never on message.
For the developer reading a log. May be reworded.
The field or parameter at fault, when there is one.
Example
{ "error": { "type": "validation_failure" }}dependency_failure with service_unavailable: something on our side, or a payment network behind it, did not answer. This call only reads, so nothing was changed; retry.
object
object
A stable name for this refusal. Branch on this, never on message.
For the developer reading a log. May be reworded.
The field or parameter at fault, when there is one.
Example
{ "error": { "type": "validation_failure" }}