Documentation

Refund a Transaction

Once a transaction has been completed, this API can be used to issue a refund, thereby clawing back funds from the payee and transferring them back to the payor. An optional amount can be specified to either issue a partial refund or add additional fees to the original amount. If the amount is not specified, the total transaction amount is refunded.

The refund requests are only accepted when the transaction has been processed or completed. If the transaction is in the CAPTURE_PENDING or CAPTURE_ACH_FAILED status, the refund will not be accepted.

A refund will be processed only after an individual or batch payout has been initiated. For transactions within a batch payout, GrailPay will collect all refund requests from the day and create a credit ACH from the processor’s bank account for the total amount of refunds processed that day.

Endpoint

   /3p/api/v1/transactions/{transaction_uuid}/refund

 

Body Payload

{
    "amount": 12000,
    "client_reference_id": "refund_capture_25478"
}
FieldsTypeIs RequiredDescription
amountintYesRefund amount.
client_reference_idstringNo

Response Object

Note: Amounts and fees are expressed in cents.

{
    "status": true,
    "message": "",
    "data": {
        "uuid": "9be03fa2-bf19-415c-9fb6-eb903f7a0618",
        "transaction_uuid": "9bdeaf2e-3b14-4e39-bbb0-ade2077e9439",
        "amount": 12000,
        "status": "REFUND_PENDING",
        "created_at": "2024-04-23 12:13:46"
    },
    "errors": null,
    "error_code": null
}

Errors and Warnings

CodeMessage
401
403
422

Refund Statuses

StatusDescription
REFUND_PENDINGThe initial status, indicating that the refund request has not yet been processed.
REFUND_CAPTURE_ACH_PENDINGThe refund has been processed and a debit ACH transaction has been initiated from the payee or processor (reverse of payout).
REFUND_ACH_PENDINGThe debit ACH transaction is complete and a credit ACH transaction has been initiated to the payer (reverse of the transaction).
REFUND_COMPLETEThe refund process is complete and the payer has received the money.
REFUND_FAILEDThe refund has failed due to some reason.