Skip to main content

Cart

6 API calls in this section.

Get Cart​

Restaurant Menu / Cart
GET/restaurant/:slug/cart

Get 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Staging
Request
curl
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 Menu / Cart
POST/restaurant/:slug/cart/items

Add 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
product_idRequiredstring

string (required)

variant_idRequiredstring

string (required)

quantityRequirednumber

number >= 1 (required)

noteOptionalnull

string (optional)

modifiersOptionalarray

Array<{ modifier_option_id: string; quantity?: number }> (optional)

Staging
Request
curl
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 Menu / Cart
PUT/restaurant/:slug/cart/items/:itemId

Update 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

itemIdRequiredstring

cart item id

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
quantitynumber

?: number >= 0

notenull

?: string

Staging
Request
curl
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 Menu / Cart
PUT/restaurant/:slug/cart/items/:itemId/modifiers

Replace 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

itemIdRequiredstring

cart item id

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
modifiersarray<object>

Array<{ modifier_option_id: string; quantity?: number; price_delta_snapshot?: number }>

modifiers.modifier_option_idstring—
modifiers.quantitynumber—
modifiers.price_delta_snapshotnumber—
Staging
Request
curl
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 Menu / Cart
DELETE/restaurant/:slug/cart

Clear 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Staging
Request
curl
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 Menu / Cart
GET/restaurant/:slug/cart/availability

Check 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

ParameterTypeDescription
slugRequiredstring

restaurant location slug

Headers

ParameterTypeDescription
Authorizationstring

Bearer {{token}}

Example: Bearer {{token}}

Staging
Request
curl
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.