Error codes
The codes that ERP adds to the shared ones, with what to do for each, and the code behind each sentence of the product 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 has the codes of ERP.
{
"code": "credit_limit_exceeded",
"message": "The customer's unpaid invoices plus this order are over the credit limit. The order stays a draft.",
"requestId": "80d4643d-375e-413a-a86e-92a23f10ec3f"
} After you fixed the cause, send the same request again with the same operationId, or send a new change with a new one. See Idempotency and concurrency. A 409 means the state of the records does not allow the change: read, then decide. A 422 means a value is not acceptable whatever the state: a quantity, a price, a date, a reason.
Codes of this API
| Code | HTTP | Meaning | What to do |
|---|---|---|---|
item_not_found | 404 | The item does not exist. | List the items and use one of their codes. |
partner_not_found | 404 | The customer or supplier does not exist, or is not one of the kind the request needs. | List the partners with the role you need and use one of their ids. |
sales_order_not_found | 404 | The sales order does not exist. | Read the id from a list or from the operation result. |
delivery_not_found | 404 | The delivery does not exist. | Read the id from a list or from the operation result. |
invoice_not_found | 404 | The invoice does not exist. | Read the id from a list or from the operation result. |
purchase_order_not_found | 404 | The purchase order does not exist. | Read the id from a list or from the operation result. |
receipt_not_found | 404 | The receipt does not exist. | Read the id from a list or from the operation result. |
supplier_bill_not_found | 404 | The supplier bill does not exist. | Read the id from a list or from the operation result. |
work_order_not_found | 404 | The work order does not exist. | Read the id from a list or from the operation result. |
warehouse_not_found | 404 | The warehouse does not exist. | List the warehouses and use one of their ids. |
event_delivery_not_found | 404 | The event delivery does not exist. | List the event deliveries and use one of their ids. |
subscription_not_found | 404 | The subscription does not exist. | List the subscriptions and use one of their ids. |
operation_not_found | 404 | No change was sent with this operationId. | Check the operationId; send the change if it was never sent. |
item_code_taken | 409 | An item with this code already exists. | Read the existing item instead of creating it again. |
nothing_parked | 409 | The event delivery is not parked, so there is nothing to replay. | Replay only deliveries whose state is parked. |
wrong_status | 409 | The record is not in a status that allows this change. | Read the record and send the change its status offers. |
credit_limit_exceeded | 409 | The customer's unpaid invoices plus this order are over the credit limit. The order stays a draft. | Record the payments that are in, or have the limit raised, then confirm again. |
nothing_to_reserve | 409 | No unit that the order still wants is free in stock. | Wait for a receipt, or buy the short items, then reserve again. |
over_receipt | 409 | A quantity is more than the purchase order still waits for. | Receive at most the open quantity of each line. |
amount_exceeds_balance | 409 | The payment is more than the balance of the invoice. | Send at most the balance of the invoice. |
duplicate_bill | 409 | This supplier already has a bill with this number. | Read the existing bill instead of recording it again. |
receipt_missing | 409 | None of the billed items has been received on the purchase order, so the bill cannot be sent for approval. | Record the receipt, then submit the bill. |
match_differs | 409 | The bill does not match its order and receipts: a quantity or a price differs. | Read match on the bill, reject it with a reason, then correct its lines to the order. |
wrong_approval_step | 409 | The step is not the next one of the approval chain. | Send the step named in nextStep on the bill. |
bill_held | 409 | The bill is on hold and cannot be approved. | Release the bill, then approve it. |
bill_already_held | 409 | The bill is already on hold. | Nothing to do; release it when the cause is gone. |
bill_not_held | 409 | The bill is not on hold. | Nothing to do. |
payment_not_due | 409 | The payment day of the scheduled bill has not come. | Record the payment on or after the scheduled day. |
component_short | 409 | A component is not free in the quantity the work order needs. | Receive the component or finish a smaller quantity. |
invalid_quantity | 422 | A quantity is not a whole number from 1 to 1000000. | Send whole units, at least 1. |
invalid_price | 422 | A price is not a positive amount. | Send a price above zero. |
invalid_amount | 422 | The amount is not a positive amount. | Send an amount above zero with at most two decimals. |
invalid_date | 422 | A date is not a day of the calendar, or a bill is dated after today. | Send a day as YYYY-MM-DD; a bill is dated today or earlier. |
date_in_the_past | 422 | The payment day is before today. | Send today or a later day. |
no_lines | 422 | The document has no line. | Send at least one line. |
duplicate_item | 422 | An item appears on more than one line. | Put the item on one line with the total quantity. |
not_purchasable | 422 | The item is made in-house and cannot be put on a purchase order. | Run a work order for it. |
not_made | 422 | The item has no bill of materials, so it cannot be made. | Buy it with a purchase order. |
item_not_on_order | 422 | The item is not on the purchase order. | Use the items of the purchase order. |
supplier_mismatch | 422 | The supplier of the bill is not the supplier of the purchase order. | Send the supplier of the purchase order. |
number_required | 422 | The number on the supplier's document is empty or longer than 40 characters. | Send the number as printed on the bill. |
reason_required | 422 | The reason is empty or longer than 200 characters. | Send a reason of 1 to 200 characters. |
over_plan | 422 | The produced quantity is more than the work order plans. | Finish at most the planned quantity. |
What the product window says
The product window refuses an action with a sentence. The API refuses the same action with the code on the right.
| The window says | The API answers |
|---|---|
| The record changed since you opened it. Nothing was applied. | revision_conflict |
| The record is not in a state that allows this. | wrong_status |
| A quantity is a whole number from 1 to 1000000. | invalid_quantity |
| A price must be above zero. | invalid_price |
| That is not a valid day, or the bill is dated after today. | invalid_date |
| The document has no lines. | no_lines |
| This item does not exist. | item_not_found |
| An item may stand on one line only. | duplicate_item |
| This order no longer exists. | sales_order_not_found |
| This customer does not exist. | partner_not_found |
| The customer's balance with this order would be over the credit limit. The order stays a draft. | credit_limit_exceeded |
| None of the units this order still wants is free in stock. | nothing_to_reserve |
| The amount must be above zero. | invalid_amount |
| The payment is more than the balance of the invoice. | amount_exceeds_balance |
| This supplier does not exist. | partner_not_found |
| A made item is not bought; run a work order. | not_purchasable |
| This purchase order does not exist. | purchase_order_not_found |
| The item is not on the purchase order. | item_not_on_order |
| That is more than the purchase order still waits for. | over_receipt |
| This bill no longer exists. | supplier_bill_not_found |
| The supplier of the bill is not the supplier of the order. | supplier_mismatch |
| This supplier already has a bill with that number. | duplicate_bill |
| Enter the number on the supplier’s document, up to 40 characters. | number_required |
| No billed item has been received on the order yet, so the bill cannot go for approval. | receipt_missing |
| The bill is on hold. Release it before approving. | bill_held |
| The bill is not on hold. | bill_not_held |
| The bill is already on hold. | bill_already_held |
| That step is not the next one of the approval chain. | wrong_approval_step |
| The bill does not match its order and receipt, so it cannot be approved. | match_differs |
| Write a reason of up to 200 characters. | reason_required |
| The payment day cannot be before today. | date_in_the_past |
| The payment day of this bill has not come. | payment_not_due |
| This work order no longer exists. | work_order_not_found |
| This item has no bill of materials, so it cannot be made. | not_made |
| The quantity made is more than the work order plans. | over_plan |
| Not enough free components. Nothing was consumed. | component_short |