Refund: Create
Refund API is provided to refer to a situation where a cardholder wants to refund a card transaction, and is arranged between the cardholder and the merchant directly. A refund transaction is only performed when the charge has CAPTURED
status
Several partial refund calls can be made, so long as the total amount refunded is not greater than the total charge amount.
The refund process will take around T+1 to T+3 but it varies from each issuing bank (could be up to 14 days for some issuing banks).
The maximum time to create a refund is T+6 months since the respective transaction was charged.
EndPoint
POST
/credit-card/refund
Header Params
Param | Required | Type | Description | Note |
---|---|---|---|---|
X-APPOTAPAY-AUTH | required | String | How to generate JWT_TOKEN | |
Content-Type | required | String | Value: application/json | |
X-Request-ID | optional | String | UUIDv4 format. Request ID to check when a problem occurs | max:42 |
Language | optional | String | The value vi or en corresponding to the payment link will be Vietnamese or English, (default: vi) | in:vi,en |
X-Account-Ref-ID | optional | String | Iidentifier of the sub account provided by AppotaPay. Mandatory be passed over when processing payment for transactions of owner-type sub account |
{
"X-APPOTAPAY-AUTH": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}
Request Params
Parameters | Requirement | Data type | Description | Note |
---|---|---|---|---|
transactionId | required | String | Transaction ID is returned by AppotaPay when charge successful | |
merchantRefId | required | String | A unique identifier of your choice | Min: 1 Max:40 |
amount | required | String | The amount to be refunded | Min: 1000 Support: VND |
currency | required | String | Refund currency | Support: VND |
Example Request
{
"merchantRefId": "7Xthy1kbi",
"transactionId": "01HJAG6Q3XMJBRJW28N1T8D6MM",
"amount": 1000000,
"currency": "VND"
}
Response Params
{
"refundId": "01HQJ41Q7135ZNJTKTWB92BTVH",
"transactionId": "01HQHRWBC773J6CJV9VRZMBXD2",
"merchantRefId": "S68O0whWv",
"amount": 500000,
"currency": "VND",
"status": "success",
"createdAt": "2024-02-26T14:11:12+07:00",
"updatedAt": "2024-02-26T14:11:15+07:00"
}
Success
Http Status Code
200
-OK
Parameters | Data type | Description |
---|---|---|
refundId | String | Unique ID is returned by AppotaPay |
transactionId | String | Unique ID of AppotaPay's original transaction |
merchantRefId | String | A unique identifier of merchant is sent in the request |
amount | String | Refund amount |
currency | String | Refund currency. Support VND. |
status | String | Status of the refund: success : Refund request succeeded error : Refund failed. pending : Processing |
errorInformation | Object | Failure reason |
errorInformation.errorCode | Integer | Error code. See error code |
errorInformation.message | String | Error message |
errorInformation.details | Array or Object | Error details |
errorInformation.details.field | String | Failure field |
errorInformation.details.reason | String | Reason why the field failed |
createdAt | String | Transaction creation time according to RFC-3339 standard, time zone UTC+7 |
updatedAt | String | Last updated time according to RFC-3339 standard, time zone UTC+7 |
Error
HTTP Status Code !=
200