Error codes
What to do for each code that POS adds to the shared ones, and the code behind each refusal of the till window.
On this page
A refused request answers with the error object and a stable code, and a refusal changes nothing. The object, the codes every API shares and which of them to retry are on Errors. This page says what to do for the codes of the till, the order and the business day.
{
"code": "day_closed",
"message": "The business day of the till is closed. Nothing was changed.",
"requestId": "c7be7e31-5bfc-44a4-a17c-3300ad6b4462"
} Send the same request again after you fixed the cause, with the same operationId, or send a new change with a new operationId. See Idempotency and concurrency.
Codes of this API
| Code | HTTP | What to do |
|---|---|---|
till_not_found | 404 | List the tills and use one of their ids. |
business_day_not_found | 404 | List the business days of the till and use one of their ids. |
item_not_found | 404 | List the items and use the sku of one of them. |
order_not_found | 404 | Read the id from a list or from the operation result. |
payment_not_found | 404 | List the payments of the order and use one of their ids. |
refund_not_found | 404 | List the refunds of the order and use one of their ids. |
operation_not_found | 404 | Check the operationId; send the change if it was never sent. |
delivery_not_found | 404 | List the deliveries and use one of their ids. |
subscription_not_found | 404 | List the subscriptions and use one of their ids. |
invalid_status | 422 | Read the order and use the operation that fits its status. |
day_closed | 422 | Open a new business day for the till, then repeat the request. |
day_open | 422 | Close the open day before you open another. |
sale_in_progress | 422 | Finish, hold or void the current order, then resume. |
out_of_stock | 422 | Lower the quantity or remove the line. |
payments_taken | 422 | Refund the order once it is paid. |
order_paid | 422 | Refund the order instead. |
reader_busy | 422 | Wait for the payment to end or cancel it while the reader waits for the card. |
network_lost | 422 | Take cash, or repeat the request when the till reports online. |
no_declined_card | 422 | Start a card payment instead. |
no_card_payment | 422 | Read the till to see the state of its reader. |
not_paid | 422 | Read the order and refund it once it is paid. |
nothing_to_refund | 422 | Nothing to do. |
order_not_posted | 422 | Read the order and refund it when its sync is posted. |
insufficient_cash | 422 | Refund by card, or add cash to the drawer first. |
open_order | 422 | Finish or void the order, then close the day. |
held_orders | 422 | Resume or void the held orders, then close the day. |
queue_not_empty | 422 | Wait until the till reports an empty queue, then close the day. |
unknown_item | 422 | List the items and use one of their sku values. |
unknown_barcode | 422 | Look the item up with barcode on the list of items. |
invalid_quantity | 422 | Send a whole quantity of at least 1. |
no_such_line | 422 | Use the sku of a line of the order. |
invalid_discount | 422 | Send a whole percentage. |
discount_limit | 422 | Send a discount within the limit of the profile. |
unknown_customer | 422 | Use the id of a customer you know, or null for none. |
empty_order | 422 | Add a line first. |
invalid_amount | 422 | Send an amount above zero. |
amount_exceeds_due | 422 | Send at most the amount still due, or omit the amount. |
reason_required | 422 | Send one of the reasons of the reference. |
quantity_exceeds_sold | 422 | Read the order and send at most the units left to return. |
method_not_used | 422 | Refund by a method of the payments of the order. |
exceeds_method | 422 | Split the refund between the methods of the order. |
invalid_movement | 422 | Send a complete movement. |
invalid_count | 422 | Send the amount you counted in the drawer. |
invalid_float | 422 | Send the cash you put in the drawer. |
What the till window says
The window refuses an action with a sentence. The API refuses the same action with the code on the right. The card reader, the network and the queue belong to the till and have no code.
| The window says | The API answers |
|---|---|
| The business day is closed. Open a new day to continue. | day_closed |
| The business day is already open. | day_open |
| This order changed after you opened it. Reload it and try again. | revision_conflict |
| The order is in a state that does not allow this. | invalid_status |
| There is no such item in the catalogue. | unknown_item |
| No item has this barcode. | unknown_barcode |
| The quantity must be a whole number of at least 1. | invalid_quantity |
| There is not enough stock on the shelf. | out_of_stock |
| This item is not on the order. | no_such_line |
| A discount is a whole percentage from 0 to 100. | invalid_discount |
| The cashier profile does not allow a discount this large. | discount_limit |
| This customer does not exist. | unknown_customer |
| The sale has no items. | empty_order |
| Finish or hold the current sale before you resume another. | sale_in_progress |
| There is no such order. | order_not_found |
| A payment has been taken, so the sale cannot be voided. Refund it instead. | payments_taken |
| A paid order cannot be voided. Refund it instead. | order_paid |
| The card reader is working on a payment. | reader_busy |
| The amount must be greater than zero. | invalid_amount |
| The amount is more than what is still due. | amount_exceeds_due |
| The network is down. Card payments, refunds and closing the day need it. | network_lost |
| There is no declined card to try again. | no_declined_card |
| There is no card payment to cancel. | no_card_payment |
| Only a paid order can be refunded. | not_paid |
| Every item of this order has already been returned. | nothing_to_refund |
| Choose a reason for the refund. | reason_required |
| You cannot return more than was sold. | quantity_exceeds_sold |
| The customer did not pay by this method. | method_not_used |
| The refund is more than was paid by this method. | exceeds_method |
| This sale is still in the queue. Refund it after it has been posted. | order_not_posted |
| There is not enough cash in the drawer. | insufficient_cash |
| Enter an amount above zero and choose a reason. | invalid_movement |
| Enter the cash you counted, zero or more. | invalid_count |
| The opening float must be zero or more. | invalid_float |
| Finish or void the current sale before you close the day. | open_order |
| A sale is on hold. Resume or void it before you close the day. | held_orders |
| Sales are still waiting in the queue. Let them replay before you close the day. | queue_not_empty |