The Storefront API exposes every operation your customers need to browse menus, build carts, and pay for orders. All endpoints return JSON over HTTPS and authenticate with a location-scoped API key.Documentation Index
Fetch the complete documentation index at: https://docs.cravejs.com/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
There is no sandbox server. Storefront applications connect directly to the production API using your API key.
Authentication
Include your API key in theX-API-Key header on every request:
Location-scoped endpoints
Every storefront endpoint lives under/locations/{locationId}:
64a7b8c9d1e2f3a4b5c6d7e8) or its slug (downtown-pizza) as {locationId}. Both formats work interchangeably.
Resource groups
The API is organized into these groups:| Group | Operations |
|---|---|
| Merchant | Look up a merchant and its locations by slug |
| Locations | Get location info, order times, gratuity config, distance |
| Ordering Sessions | Create or resume a cart |
| Cart | Get, update, add items, set fulfillment, schedule order, manage gratuity |
| Discounts | Apply or remove promo codes |
| Payments | Create a Stripe PaymentIntent |
| Analytics | Track storefront events (page views, checkout, order placed) |
| Ratings | Submit post-order experience ratings |
Request format
Send JSON bodies withContent-Type: application/json:
Response format
Successful responses return the resource directly:HTTP status codes
| Code | Meaning |
|---|---|
200 | Request succeeded |
201 | Resource created |
204 | Success, no content returned |
400 | Invalid request data |
401 | Missing or invalid API key |
403 | Insufficient permissions or inactive subscription |
404 | Resource not found |
409 | Conflict with current state (e.g., discount already applied) |
422 | Valid request, but cannot be processed (e.g., location closed) |
429 | Rate limit exceeded |
500 | Internal server error |
Rate limiting
The API allows 200 requests per 10 minutes per IP address. Rate limit state is returned in response headers:| Header | Description |
|---|---|
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
429 with a Retry-After header. Implement exponential backoff for retries.
Data types
| Type | Format | Example |
|---|---|---|
| ID | String | "64a7b8c9d1e2f3a4b5c6d7e8" |
| Slug | URL-safe string | "downtown-pizza" |
| Price | Decimal string | "12.99" |
| Currency | ISO 4217 lowercase | "usd", "gbp", "aed" |
| Date | YYYY-MM-DD | "2025-03-15" |
| Time | 24-hour HH:mm | "18:30" |
| Timestamp | ISO 8601 | "2025-03-15T18:30:00Z" |
Typical integration flow
The following example shows the standard ordering flow from session to payment:Storefront scope
The Storefront API covers customer-facing operations only. Menu management, order fulfillment, analytics, and merchant settings are handled through the Admin API (coming soon) and the Crave Dashboard.| Available | Not available |
|---|---|
| Menu browsing | Menu editing |
| Cart management | Order management |
| Payment processing | Customer accounts |
| Discount application | Real-time order tracking |
| Analytics events | Merchant settings |
Next steps
Core Concepts
Understand the data model behind locations, menus, carts, and orders.
Quickstarts
Build a working storefront in minutes with Next.js, React, or vanilla JS.
Storefront SDK
Use the typed TypeScript client instead of raw HTTP.
Error Codes
Handle every error the API can return.