Overview
Crave provides a comprehensive backend API for building custom food ordering applications. This documentation is for developers who want to integrate directly with Crave’s API to create custom storefronts, mobile apps, or other ordering experiences.API Architecture
Crave’s API follows REST principles with JSON request/response format. The API is designed around these core concepts:Core Entities
- Locations - Restaurant locations with menus, hours, and settings
- Products - Menu items with pricing, descriptions, and modifiers
- Carts - Customer shopping carts with items and calculations
- Orders - Completed orders with payment and fulfillment information
- Customers - Customer profiles and order history
API Endpoints
GET /locations/{locationId}
- Location detailsGET /locations/{locationId}/menus
- Menu and productsPOST /locations/{locationId}/carts
- Cart managementPOST /stripe/payment-intent
- Payment processing
- Order management (Enterprise + beta access)
- Menu management (Enterprise + beta access)
- Analytics and reporting (Enterprise + beta access)
Authentication
API Key Authentication
Most storefront operations use API key authentication:Session Token Authentication
Administrative operations require session tokens and are available only to Enterprise tier customers with beta access approval. Contact hello@craveup.com for more information.Rate Limiting
- Limit: 200 requests per 10 minutes per IP address
- Headers:
X-RateLimit-Remaining
,X-RateLimit-Reset
- Exceeded: 429 status code with retry information
Data Flow
Typical Storefront Flow
- Load Location - Get location details and configuration
- Load Menu - Fetch products and categories
- Manage Cart - Add/update items, apply discounts
- Process Payment - Create payment intent, handle checkout
- Order Created - Order automatically created on successful payment
Example: Loading a Menu
Error Handling
HTTP Status Codes
200
- Success400
- Bad Request (validation errors)401
- Unauthorized (invalid API key)403
- Forbidden (subscription required)404
- Not Found429
- Too Many Requests (rate limited)500
- Internal Server Error
Error Response Format
Payment Processing
Crave integrates with Stripe for payment processing:- Create Payment Intent - Call Crave API to create Stripe PaymentIntent
- Client-side Checkout - Use Stripe.js to handle payment UI
- Payment Confirmation - Stripe processes payment securely
- Order Creation - Crave automatically creates order on success
Webhooks
Webhook notifications are available for Enterprise tier customers for events like:- Order status changes
- Payment confirmations
- Cart abandonments
Environment Requirements
Development
- Node.js 18+ (for JavaScript/TypeScript)
- Valid API key from merchant
- HTTPS for payment processing
Production
- SSL certificate required
- Environment variables for API keys
- Error monitoring recommended
Next Steps
- Authentication Setup - Configure API keys
- Quick Start Guide - Build your first storefront
- API Reference - Detailed endpoint documentation
- Stripe Integration - Payment processing setup
Getting API Access
Subscription Requirements
All Crave API access requires a paid subscription:API Type | Subscription Required | Features Included |
---|---|---|
Storefront APIs | Any paid Crave subscription | Menu browsing, cart management, payment processing, basic customer data |
Admin APIs | Enterprise tier only | Order management, menu editing, analytics, webhooks |
Free trial | Contact support | Evaluation access for development and testing |
Note: Some features like customer order history and address management are currently in development and may require additional configuration.
Getting Started
To get started with storefront development:- Purchase a Crave subscription or request trial access
- Get API keys from dashboard.craveup.com/developers or your merchant partner
- Set up your development environment with the provided credentials
- Follow the Quick Start Guide to build your first storefront
- Refer to the API Reference for detailed endpoint documentation