Introduction to the Crave Storefront API
Note: There is no local development server for the Crave API. All storefront applications connect directly to the production API using your API key.
X-RateLimit-Remaining
: Requests remaining in current windowX-RateLimit-Reset
: When the rate limit resets (Unix timestamp)"64a7b8c9d1e2f3a4b5c6d7e8"
)"downtown-pizza"
)1299
for $12.99)"2024-01-15T14:30:00Z"
)"14:30"
)64a7b8c9d1e2f3a4b5c6d7e8
downtown-pizza
Important: Always use the production API URL (https://api.cravejs.com
) in your environment variables.
/locations/{locationId}/carts
- Create a new cart/locations/{locationId}/carts/{cartId}
- Get cart details/locations/{locationId}/carts/{cartId}
- Delete a cart/locations/{locationId}/carts/{cartId}/validate-and-update
- Validate and update order/locations/{locationId}/carts/{cartId}/gratuity
- Update gratuity/locations/{locationId}/carts/{cartId}/cart-item
- Add item to cart/locations/{locationId}/carts/{cartId}/cart-item/{itemId}/quantity
- Update cart item quantity/login-customer
- Login or register customer/verify-otp
- Verify OTP/customer
- Get customer details/customer/logout
- Logout customer/customer/saved-payments
- Get customer saved payments/customer/saved-payments/{paymentId}
- Delete saved payment method/orders
- Get customer orders (placeholder implementation)/addresses
- Get customer addresses (placeholder implementation)Note: Customer authentication and data endpoints are implemented but may require additional configuration for production deployment. The/orders
and/addresses
endpoints currently return placeholder responses while full functionality is under development.
/locations/{locationSlugOrId}
- Get location basic info/locations/{locationId}/menus
- Get location menus/locations/{locationId}/time-intervals
- Get order time intervals/locations/{locationId}/gratuity
- Get gratuity configuration/locations/{locationId}/redirect
- Redirect to storefront URL/locations/{locationId}/products
- Get products by location/locations/{locationId}/products/popular
- Get popular products/locations/{locationId}/products/{productId}
- Get product details/locations/{locationId}/discounts/apply-discount
- Apply discount code/locations/{locationId}/discounts/apply-discount
- Remove discount code/stripe/payment-intent
- Generate Stripe payment intent (requires locationId and cartId parameters)