Skip to main content

Response & error codes

Every request to the Edge API returns a standard HTTP status code. This page lists the codes the API returns, what each one means, and the conditions that trigger it.

Response format​

A successful call returns the standard envelope — an HTTP 200 with a body that wraps the result in code, msg, and data.

Error responses do not use that envelope. A failed call returns the relevant HTTP status with a body containing a single detail field. Read the HTTP status code, not the body, to decide whether a call succeeded.

Success — 200 (BaseResponse envelope)
{
"code": 200,
"msg": "Success",
"data": { /* … present only on endpoints that return a payload */ }
}
Error — 4xx / 5xx (single message)
{
"detail": "No related transaction found, transaction_id: …"
}

One exception: a 422 validation failure returns detail as an array of field-level errors, one entry per invalid field. Each entry names the field in loc, with a human-readable msg and a machine-readable type.

Validation error — 422 (e.g. item-added with quantity omitted and a non-numeric price)
{
"detail": [
{
"type": "missing",
"loc": ["body", "quantity"],
"msg": "Field required"
},
{
"type": "float_parsing",
"loc": ["body", "price"],
"msg": "Input should be a valid number"
}
]
}

Status codes​

Success — 2xx​

StatusWhen it's returnedWhere
200 OKThe request succeeded. The body follows the { code, msg, data } envelope; data is present only on endpoints that return a payload.All

Client errors — 4xx​

StatusWhen it's returnedWhere
400 Bad RequestThe transaction can't accept the action: no transaction matches the transaction_id, the transaction is already finalized, or it has not been started yet. Starting a transaction also fails this way if its transaction_id was already used on this SCO — even by an earlier transaction that has since finished or been abandoned — until it's released with POST …/transaction-reset.Item, Transaction, State, Alert
401 UnauthorizedDevice registration failed because the client_id or client_secret is incorrect.Auth
403 ForbiddenThe token header is missing, expired, or invalid. Applies to every token-gated call — that is, all endpoints except device-register, which authenticates with client_id/client_secret instead. Obtain a fresh token via device registration and retry.State, Transaction, Alert, Item, Multimedia
404 Not FoundThe referenced resource doesn't exist — an alert, a transaction, or a stored video/image.Alert, Transaction, Multimedia
422 Unprocessable EntityThe request body failed validation — a required field is missing or has the wrong type. detail is an array listing each invalid field.All
429 Too Many RequestsA rate limit was exceeded for this SCO or across the box. Back off and retry after the window. See rate limits for the per-endpoint thresholds.Auth, State, Transaction, Alert, Item

Server errors — 5xx​

StatusWhen it's returnedWhere
500 Internal Server ErrorAn unexpected error occurred while handling the request. The response has no structured body. Safe to retry; if it persists, escalate.All
503 Service UnavailableThe sco_id in the request path has no camera mapping on this box, so the unit can't be served. This points to a configuration gap, not a transient fault.Item, Transaction, State, Alert

Endpoint-specific notes​

Rate limits (429)​

Most write endpoints are rate-limited; reads, item updates, finalized prices, and alert updates are not. Each limit is counted over a rolling 60-second window, both per SCO (keyed on the sco_id in the path) and across the whole box.

EndpointPer SCO / 60sBox-wide / 60s
POST …/device-register550
POST …/states30300
POST …/weighting-scale-not-matched30300
POST …/transaction-started30300
POST …/transaction-completed30300
POST …/transaction-reset30300
POST …/scan-started30300
POST …/scan-completed30300
POST …/item-added1201200
POST …/item-removed1201200

Not found (404) resources​

The resource that's missing depends on the endpoint:

  • Alert — the alert being updated doesn't exist.
  • Transaction — the requested transaction doesn't exist.
  • Video / image — the requested media file isn't on the box.
note

A wrong client_id/client_secret at device registration returns 401. A missing or expired session token on any other call returns 403.