Skip to main content

Cancel a POS order

Use this API to cancel a POS order created on a Payoo POS terminal, for example when the customer does not continue with the payment.

PUT
URLhttps://open-api.tingee.vn/v1/update-pos-bill

Cancel a POS order by billId on the Payoo system.

Header Request​

HeaderRequiredDescription
Content-Type✓application/json
x-client-id✓Partner identifier issued by TINGEE.
x-signature✓HMAC SHA512 authentication signature. See How to generate the signature.
x-request-timestamp✓Time the request is sent (format: yyyyMMddHHmmssSSS, UTC+7)

Body Parameter​

FieldTypeRequiredDescription
bankBinstring✓Always pass PAYOO.
vaAccountNumberstring✓Payoo POS device code.
billIdstring✓ID of the order to cancel, received from the Create a POS order API.

Code samples​

curl --location --request PUT 'https://open-api.tingee.vn/v1/update-pos-bill' \
--header 'accept: application/json' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-request-timestamp: 20240509154004003' \
--header 'x-signature: YOUR_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"bankBin": "PAYOO",
"vaAccountNumber": "POS00012345",
"billId": "9f1c2b7e4a5d4c3b8e2f1a0b9c8d7e6f"
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"ReturnCode": "0",
"Description": "Success"
}
}
FieldTypeDescription
codestringResult code (00 = Success).
messagestringResponse message.
dataobjectRaw response from Payoo. ReturnCode = "0" means the order was cancelled successfully.
caution

A cancelled order can no longer be paid on the POS terminal. If you need to collect the payment again, create a new order with the Create a POS order API.


Common error codes​

CodeDescriptionHow to handle
1010The Merchant's account number was not foundCheck the vaAccountNumber and bankBin of the linked POS terminal.
1063Not supported for this bankThe API only applies to bankBin = "PAYOO".
400Error from Payoo or invalid datamessage contains the detailed error from Payoo (e.g. the order does not exist or has already been cancelled).
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.