Refund

To initiate a refund for an order use the refund API.

The refund model

The refund model contains all the information required for initiating a refund.

Properties

  • Name
    type
    Type
    string
    Description

    The type of transaction (i.e. refund)

  • Name
    orderid
    Type
    string
    Description

    The unique id of the order

  • Name
    transaction_receipt
    Type
    string
    Description

    The transaction receipt of the order

  • Name
    currency
    Type
    string
    Description

    The merchant's configured currency (USD only)

  • Name
    amounttotal
    Type
    number
    Description

    The total amount of the order (in cents)


POST/custom/refund

Create a refund

This endpoint allows you to initiate a refund request.

Required attributes

  • Name
    type
    Type
    string
    Description

    The type of transaction (i.e. refund)

  • Name
    orderid
    Type
    string
    Description

    The unique id of the order

  • Name
    transaction_receipt
    Type
    string
    Description

    The transaction receipt of the order

  • Name
    currency
    Type
    string
    Description

    The merchant's configured currency (USD only)

  • Name
    amounttotal
    Type
    number
    Description

    The total amount of the order (in cents)

Request

POST
/custom/refund
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":55199,
      }'

Success Response

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

Error Response

{
  "approved": 0,
  "errorcode": "REFUND_UNSUCCESSFUL",
  "errormessage": "Refund is not successful!"      
}