Nhảy tới nội dung
Phiên bản: 1.0

Thanh toán QrCode động

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

Method: POST

Header: Cách tạo JWT_TOKEN

{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}

Tham số

Tham sốKiểu dữ liệuYêu cầuMô tả
orderIdStringMã đơn hàng phía đối tác
orderInfoStringThông tin đơn hàng(tối đa 150 kí tự)
amountNumberSố tiền thanh toán
clientIpStringĐịa chỉ IP khách hàng thanh toán
notifyUrlStringIPN 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
signatureStringChữ ký kiểm tra dữ liệu signature = HMAC_SHA256(data, secretKey) data: amount={amount}&clientIp={clientIp}&extraData={extraData}¬ifyUrl={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
}