Skip to main content
Version: Lastest

Payment Confirmation API

The API used to authenticate payment transactions in cases where multi-factor authentication is required

EndPoint

POST /api/v2/ewallet/payment/confirm

Header Params

ParametersRequirementData typeDescriptionNote
X-APPOTAPAY-AUTHrequiredString To create a JWT_TOKEN
AuthorizationrequiredStringUser Access 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-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": "Bearer JWT_TOKEN",
"Authorization": "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Request Params

ParametersRequirementData typeDescriptionNote
orderIdrequiredStringPartner's orderId
verificationMethodrequiredStringThe authentication method (OTP) received at the verificationMethod field Payment Request APIValue: OTP, NONE
verificationCoderequiredStringVerification code (OTP)min:1, max: 10
signaturerequiredStringData verification signaturesignature = hash_hmac('sha256', 'orderId={orderId}&verificationCode={verificationCode}' , SECRET_KEY))

Example Request

{
"orderId": "241698338917842945",
"verificationMethod": "OTP",
"verificationCode": "123456",
"signature": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"
}

Response Params

{
"transaction": {
"orderId": "123728435",
"partnerCode": "TEST",
"transactionId": "233728435",
"status": "success",
"amount": 120000,
"currency": "VND",
"orderVersion": "1.0",
"createdAt": "2024-01-29T11:36:03+07:00",
"updatedAt": "2024-01-29T11:36:03+07:00"
}
}

Success

Http Status Code 200 - OK

ParametersData typeDescriptionNote
transactionObjectTransaction information
transaction.transactionIdStringTransaction code from AppotaPay
transaction.partnerCodeStringPartner code
transaction.orderIdIntegerPartner's order code
transaction.statusStringTransaction status

pending = Transaction pending.

processing = Transaction processing.

success = Transaction success.

error = Transaction error.

transaction.amountIntegerPayment amount
transaction.currencyStringCurrency unit
transaction.orderVersionStringPayment version
transaction.errorCodeIntegerError code (returned only when status != success)
transaction.errorMessageStringDetailed error code information (returned only when status != success)
transaction.createdAtStringTransaction creation time (in RFC-3339 standard format)
transaction.updatedAtStringTransaction update time (in RFC-3339 standard format)

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 tại đây

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.
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
70You have exceeded the daily transaction limit, please try again later.
75Insufficient funds for payment
94The system is under maintenance, please try again later.
99Unknown error, please check the transaction again later
162You have exceeded the monthly transaction limit, please try again later.
401Authentication error
500The system encountered an error, please try again later.