Skip to main content
Version: Lastest

Payment

ATM/Visa/Mastercard payments support token-saving payments (save card information for future payments)

(only supports some providers)

EndPoint

POST /api/v2/orders/payment

Header Params

ParamsRequirementData 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": "JWT_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

ParamsRequirementData typeDescriptionNote
transactionrequiredObjectTransaction information
transaction.amountrequiredIntegerThe payment amount
transaction.currencyrequiredStringCurrency unit(VND)Accepted: VND
transaction.bankCodeoptionalStringRefer to Bank code table
transaction.paymentMethodrequiredStringRefer to Payment method code table
transaction.actionrequiredStringAction payment
transaction.tokenoptionalStringToken used for payment (in case of using token)
partnerReferencerequiredObjectPartner information
partnerReference.order.idrequiredStringPartner's order code50
partnerReference.order.inforequiredStringOrder information (maximum 150 characters)150
partnerReference.order.extraDataoptionalStringOptional additional information200
partnerReference.notificationConfig.notifyUrlrequiredStringURL to receive transaction results100
partnerReference.notificationConfig.redirectUrlrequiredStringRedirect URL in the browser100
partnerReference.notificationConfig.deeplinkUrloptionalStringRedirect result to app mobile100
partnerReference.notificationConfig.installmentNotifyUrloptionalStringIPN for installment conversion transaction notification100

Example Request

{
"transaction": {
"amount": 10000,
"currency": "VND",
"bankCode": "VCB",
"paymentMethod": "ATM",
"action": "PAY"
},
"partnerReference": {
"order": {
"id": "5f61cf4f41e2b",
"info": "test thanh toan",
"extraData": ""
},
"notificationConfig": {
"notifyUrl": "https://devtool.vn/ipn",
"redirectUrl": "https://devtool.vn/redirect",
"installmentNotifyUrl": "https://devtool.vn/redirect"
}
}
}

Response Params

ParamsRequirementData typeDescription
transactionrequiredObjectTransaction information
transaction.transactionIdrequiredStringThe transaction code on AppotaPay's side
transaction.statusrequiredStringTransaction status
transaction.errorCoderequiredInteger[Error code](./payment.mdx#error code table)
transaction.errorMessagerequiredStringError description
transaction.partnerCoderequiredStringpartner code
transaction.orderAmountrequiredIntegerPayment amount (Min: 1000, Max: 500000000)
transaction.currencyrequiredStringCurrency unit
transaction.bankCoderequiredStringbankcodeThe customer has selected
transaction.paymentMethodrequiredStringPayment Method
transaction.actionrequiredStringType of payment
transaction.createdAtrequiredStringTransaction creation time. (in RFC-3339 standard format)
transaction.updatedAtrequiredStringTransaction update time. (in RFC-3339 standard format)
paymentrequiredObject
payment.urlrequiredStringPayment URL, the 'lang' parameter in the payment link can be changed to 'vi' or 'en' corresponding to the customer's desired language
payment.qrCodeoptionalObjectReturned in case of payment with QR code
payment.qrCode.urloptionalStringQR payment URL
payment.qrCode.contentoptionalStringQR content to generate the payment QR code
payment.qrCode.expiryoptionalStringQR payment expiration time. (in RFC-3339 standard format)
payment.deepLinkUrloptionalStringLink to open payment app if available

Success

Http Status Code 200 - OK

{
"transaction": {
"transactionId": "AP123",
"status": "pending",
"errorCode": 35,
"errorMessage": "The transaction is pending, please check it later",
"partnerCode": "TEST",
"orderAmount": 10000,
"currency": "VND",
"bankCode": "VCB",
"paymentMethod": "ATM",
"action": "PAY",
"createdAt": "2024-04-01T14:46:20.000",
"updatedAt": "2023-04-01T14:46:20.000"
},
"payment": {
"url": "https://payment.dev.appotapay.com/v2/bank/payment/process?tran=dGlkPUFQMjMxNDQwNDkwODI0Jm9yZGVySWQ9YVY2a01uakR2JnRzPTE2OTkyMzYwNTQ&sign=bfff37df0d919ac1ea9d7163934bbc8ce785c6bbf7a210fb12696c8e531532ed&lang=vi",
"qrCode": null,
"deepLinkUrl": ""
}
}

Error

HTTP Status Code != 200 With the returned errorCode, please refer to the error code table here

Error response params

ParamsRequirementData type** Description**
errorCoderequiredIntegerError code
messagerequiredStringError description
errorsoptionalArray of ObjectDetailed error description of each field if available
errors.fieldrequiredObjectField with error
errors.reasonrequiredObjectDescription of the field with error
{
"errorCode": 1,
"message": "Invalid Params",
"errors": [
{
"field": "transaction.amount",
"reason": "Field amount is required"
},
{
"field": "transaction.currency",
"reason": "Field currency is required"
}
]
}

Error code table

Error codeDescription
1Missing or invalid request information
30The order code is duplicated, please redo the transaction.
32The amount is invalid.
140The partner does not have permission to use the paymentMethod
141The partner does not have permission to use the bankCode
500The system encountered an error, please try again later