Skip to main content

Refund


  • Description: Refund the order if the payment method allows. Support both full refund and partial refund, and can refund only once. Refund will only approve when there is enough unsettled balance in merchant account.
  • Path: /hosted-checkout/refund
  • Method: POST
  • Request Header: Content-Type: application/json

Request Parameters

ParameterTypeRequired/optionalDescription
merchantIdstringRequiredMerchant identifier
orderIdnumberConditionalOrder ID of the payment. Required when merchantReference is not given
merchantReferencestringConditionalUnique reference of the order. Required when orderId is not given
amountnumberRequiredRefund amount

Example:

{
    "request": "{\"merchantId\":3,\"orderId\":4922,\"amount\":10}",
    "signature": "oFkjUA2eEn2fSZHE5p8fzddO2dF7IfDwrmeZ4yBS5eVaMLjIeGwKwybPSl13PBEEhdwzRwWjVDFCk0AJvuzrE6C3udD0BsU8Yt7BMte/RFBQWTneKFpB/zkAM1QBKsb4slj8ZZ2BT3LutV1gGX89APAp/OeIjuy/NiporFo21LwCALK+B4JR/0zRXrQoBQLKdUEoL8eSEWo1vBISWf8/0Do/pi/6r18Mf91ghcYmGQDJBlJ2bG6whuEwM8serrpnwVgV1Liyqc5xqHhJ8eodF0IlOyiHlrMMdD88hyVaSqdSKfWb/OKhIl+6u3v4xeGxdnnZbQ9LZhBMeQWgBXwYDw=="
}

Response Parameters

ParameterTypeRequired/optionalDescription
responseCodestringRequiredPayment Gateway response code
messagestringRequiredPayment Gateway response message
orderobjectRequired 
order.idnumberRequiredOrder identifier
order.merchantIdnumberRequiredMerchant identifier which own this order
order.merchantReferencestringRequiredYour reference for the order
order.currencystringRequired3-Letters ISO currency code of the order
order.amountnumberRequiredOrder amount
order.netAmountnumberRequiredNet amount of the order
order.cardTypestringRequiredCard type of the order
order.emailstringRequiredCustomer's email if provided
order.createTimedatetimeRequiredTimestamp when the order is created. Maintained by the Payment Gateway
order.updateTimedatetimeRequiredTimestamp when the order is last updated. Maintained by the Payment Gateway
order.statusstringRequiredStatus of the order. Maintained by the Payment Gateway
order.recurringbooleanRequiredFlags the order is a recurring order or not
transactionobjectRequired 
transaction.idnumberRequiredTransaction identifier for the refund transaction
transaction.merchantIdnumberRequiredMerchant identifier which own this transaction
transaction.typestringRequiredTransaction type
transaction.amountnumberRequiredRefund transaction amount
transaction.statusstringRequiredStatus of the transaction. Maintained by the Payment Gateway
transaction.maskedPanstringRequiredMasked card number of the original sale transaction if supported by the payment method
transaction.stanstringRequiredSystem trace audit number for the transaction

Example:

{
  "responseCode": "0000",
  "order": {
    "id": 4922,
    "merchantId": 3,
    "merchantReference": "1655817171",
    "currency": "USD",
    "amount": 15.00,
    "netAmount": 5.00,
    "cardType": "VISA",
    "email": "",
    "createTime": "2022-06-21T13:13:10.000+00:00",
    "updateTime": "2022-06-21T19:00:12.000+00:00",
    "status": "REFUNDED",
    "recurring": false
  },
  "transaction": {
    "id": 3758,
    "merchantId": 3,
    "type": "REFUND",
    "amount": 10,
    "currency": "USD",
    "status": "SUCCESS",
    "maskedPan": "400000XXXXXX0028",
    "stan": "S3142"
  }
}