Skip to main content
Version: Lastest

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

ParamRequiredTypeDescriptionNote
X-APPOTAPAY-AUTHrequiredString How to generate JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IDoptionalStringUUIDv4 format. Request ID to check when a problem occursmax:42
LanguageoptionalStringThe value vi or en corresponding to the payment link will be Vietnamese or English, (default: vi)

in:vi,en

X-Account-Ref-IDoptionalString

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

ParametersRequirementData typeDescription
authorizationIdrequiredStringCharge ID of authorization, it’s returned in the Create Charge API response with capture:false
merchantRefIdrequiredStringYour 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

ParametersData typeRequiredDescription
merchantRefIdStringrequiredA unique identifier of merchant is sent in the request
authorizationIdStringrequiredCharge ID of authorization
reversalIdStringrequiredID of the reversal transaction that AppotaPay generates and returns to merchant
amountNumberrequiredThe amount that requested to be reversed for this charge
statusStringrequiredStatus 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
errorInformationObjectoptionalFailure reason
errorInformation.errorCodeIntegerrequiredError code. See error code
errorInformation.messageStringrequiredError message
errorInformation.detailsArray or ObjectoptionalError details
errorInformation.details.fieldStringrequiredFailure field
errorInformation.details.reasonStringrequiredReason why the field failed
createdAtStringrequiredTime create is made according to RFC-3339 standard, time zone UTC+7
updatedAtStringrequiredTime update is made according to RFC-3339 standard, time zone UTC+7
reversedAtStringoptionalTime reversed is made according to RFC-3339 standard, time zone UTC+7

Error

HTTP Status Code != 200