Skip to content
  1. Extras
  2. MiniShop3
  3. Development
  4. Web API
  5. Errors

Errors ​

Shape ​

json
{
  "success": false,
  "message": "…",
  "code": 400,
  "errors": null,
  "error_code": "bad_request"
}
FieldMeaning
codeHTTP status
errorsField map or null (key always present)
error_codeMachine code
dataPresent only when it is passed

Router responses always carry errors and error_code (errors is often null). Before the router runs — on an empty route — neither key is present. A validation field map arrives in errors with status 422 and code validation_failed; an empty fields on order/set and an empty cart key stay 400.

error_code values ​

error_codeWhen
validation_failed422, field map
unauthorized401, no customer where one is required
token_required401, a token is required and no guest token was minted
token_expired401, the token has expired
token_invalid401, the token is missing from the database or corrupted
not_found404
conflict409
rate_limited429
business_ruleA shop rule; the status comes from the calling code
bad_request400
forbidden403. Web API controllers never return this code
internal_error500 and 503

The core emits no other codes. An add-on can send its own through Response::errorWithCode().

HTTP ​

StatusWhen
400Malformed request with no field map: empty route, empty fields, empty line key
401Token expired, invalid, or required where the server minted no guest token: token_expired, token_invalid, token_required, unauthorized
404Entity not found
409Conflict
422Field map: address, profile, validation_failed
429Rate limit
500Internal error
503The ms3 service did not start; error_code is internal_error

403 is set only by the Manager API permission middleware.

In TypeScript, type the response as a union: success | error with error_code and an optional errors.

A closed draft field ​

Since 1.14.2-beta1 the internal columns of the order draft are closed for frontend writes. An attempt returns the ms3_err_field_protected lexicon entry: POST /order/add answers 400 with business_rule, POST /order/set answers 422 with validation_failed and the key in errors. POST /order/remove answers 404 ms3_err_field_nf on such a key, and POST /order/submit drops it silently.

The list of closed columns and how to extend it: see checkout.

Rate limit ​

RateLimitMiddleware: settings ms3_rate_limit_max_attempts, ms3_rate_limit_decay_seconds. Exceeded → 429 / rate_limited.

See CORS and rate limit.