Skip to main content
Version: Lastest

Cancellation Payment API

EndPoint

POST /api/v2/ewallet/transaction/cancel

Header Params

ParametersRequirementData typeDescriptionNote
X-APPOTAPAY-AUTHrequiredString To create a JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IDoptionalStringFormat is UUIDv4. Request ID for troubleshooting purposesmax:42
X-LanguageoptionalStringValue vi or en The value corresponding to the payment link can be in Vietnamese or English (default: vi)

in:vi,en

{
"X-APPOTAPAY-AUTH": "Bearer JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi"
}

Request Params

ParametersRequirementData typeDescriptionNote
orderIdrequiredStringPartner's order code
signaturerequiredStringData verification signaturesignature = hash_hmac('sha256', 'orderId={orderId}&verificationCode={verificationCode}' , SECRET_KEY)

Example Request

{
"orderId": "241698338917842945",
"signature": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"
}

Response Params

Success

Http Status Code 200 - OK

ParametersData typeDescription
transactionIdStringTransactionId from AppotaPay
orderIdIntegerPartner's orderId

Error

HTTP Status Code != 200

ParametersData typeDescription
errorCodeIntegerError code
messageStringDescription about the error

Common error code table

The full error code is available, please see here

Error codeDescription
1Request information missing or invalid
2The signature parameter is incorrect.
21The OTP code is incorrect.
22The OTP code has expired, please perform the transaction again.
30The order code is duplicated, please perform the transaction again.
32The payment amount is invalid.
33Transaction failed.
34The transaction is being processed, please check again later.
36The transaction does not exist.
39The user has entered the OTP code incorrectly too many times.
40The transaction has been refunded.
41The transaction was successful previously.
42The request to obtain the OTP code has exceeded the specified number of attempts
52Invalid payment method
65Invalid account
70You have exceeded the daily transaction limit, please try again later.
75Insufficient funds for payment
84The transaction amount exceeds the allowed limit, please contact support for assistance.
93The transaction refund time has elapsed.
94The system is under maintenance, please try again later.
99Unknown error, please check the transaction again later
106The transaction does not support partial refunds.
125Unable to refund the transaction as the refund period has expired
162You have exceeded the monthly transaction limit, please try again later.
401Authentication error
500The system encountered an error, please try again later.