Skip to main content
Version: Lastest

API Request Payment

EndPoint

POST /api/v2/ewallet/payment

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-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
orderIdrequiredStringReference transaction codemax: 50, alphanumeric
orderInforequiredStringOrder informationmax: 150, alphanumeric
extraDataoptionalStringAdditional informationmax: 1000
amountrequiredIntegerThe payment amountmin: 1000, max: 500000000
currencyrequiredStringThe currency unitValue: VND
signaturerequiredStringSignature for data verificationsignature = hash_hmac('sha256', 'amount={amount}&currency={currency}&extraData={extraData}&orderId={orderId}&orderInfo={orderInfo}' , SECRET_KEY).

Example Request

{
"orderId": "123",
"orderInfo": "test",
"amount": 120000,
"currency": "VND",
"extraData": "test",
"signature": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"
}

Response Params

{
"transaction": {
"orderId": "123728435",
"partnerCode": "TEST",
"transactionId": "233728435",
"status": "success",
"amount": 120000,
"currency": "VND",
"orderVersion": "1.0",
"verificationMethod": "NONE",
"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.transactionIdStringThe transaction code from AppotaPay
transaction.partnerCodeStringPartner code
transaction.orderIdIntegerThe partner's order code
transaction.statusStringTransaction status

pending = Transaction pending.

processing = Transaction processing.

success = Transaction success.

error = Transaction error.

transaction.amountIntegerThe payment amount
transaction.currencyStringThe currency unit
transaction.orderVersionStringThe payment version
transaction.errorCodeIntegerError code (only returned when status != success)
transaction.errorMessageStringDetails of the error code (only returned when status != success)
transaction.verificationMethodStringAuthentication method (only returned when status != error)Value: OTP, NONE
transaction.createdAtStringThe transaction creation time (in RFC-3339 standard format)
transaction.updatedAtStringThe transaction 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.
30Mã đơn hàng đã bị trùng, vui lòng thực hiện lại giao dịch
32Số tiền không hợp lệ
33Transaction failed.
34The transaction is being processed, please check again later.
52Invalid payment method
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.
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.