Create a Refund
POST/refunds
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.
Request
Header Parameters
A unique value, eg. a UUID.
- application/json
Body
txn_SuccessfulRefund
: Create a successful refund. Thestatus
will change fromPENDING
toSUCCEEDED
after a short while.txn_FailedRefund
: Create a failed refund. Thestatus
will change fromPENDING
toFAILED
after 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).
ID of transaction to refund.
Use these transaction IDs in test mode to simulate various outcomes:
A positive integer value in specified currency's smallest unit. e.g. $10 would be represented as 1000 (cents).
Possible values: [SGD
]
Three-letter ISO 4217 currency code in full uppercase. Must be a supported currency.
Responses
- 200
OK
Response Headers
Acme-Mode
string
Has the value LIVE if the data exists in live production mode or the value TEST if the data exists in test sandbox mode.
- application/json
- Schema
- Example (from schema)
Schema
Unique identifier for the object.
ID of transaction to refund.
A positive integer value in specified currency's smallest unit. e.g. for SGD, $10 would be represented as 1000 (cents).
Possible values: [SGD
]
Three-letter ISO 4217 currency code in full uppercase.
Possible values: [PENDING
, SUCCEEDED
, FAILED
]
Status of the refund
Possible values: [TRANSACTION_NO_LONGER_REFUNDABLE
, OTHERS
]
Additional information when status is FAILED
, if available.
Time at which the object was created. In ISO 8601 format.
Time at which the object was last updated. In ISO 8601 format.
{
"id": "rfnd_0FGDYHZMRZF49",
"transactionId": "txn_0FGDZ01BD01KA",
"amount": 420,
"currency": "SGD",
"status": "PENDING",
"resultCode": "TRANSACTION_NO_LONGER_REFUNDABLE",
"createdAt": "2023-04-24T00:00:00.000000Z",
"updatedAt": "2023-04-24T00:00:00.000000Z"
}