Cart
6 API calls in this section.
Get Cart
/restaurant/:slug/cartGet the authenticated user's active cart for the specified restaurant slug (location). If no active cart exists for this user and location, a new empty cart is created and returned.
Responses
200: { success: true, data: Cart }
401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart" \2 --header "Authorization: Bearer ${TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.
Add Cart Item
/restaurant/:slug/cart/itemsAdd a product variant to the authenticated user's cart for the given restaurant slug. If the cart does not exist, it is auto-created.
Responses
200: { success: true, data: Cart }
400: { success: false, message }
401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
product_idRequired | string | string (required) |
variant_idRequired | string | string (required) |
quantityRequired | number | number >= 1 (required) |
noteOptional | null | string (optional) |
modifiersOptional | array | Array<{ |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart/items" \2 --header "Authorization: Bearer ${TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "product_id": "{{product_id}}",6 "variant_id": "{{variant_id}}",7 "quantity": 1,8 "note": null,9 "modifiers": []10}'Replace {{placeholders}} with your own values before sending.
Response examples
No saved response example. Use Try it to inspect a staging response.
Update Cart Item
/restaurant/:slug/cart/items/:itemIdUpdate a cart item's quantity and/or note. If quantity is 0, the item is removed.
Responses
200: { success: true, data: Cart }
400: { success: false, message }
401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
itemIdRequired | string | cart item id |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
quantity | number | ?: number >= 0 |
note | null | ?: string |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart/items/${ITEMID}" \2 --header "Authorization: Bearer ${TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "quantity": 2,6 "note": null7}'Response examples
No saved response example. Use Try it to inspect a staging response.
Update Cart Item Modifiers
/restaurant/:slug/cart/items/:itemId/modifiersReplace modifiers for a cart item. This operation is idempotent: it deletes existing modifiers and inserts the provided set.
Responses
200: { success: true, data: Cart }
400: { success: false, message }
401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
itemIdRequired | string | cart item id |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
modifiers | array<object> | Array<{ |
modifiers.modifier_option_id | string | — |
modifiers.quantity | number | — |
modifiers.price_delta_snapshot | number | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart/items/${ITEMID}/modifiers" \2 --header "Authorization: Bearer ${TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "modifiers": [6 {7 "modifier_option_id": "{{modifier_option_id}}",8 "quantity": 1,9 "price_delta_snapshot": 010 }11 ]12}'Replace {{placeholders}} with your own values before sending.
Response examples
No saved response example. Use Try it to inspect a staging response.
Clear Cart
/restaurant/:slug/cartClear all items from the authenticated user's cart for the specified restaurant slug.
Responses
200: { success: true, data: Cart }
401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart" \2 --header "Authorization: Bearer ${TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.
Get Cart Availability
/restaurant/:slug/cart/availabilityCheck real-time availability of items currently in the cart. Returns a list of items with their availability status (based on product active status and schedule).
Responses
200: { success: true, data: [{
cart_item_id,product_id,variant_id,is_available}, ...] }401: { success: false, message: '
login_required' }404: { success: false, message: '
restaurant_not_found' }
Path parameters
| Parameter | Type | Description |
|---|---|---|
slugRequired | string | restaurant location slug |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Bearer {{token}} Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/restaurant/${SLUG}/cart/availability" \2 --header "Authorization: Bearer ${TOKEN}"Response examples
No saved response example. Use Try it to inspect a staging response.