- 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
Parameter | Type | Required/optional | Description |
---|
merchantId | string | Required | Merchant identifier |
orderId | number | Conditional | Order ID of the payment. Required when merchantReference is not given |
merchantReference | string | Conditional | Unique reference of the order. Required when orderId is not given |
amount | number | Required | Refund amount |
Example:
{
"request": "{\"merchantId\":3,\"orderId\":4922,\"amount\":10}",
"signature": "oFkjUA2eEn2fSZHE5p8fzddO2dF7IfDwrmeZ4yBS5eVaMLjIeGwKwybPSl13PBEEhdwzRwWjVDFCk0AJvuzrE6C3udD0BsU8Yt7BMte/RFBQWTneKFpB/zkAM1QBKsb4slj8ZZ2BT3LutV1gGX89APAp/OeIjuy/NiporFo21LwCALK+B4JR/0zRXrQoBQLKdUEoL8eSEWo1vBISWf8/0Do/pi/6r18Mf91ghcYmGQDJBlJ2bG6whuEwM8serrpnwVgV1Liyqc5xqHhJ8eodF0IlOyiHlrMMdD88hyVaSqdSKfWb/OKhIl+6u3v4xeGxdnnZbQ9LZhBMeQWgBXwYDw=="
}
Response Parameters
Parameter | Type | Required/optional | Description |
---|
responseCode | string | Required | Payment Gateway response code |
message | string | Required | Payment Gateway response message |
order | object | Required | |
order.id | number | Required | Order identifier |
order.merchantId | number | Required | Merchant identifier which own this order |
order.merchantReference | string | Required | Your reference for the order |
order.currency | string | Required | 3-Letters ISO currency code of the order |
order.amount | number | Required | Order amount |
order.netAmount | number | Required | Net amount of the order |
order.cardType | string | Required | Card type of the order |
order.email | string | Required | Customer's email if provided |
order.createTime | datetime | Required | Timestamp when the order is created. Maintained by the Payment Gateway |
order.updateTime | datetime | Required | Timestamp when the order is last updated. Maintained by the Payment Gateway |
order.status | string | Required | Status of the order. Maintained by the Payment Gateway |
order.recurring | boolean | Required | Flags the order is a recurring order or not |
transaction | object | Required | |
transaction.id | number | Required | Transaction identifier for the refund transaction |
transaction.merchantId | number | Required | Merchant identifier which own this transaction |
transaction.type | string | Required | Transaction type |
transaction.amount | number | Required | Refund transaction amount |
transaction.status | string | Required | Status of the transaction. Maintained by the Payment Gateway |
transaction.maskedPan | string | Required | Masked card number of the original sale transaction if supported by the payment method |
transaction.stan | string | Required | System 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"
}
}