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 Storefront API request requires a Crave API key passed in the X-API-Key header. Requests still target a concrete locationId in the URL, and the key must be allowed to access that location.
Generate an API key from Crave Dashboard > Developers > API Development > Step 1 - API Keys. Copy the full token when it is shown, then copy the target locationId from Step 2 - Location IDs on the same page.
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.

Email Support

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