Refunds

Connect to the refunds API to trigger both partial and full refunds.

Refund Request

Example

curl -X POST https://stagingapi.platform.poweredbytandym.com/custom/refund
-H 'content-type:application/json'
-H ''apiKey:<YOURPAY_API_KEY>''
-H ''secret:<YOURPAY_API_SECRET>''
-d '{
    "type":"refund",
    "orderid":557,
    "transaction_receipt":"2c42b592-e172-4fde-8bc1-3d456008b014",
    "currency":"USD",
    "amounttotal":200
}’'
  • transaction_receipt is the value which you received in the callback at the time of order payment processing
  • amounttotal is the refund amount sent in cents (as an integer)

Refund Success

If refund successfully processed , you get a 201 and look for the status : 'APPROVED' , type = refunds

Refund Success Example

{
  "referenceid": "46039e80-4bcb-11ed-be45-755c2a328d59",
  "approved": 1
}

Refund Failure

If refund not processed , you get a 400 error

Refund Failure Example

{
  "referenceid": "cb67322e-d6b0-4a7e-bbda-17707976bff1",
  "approved": 0,
  "errorcode": "REFUND_UNSUCCESSFUL",
  "errormessage": "Refund is not successful!"
}