Skip to main content
Version: Lastest

Payment request

EndPoint

POST /api/v2/partner/orders/payment/create

Header Params

ParameterRequirementData typesDescription
X-AppotaPay-AuthrequiredString How to generate a JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IdrequiredStringUUIDv4 format. Request ID is used to trace and verify the request in case of issues.
X-SignaturerequiredString

- The signature is generated using the HMAC SHA256 algorithm.

Ex: Signature = HMAC_SHA256(body, SECRET_KEY) , body: JSON string passed in the request.

{
"Content-Type": "application/json",
"X-AppotaPay-Auth": "JWT_TOKEN",
"X-Request-Id": "Your_Unique_id",
"X-Signature": "Your Signature"
}

Request Params

RequirementRequirementData typesDescriptionNotes
partner_ref_idrequiredStringPartner reference transaction ID, unique (regex: a-z, A-Z, 0-9, _, -)max: 26
order_inforequiredStringOrder informationmax: 100
terminal_idrequiredStringTerminal ID (provided by AppotaPay)max: 20
payment_methodrequiredStringPayment methods (POS, QR)
amountrequiredIntegerPayment amountmin: 10000
customer_phone_numberoptionalStringCustomer phone numbermax: 20

Example Request

{
"partner_ref_id": "igVSoghODYwBgJEbQdTj",
"order_info": "Appota test",
"terminal_id": "TID-5094322012",
"payment_method": "QR",
"amount": 12000,
"customer_phone_number": "0989898657"
}

Response Params

Success

Http Status Code 200 - OK

ParameterData typesDescriptionNotes
transactionObjectTransaction information
transaction.transaction_idStringTransaction ID AppotaPay
transaction.partner_ref_idStringPartner reference transaction ID
transaction.statusStringTransaction status

pending = The transaction is pending.

processing = The transaction is being processed.

success = The transaction is successful.

error = The transaction has failed.

void = The transaction has been refunded.

transaction.amountIntegerTransaction amount
transaction.error_codeIntegerTransaction error code (Note: returned only if status != success)
transaction.error_messageStringTransaction status details (Note: returned only if status != success)
transaction.payment_methodStringPayment methods
transaction.created_atStringTransaction creation time (ISO 8601 format)
transaction.paid_atStringTransaction payment time (ISO 8601 format)
payment_infoObjectPayment information (when using the QR payment method)
payment_info.qr_contentstringBase64-encoded QR payment image
payment_info.qr_urlstringQR payment link
payment_info.qr_typestringQR link (VIETQR is default)

Example Response Success

{
"transaction": {
"transaction_id": "01KFWSXKTKA645GHJMM27DWEBT",
"partner_ref_id": "igVSoghODYwBgJEbQdTj",
"status": "pending",
"amount": 12000,
"error_code": "34",
"error_message": "Giao dịch đang chờ xử lý",
"payment_method": "QR",
"created_at": "2026-01-26T16:24:49",
"paid_at": ""
},
"payment_info": {
"qr_content": "00020101021238630010A000000727013300069704320119MQQ0759866wrYqzPLw70208QRIBFTTA5204549953037045405120005802VN5916QRPAYMENT UAT 216011HO CHI MINH62430109wrYqzPLw70708Q07598660814AP26146183702063042A9D",
"qr_url": "",
"qr_type": "VIETQR"
}
}

Failure

HTTP Status Code != 200

ParameterData typeDescription
error_codeStringError code
error_messageStringError code description

Example

Code Example

curl --location 'https://pos-gw.dev.appotapay.com/api/v2/partner/orders/payment/create' \
--header 'Content-Type: application/json' \
--header 'X-AppotaPay-Auth: JWT_TOKEN' \
--header 'X-Request-Id: Your_Unique_id' \
--header 'X-Signature: Your signature' \
-d '{
"partner_ref_id": "igVSoghODYwBgJEbQdTj",
"order_info": "Appota test",
"terminal_id": "TID-5094322012",
"payment_method": "QR",
"amount": 12000,
"customer_phone_number": "0989898657"
}'

Request

REQUEST

Development server
Example (from schema)