Skip to main content
The Store API uses a consistent, Stripe-style error format across all endpoints. Every error response includes a machine-readable code and a human-readable message.

Error Response Format

All errors return a JSON object with a single error key:
Validation errors include an additional details field with per-field error messages:

Schema

HTTP Status Codes

Error Codes

Authentication & Authorization

Resource Errors

Validation Errors

Cart Errors

Order Errors

Line Item & Stock Errors

Payment Errors

Digital Download Errors

Concurrency & Idempotency Errors

Other Errors

Examples

Not Found

404

Validation Error

422

Insufficient Stock

422

Invalid State Transition

422

Handling Errors in the SDK

The @spree/sdk package throws a SpreeError for all non-2xx responses:

Common Patterns

Handle specific error codes:
Display validation errors per field: