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.
Test mode
With a test API key, some values make this endpoint succeed, fail or wait. See the test mode values for this endpoint.
authorizationAuthorizationBearer <SECRET_API_KEY>Set Your Secret API Key
A unique value, eg. a UUID.
application/jsonA 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 <= lengthOK
*/*A positive integer value in the specified currency's smallest unit. e.g. for SGD, $10 would be represented as 1000 (cents).
int64Time at which the object was created. In ISO 8601 format.
Three-letter ISO 4217 currency code in full uppercase.
Unique identifier for the object.
Additional information when status is FAILED, if available. Possible values: TRANSACTION_NO_LONGER_REFUNDABLE, OTHERS.
Status of the refund. One of PENDING, SUCCEEDED, or FAILED.
ID of transaction to refund.
Time at which the object was last updated. In ISO 8601 format.
curl -X POST 'https://api.tryacme.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"
}