تخطَّ إلى المحتوى

Errors

هذا المحتوى غير متوفر بلغتك بعد.

{"error": {"code": "UNKNOWN_REFERENCE",
"message": "Unknown price list RETAIL: PUT /price-lists/RETAIL first.",
"details": [],
"request_id": "req_01J9X4Q7T2M8P3NRT6V5WZ",
"retryable": false}}

retryable tells you whether the same call can succeed later, so you don’t need your own table. Quote request_id (also in the X-Request-Id header of every answer) when you contact us.

Status Codes What to do
400 INVALID_REQUEST (a bad query or path), IDEMPOTENCY_KEY_REQUIRED Fix the call.
401 TOKEN_INVALID, TOKEN_EXPIRED, TOKEN_REVOKED, COMPANY_SUSPENDED Stop the job and alert. Retrying won’t help.
403 SCOPE_MISSING (names the scope), IP_NOT_ALLOWED Ask the administrator to change the client.
404 NOT_FOUND Unknown id, path or reference list.
409 ALREADY_ACKNOWLEDGED, ORDER_NOT_AWAITING_ACK, ERP_MODE_NOT_API, EXTERNAL_REF_CONFLICT, BRANCH_ON_ROUTE, REQUEST_IN_PROGRESS Only REQUEST_IN_PROGRESS is worth a retry.
422 INVALID_REQUEST (pushed data that can’t be accepted: over 500 rows, a malformed key, a negative price), UNKNOWN_REFERENCE, IDEMPOTENCY_KEY_REUSED Fix the data, then retry.
429 RATE_LIMITED Wait Retry-After seconds. See rate limits.
500 INTERNAL Retry with back-off; quote request_id if it persists.
503 (gateway) Retry with back-off, honouring Retry-After when sent.

UNKNOWN_REFERENCE lists each missing key in details with the call to make first — push the price list before its prices, the unit before the product that uses it. Nothing is written when it’s returned.

Every code, with what it means and what to do, is in the error codes reference.

Two calls that are refused on purpose — a filter that doesn’t exist, and a write without a key:

Terminal window
curl -sg "$SLFLO_BASE/orders?filter[nope]=1" -H "Authorization: Bearer $SLFLO_TOKEN" | jq -c '.error | {code, retryable, message}'
# {"code":"INVALID_REQUEST","retryable":false,"message":"filter[nope] is not a filter of /orders. Known: …"}
curl -s -X PUT "$SLFLO_BASE/units/BOX" -H "Authorization: Bearer $SLFLO_TOKEN" \
-H "Content-Type: application/json" -d '{"name":{"en":"Box"}}' | jq -c '.error | {code, retryable}'
# {"code":"IDEMPOTENCY_KEY_REQUIRED","retryable":false}