Reverse Authorization
This API provides a reversing charge when the charge has AUTHORIZED
status and hasn't yet been captured. You can use this API to cancel an authorization.
The maximum time to create a reversal is T+7 days since the respective transaction was authorized. If the transaction isn't captured or reversed after T+7 days, our system will perform reversal automatically.
EndPoint
POST
/credit-card/reversal
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 |
---|---|---|---|
authorizationId | required | String | Charge ID of authorization, it’s returned in the Create Charge API response with capture:false |
merchantRefId | required | String | Your reference ID for identifying the transaction |
Example Request
{
"merchantRefId": "MufRIHgy13",
"authorizationId": "01HJAFB1GMVTC74SN2FMA5PG5X"
}
Response Params
{
"reversalId": "01HQHS26CFK4CEGE2QW0PATV5B",
"authorizationId": "01HQHRZQNJE4BWRB8P9P5Z8BE7",
"merchantRefId": "MufRIHgy11",
"amount": 1000000,
"currency": "VND",
"status": "success",
"createdAt": "2024-02-26T10:59:13+07:00",
"updatedAt": "2024-02-26T10:59:15+07:00",
"reversedAt": "2024-02-26T10:59:14+07:00"
}
Success
Http Status Code
200
-OK
Parameters | Data type | Required | Description |
---|---|---|---|
merchantRefId | String | required | A unique identifier of merchant is sent in the request |
authorizationId | String | required | Charge ID of authorization |
reversalId | String | required | ID of the reversal transaction that AppotaPay generates and returns to merchant |
amount | Number | required | The amount that requested to be reversed for this charge |
status | String | required | Status of the reverse authorization success : Reverse Authorization request is success error : Reverse Authorization is failed with detail failure reason pending : Reverse Authorization request is processing |
errorInformation | Object | optional | Failure reason |
errorInformation.errorCode | Integer | required | Error code. See error code |
errorInformation.message | String | required | Error message |
errorInformation.details | Array or Object | optional | Error details |
errorInformation.details.field | String | required | Failure field |
errorInformation.details.reason | String | required | Reason why the field failed |
createdAt | String | required | Time create is made according to RFC-3339 standard, time zone UTC+7 |
updatedAt | String | required | Time update is made according to RFC-3339 standard, time zone UTC+7 |
reversedAt | String | optional | Time reversed is made according to RFC-3339 standard, time zone UTC+7 |
Error
HTTP Status Code !=
200