Skip to main content
Version: Lastest

Payment integration

EndPoint

POST /api/v2/orders/create-payment

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
X-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",
"X-Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Request Params

ParamRequiredTypeDescriptionNote
transactionrequiredObjectTransaction information
transaction.amountrequiredIntegerPayment amount
transaction.currencyrequiredStringPayment currency(VND)Support VND
transaction.bankCoderequiredStringCheck Bank code list
transaction.paymentMethodrequiredStringCheck Payment method list
transaction.actionrequiredStringPayment action which partner can request (PAY), default: PAYSupport PAY
sourceOfFundsrequiredObjectPayment card/account information
sourceOfFunds.typerequiredObjectPayment type (Card / Account)Support Card / Account
sourceOfFunds.cardrequired_ifObjectCard objectRequired if type is card
sourceOfFunds.card.cardNumberrequiredStringCard number
sourceOfFunds.card.cardHolderNamerequiredStringCard holder
sourceOfFunds.card.cardMonthrequiredStringIssue/ Expiry month on card
Following the docs: LINK
sourceOfFunds.card.cardYearrequiredStringIssue/ Expiry year on card
Following the docs: LINK
sourceOfFunds.accountrequired_ifObjectAccount objectRequired if type is account
sourceOfFunds.account.accountNumberrequiredStringAccount number
sourceOfFunds.account.accountHolderNamerequiredStringAccount holder
sourceOfFunds.account.identificationNumberrequiredStringIdentification number
partnerReferencerequiredObjectPartner information
partnerReference.order.idrequiredStringOrder id of partnerMax: 50
partnerReference.order.inforequiredStringOrder information (max: 150 characters)Max: 150
partnerReference.order.extraDataoptionalStringAdditional informationMax: 200
partnerReference.notificationConfig.notifyUrlrequiredStringIPN URL to receive the transaction resultMax: 100
partnerReference.notificationConfig.redirectUrlrequiredStringURL to redirect on browserMax: 100

Example Request

{
"transaction": {
"amount": 10000,
"currency": "VND",
"bankCode": "VCB",
"paymentMethod": "ATM",
"action": "PAY"
},
"sourceOfFunds": {
"type": "card",
"card": {
"cardNumber": "9704000000000018",
"cardHolderName": "NGUYEN VAN A",
"cardMonth": "03",
"cardYear": "07"
}
},
"partnerReference": {
"order": {
"id": "5f61cf4f41e2b",
"info": "test thanh toan",
"extraData": ""
},
"notificationConfig": {
"notifyUrl": "https://devtool.vn/ipn",
"redirectUrl": "https://devtool.vn/redirect",
}
}
}

Response Params

ParamRequiredTypeDescription
transactionrequiredObjectTransaction information
transaction.transactionIdrequiredStringTransaction id of AppotaPay
transaction.statusrequiredStringTransaction status
transaction.errorCoderequiredIntegerError code list
transaction.errorMessagerequiredStringError detail
transaction.partnerCoderequiredStringPartner code
transaction.amountrequiredIntegerPayment amount
transaction.orderAmountrequiredIntegerOrder amount
transaction.feerequiredObjectPayment fee
transaction.fee.customer_feerequiredStringPayment fee for customer
transaction.currencyrequiredStringPayment currency
transaction.bankCoderequiredStringCheck Bank code list
transaction.paymentMethodrequiredStringCheck Payment method list
transaction.actionrequiredStringPayment action which partner can request (PAY), default: PAY
transaction.createdAtrequiredStringTransaction creation time (standard format: RFC-3339)
transaction.updatedAtrequiredStringLast updated time (standard format: RFC-3339)
authenticationrequiredObject
authentication.verificationUrlrequiredStringURL to verify payment
authentication.verificationMethodrequiredStringVerification method is used in the transaction (support: OTP)
authentication.verificationStatusrequiredStringVerification status for the transaction

Success

Http Status Code 200 - OK

{
"transaction": {
"transactionId": "AP123",
"status": "pending",
"errorCode": 35,
"errorMessage": "Giao dịch đang chờ xử lý",
"partnerCode": "TEST",
"amount": 11327,
"orderAmount": 10000,
"fee": {
"customer_fee": 1327
},
"currency": "VND",
"bankCode": "VCB",
"paymentMethod": "ATM",
"action": "PAY",
"createdAt": "2023-11-13 15:23:40.000",
"updatedAt": "2023-11-13 15:23:40.000"
},
"authentication": {
"verificationUrl": "https://ibanking.dev.appotapay.com/domestic-card/napas/confirm-otp?tran=eyJ0cmFuc0lkIjoiMDFIUjY4UFA3NEgxS1RINjNTV0ZKVllDNE4iLCJkYXRhS2V5IjoiNjdydzl4VFpLdEt0TTh4ZGtiRDlKYVhZbVROM1BCdlVHWDZIcnJpeTFuRGIwUksvRkp5Z2ZiWEo2SUt6U2ZWZGtwTmhEYmp1MTcxNXFqbWpndUlyL20xWTVtT0VKS0NlcEIwOCtQamlSZit2R2xEcTlFeU9FV3FjVnBEVjI4UWswbzQ5eEtTRXNFanBBZWJoRVNZMUNRRnlmWVMwU2NiQnJha0xWZ1FOMng3WTBUeGc4Uk9ESFhLK1N4SG80NFRNWUxtRkdSWk0xNExpOHBONHhrNWlyN1EvRkVoVVBqSDQ2aE50aCtQSFRkeW5MNlVKcnlOOEphcVdXaUNJOU1uVFJhcklraFU3MUlkU3REWFdwMlNQcEVhSTRZUGZuRElhZGhnRWF6Zk9WWm0zUjJibUxIMHllTEEwZndXTDY3VHk1ZFZpOUZwVWp4R01iZDZnMHB3eDNnZG1TcUkreHJLbTRJTUo4TEErN0JNU3JJTW9rUHVqZkY0UGd4Vk9vd3QrNUl4c0kvek40eGlPa1VjUWFwdWhoOTlpa1l0YTViNEpYTks3THZ3VVltYz0iLCJuYXBhc0tleSI6Ik1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcmJQNmlGbDBaOXBESHY1bmkvZmhsNE1FNkFmUDE2RTV6bXJIWWZ0YUJsY3ZxMWJXUndrMVRIMjNPcllRNm42akVHSWJtclZYeklNMDBsazcyMy9aSHR2YnlabGQ4cjVUY0VoNU0raC9qSXUzL0o5Z3FOWUdUbzlqTEowRHZSZFNmemJEV0pxUEltUGZjR0pEUlBUckV0Y2txbWQ4SHZrVTZKM01DUHJnMElPR1RZcGxVbXc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jg5MXhTMWFiRlJrVzJqZEN2cGMzSVVRTDZneStKRlFjWTJOU2FMaElZZ0JhZm1jbmdpQkZ0NGtrVHFVdXdTZElXdWRsM2pZa081OFNPWUtkeFc4amJYTTVLd1R1anBiMGdZQnBmMXU1ODI4Um1FcTZZRW9nL3l4L2hZUU9GUWxmSUJCWkZObVVKN1U1VERDRkwyd1Q1TXFQZzJjZmIxRGlydmVEM3NMU0lVYzkwSUpNM2VVWGZ6WHFrd2RyQ0tEWlJTdVYzVE1IQ2hpMUlSaW8yZmc3emVzaTlIbGlGdWVhZWtrdnlubndYb0c0MUxLYU1TQk1NL01kcmIydG0yOWpWWW5sWUo4Q29qK2RPaldoVTJ5ODNkRmk1REdyOGEzZnRXT2MrckV6MnpsT1VLUkY3UT09IiwiZXhwaXJ5RGF0ZSI6MTcwOTYwOTI0NSwiY2xpZW50SXAiOiIxMjcuMC4wLjEiLCJkZXZpY2VJZCI6IkRJMTc4MzQ2MzUyNSIsInBhbmVyQ29kZSI6Ilh1QXBwb3RhUGF5IiwiUGFydG5lck5hbWUiOiJYdUFwcG90YVBheSIsImFwaU9wZXJhdGlvbiI6IlBVUkNIQVNFX0FDQ09VTlQiLCJsYW5ndWFnZSI6InZpIiwidmVyc2lvbiI6InYxIn0=&sign=97b25a7e38d6501bbaeb4fa0793670209e3f6987e9c48f6b1fc58f0d828f79fa",
"verificationMethod": "OTP",
"verificationStatus": "AUTHENTICATE_REQUIRED"
}
}

Failure

HTTP Status Code != 200 HTTP Status Code != 200 with errorCode, please check this Error code list

Error response params

ParamRequiredTypeDescription
errorCoderequiredIntegerError code
messagerequiredStringError detail
errorsoptionalArray of ObjectDescribe error detail for fields (if any)
errors.fieldrequiredObjectThe fields occur error
errors.reasonrequiredObjectError reason
{
"errorCode": 1,
"message": "Invalid Params",
"errors": [
{
"field": "transaction.amount",
"reason": "Field amount is required"
},
{
"field": "transaction.currency",
"reason": "Field currency is required"
}
]
}

Error code list

Error codeDescription
1Missing or Invalid params
30Duplicate orderId, please try again
32Invalid amount
90X-Account-Ref-ID is invalid
140Partner does not have permission to use the paymentMethod
141Partner does not have permission to use the bankCode
500Server error