Suppliers error catalog
The Suppliers service (/suppliers/*) returns errors with this shape:
{ "code": "not-found", "message": "Purchase order not found" }Branch your logic on code and the HTTP status, not on message: messages can change.
Errors common to the whole service
| Code | HTTP | Cause |
|---|---|---|
bad-request/missing-tenant | 401 | The request carries no tenant. Check your API key. |
tenant/suspended | 403 | The tenant is suspended, for example because of billing. |
permission-denied | 403 | The endpoint's permission is missing. The body carries requiredPermission with the missing permission. |
not-found | 404 | The resource (purchase order, supplier, contact, address or payment) does not exist in your tenant, or the route does not exist. |
internal-server-error | 500 | Internal error. Retry with increasing backoff. |
Validation errors
When Fenicia rejects the content of a request, it returns 400 with code: "validation-error" and a message that says which datum is missing or invalid. Some endpoints return a more specific code:
| Code | HTTP | Cause |
|---|---|---|
validation-error | 400 | The content breaks a rule. Examples: the order is in another currency and fxRate is missing; batchNumber or expirationDate is missing for a variant with traceability; a supplier return asks for more pieces than are left. |
validation/address | 400 | A supplier's address does not match the schema. |
validation/contact | 400 | A supplier's contact does not match the schema. |
payment/conflict | 409 | Two concurrent payments on the same order. Retry. |
A rejected reception does not count as received
If a reception fails, the order keeps its status and quantities. Retrying the same reception is safe: Fenicia identifies the reception by its number within the order and does not duplicate the reception or the lots.
When to retry
| Status | Retry? | Notes |
|---|---|---|
400 | No | Fix the request according to the message. |
401, 403 | No | Check your API key, its permission and the tenant's status. |
404 | No | The resource does not exist in your tenant. |
409 | Yes | Another payment was in progress. |
500 | Yes, with increasing backoff | Before retrying a reception, check the order's status. |