Skip to main content

Base URLs

Authorization

The public API does not use a browser API key. Private admin and integration credentials belong only in trusted server or CLI environments.

Start an ordering session

The response contains cart and, for a newly created guest cart, cartAccessToken. Save the token in tab-scoped storage. The response ETag contains the cart revision.

Mutate the cart

Use the returned ETag for the next mutation. A stale revision returns 409 CART_CONFLICT; reload current cart state before offering a retry.

Checkout

An order-submission outcome is PROCESSING, CUSTOMER_ACTION_REQUIRED, PAID, ACCEPTED, or ACTION_REQUIRED. Only PAID is online-payment success; ACCEPTED is an audited pay-at-store order.

Customer authentication

Clerk owns customer sign-in, verification, recovery, and token refresh. Customer API requests use a short-lived JWT from the active Clerk session plus X-Crave-Merchant-Slug; the SDK supplies these through getAuthToken and getMerchantSlug. Crave binds that verified subject to a customer inside the selected restaurant organization and exposes no customer login or OTP endpoint.

Error envelope

Common statuses are 400 validation, 401 invalid capability/session, 404 hidden or missing resource, 409 state/revision conflict, 429 rate limit, 503 dependency unavailable, and 500 internal error.

SDK

Prefer the SDK for TypeScript storefronts because it owns capability headers, revisions, idempotency defaults, timeouts, and typed errors.