Skip to main content
Version: 1.0

Dynamic QR Code Payment

Dynamic QR Code Payment

Chat with AI▼

Endpoint: /api/v1/orders/payment/qr

Method: POST

Header Params​

Tham sốYêu cầuKiểu dữ liệuMô tảLưu ý
X-APPOTAPAY-AUTHrequiredString Cách tạo JWT_TOKEN
Content-TyperequiredStringGiá trị: application/json
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-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Tham số​

Tham sốKiểu dữ liệuYêu cầuMô tả
orderIdString√Mã đơn hàng phía đối tác
orderInfoString√Thông tin đơn hàng(tối đa 150 kí tự)
amountNumber√Số tiền thanh toán
clientIpString√Địa chỉ IP khách hàng thanh toán
notifyUrlString√IPN URL nhận kết quả giao dịch
redirectUrlStringURL chuyển hướng khi giao dịch hoàn tất
extraDataStringThông tin tuỳ chọn bổ sung
signatureString√Chữ ký kiểm tra dữ liệu signature = HMAC_SHA256(data, secretKey) data: amount={amount}&clientIp={clientIp}&extraData={extraData}notifyUrl={notifyUrl}&orderId={orderId}&orderInfo={orderInfo}&redirectUrl={redirectUrl}

Dữ liệu trả về​

Tham sốKiểu dữ liệuMô tả
errorCodeStringMã lỗi
messageStringThông tin mô tả mã lỗi
orderIdStringMã đơn hàng
amountIntegerSố tiền thanh toán
paymentUrlStringURL thanh toán
appotapayTransIdStringMã giao dịch
qrDataObjectThông tin qr code
qrData.qrCodeUrlStringQR Code URL
qrData.qrCodeExpiryInIntegerThời gian hết hạn của QR
signatureStringSignature generate theo thứ tự amount={amount}&appotapayTransId={appotapayTransId}&errorCode={errorCode}&message={message}&orderId={orderId}&paymentUrl={paymentUrl}&qrCodeExpiryIn={qrCodeExpiryIn}&qrCodeUrl={qrCodeUrl}

Ví dụ​

Request​

{
"orderId": "u7XR9xfTj",
"orderInfo": "test thanh toan",
"amount": 10000,
"notifyUrl": "http://yourwebsite.com/ipn",
"redirectUrl": "http://yourwebsite.com/redirect",
"extraData": "",
"clientIp": "103.53.171.140",
"signature": "c1ad6f769866d74003ffd4f7cf4f21230723c059e0744ec4fd75d16b8bff1001"
}

Response​

{
"errorCode": 0,
"message": "Thành công",
"orderId": "u7XR9xfTj",
"amount": 10000,
"paymentUrl": "https://payment.dev.appotapay.com/bank/payment/process?tran=dGlkPUFQMjIxNDM0NTk2NjQzJm9yZGVySWQ9dTdYUjl4ZlRqJnRzPTE2NTUwOTYwNDQ&sign=2212998138571e92b30222374163c82942bef1adde2c4972a3ec04d78b7134fe",
"appotapayTransId": "AP221434596643",
"qrData": {
"qrCodeUrl": "https://scontent.appotapay.com/cms-report-files/qrcode/ap2214345966431655096045.png",
"qrCodeExpiryIn": 1655355366
},
"signature": "fc06748cf4c32169d03d1935808e5a4e81b019c3173c1f396ce1aed482d936ba"
}

Error​

{
"errorCode": int,
"message": error message
}