Skip to main content
Build a lightweight ordering page using the Crave REST API directly. This quickstart uses plain JavaScript with fetch — no build tools, no framework, no SDK dependency.

Prerequisites

  • A Crave API key from the Dashboard
  • At least one live location in your merchant account
  • A browser or any environment with fetch (Node.js 18+, Deno, Bun)

1. API basics

Every request to the Storefront API requires a location-scoped API key passed in the X-API-Key header.
Generate an API key from the Crave Dashboard under Settings → API Keys. Each key is scoped to a single location.
Keep API keys secret. Never commit them to source control or expose them in client-side code that cannot be trusted. For browser apps, use a server-side proxy or restrict the key to read-only storefront operations.
Base URL: https://api.craveup.com/api/v1 All storefront endpoints are scoped under /locations/{locationId}.

2. Create an API helper

3. Fetch the merchant

4. Start an ordering session

5. Add items to the cart

6. Get the cart

7. Update customer details

8. Full HTML example

Next steps

REST API Reference

See all available REST endpoints.

Display Menu

Fetch menus, categories, and products.

Checkout Flow

Collect customer details and process payments.

Error Codes

Handle API errors gracefully.

Slack Community

Ask questions and get help from the Crave team and community.

Discord

Join our Discord server for real-time discussions.

Email Support

Reach out to hello@craveup.com for direct support.