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

Error bodies always include an errors key (often null) and usually error_code. Validation fields arrive either in errors or in data, depending on the scenario.

error_code values ​

The complete list from ApiErrorCode — twelve values: validation_failed, unauthorized, token_required, token_expired, token_invalid, not_found, conflict, rate_limited, business_rule, bad_request, forbidden, internal_error. The core emits no others; an add-on can send its own code through Response::errorWithCode().

HTTP ​

StatusWhen
400Validation, bad request
401Token missing, expired, or invalid
404Entity not found
409Conflict
429Rate limit
500Internal error

403 is less common on the storefront than 401 and 400.

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

Rate limit ​

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

See CORS and rate limit.