Create a Refund
Create a refund for a payment.
This is an asynchronous operation. The status of the Refund object in a successful response will be PENDING. Listen to the refunds.succeeded or refunds.failed webhook to be notified of the final outcome of the refund.
Authorization
authorization Set Your Secret API Key
In: header
Header Parameters
A unique value, eg. a UUID.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A positive integer value in the specified currency's smallest unit. e.g. $10 would be represented as 1000 (cents).
1 <= value <= 20000000Three-letter ISO 4217 currency code in full uppercase. Must be a supported currency.
ID of transaction to refund.
Use these transaction IDs in test mode to simulate various outcomes:
txn_SuccessfulRefund: Create a successful refund. Thestatuswill change fromPENDINGtoSUCCEEDEDafter a short while.txn_FailedRefund: Create a failed refund. Thestatuswill change fromPENDINGtoFAILEDafter a short while.txn_InvalidTransaction: Simulate attempting to refund a transaction that cannot be refunded.txn_AlreadyRefunded: Simulate attempting to refund a transaction that has already been refunded.txn_RejectOverRefund: Simulate attempting to refund an amount that is greater than the transaction's refundable amount.txn_NoLongerRefundable: Simulate attempting to refund a transaction that is no longer refundable (e.g. exceeded refund window).
1 <= lengthResponse Body
*/*
application/json
application/json
curl -X POST "https://example.com/v1/refunds" \
-H "Content-Type: application/json" \
-d '{
"amount": 1,
"currency": "string",
"transactionId": "string"
}'{
"amount": 0,
"createdAt": "string",
"currency": "string",
"id": "string",
"resultCode": "string",
"status": "string",
"transactionId": "string",
"updatedAt": "string"
}