How it works for paycollect:
- You provide us invoice_id and amount to receive
- You will receive an order_id
- Use it to check paid_amount
- You will also provide us with a callbackURL, the system will send requests with parameters like (status, paid_amount, expiry_time, invoice_id, signature)
Note: please check the signature of the callbackURL with the signature when Create Order, provided by us
🔴 PAYGATE / Create Order / POST
curl --location '{{endpoint}}/paygate/create' \
--header 'Content-Type: application/json' \
--header 'merchant_token: {your_tokens}' \
--data '{
"invoiceID" : "CODE0001",
"paymentMethod" : "MASTERCARD",
"Description" : "content",
"amount" : 10000,
"buyerFullname" : "tenkh",
"buyerEmail" : "email@kh.com",
"buyerMobile" : "84988508882",
"buyerAddress" : "Diachikh",
"callbackURL" : "http://localhost/callback",
"errorURL" : "http://localhost/error"
}'
- invoiceID: varchar(60) / let me know your invoice_id
- paymentMethod: MASTERCARD, VISACARD, JCBCARD, ATM
- amount: int(60) / amount to be paid
⚪ Response
{
"error": false,
"order_id": "5nlMLA9D",
"buyer_key": "2a9cf3a774da9d44596ea80031f53c5e",
"checkout": "https://******/paygate/order/******/checkout"
}
🔴 PAYGATE / Check Order / GET
curl --location '{{endpoint}}/paygate/order/{{ORDER_ID}}'
⚪ Response
{
"invoice_id": "CODE0001",
"amount": "10000",
"status": "1",
"buyer_key": "2a9cf3a774da9d44596ea80031f53c5e",
"msg": "created",
"checkout": "https://******/paygate/order/*******/checkout",
"error": false
}
🔴 PAYCOLLECT / Create Order / POST
curl --location '{{endpoint}}/paycollect/create' \
--header 'Content-Type: application/json' \
--header 'merchant_token: {your_tokens}' \
--data '{
"invoiceID": "RANG0014",
"amount": 5000,
"callbackURL": "https://localhost/callbank"
}'
⚪ Response
{
"error": false,
"order_id": "5nlMLA9D",
"request_amount": 5000,
"expiry_time": 1690716866,
"payqr": "https://api.vietqr.io/image/970423-88815061991-kVZNTBn.jpg?amount=5000&addInfo=XAPPX8ZNLC",
"signature": "954070a5aa4854c7ff360bbb34472542"
}
- order_id: use to check order
- expiry_time: timestamp expiration for order
- payqr: URL image for transaction
- signature: use for callback validation (can use or not)
🔴 PAYCOLLECT / Check Order / GET
curl --location '{{endpoint}}/paycollect/order/5nlMLA9D'
⚪ Response
{
"invoice_id": "RANG0014",
"amount": "5000",
"paid_amount": "5000",
"expiry_time": "1690716866",
"payqr": "",
"status": "1",
"msg": "success",
"error": false
}
- paid_amount: 0 means unpaid
- expiry_time: timestamp expiration for order
- payqr: URL image for transaction