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. Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug Responses: - 200: { success: true, data: Cart } - 401: { success: false, message: 'login_required' } - 404: { success: false, message: 'restaurant_not_found' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/restaurant/:slug/cart" \2  --header "Authorization: Bearer {{token}}"

Path parameters

slugRequired
path string

Headers

AuthorizationOptional
header string

Bearer {{token}}

Responses

No response example is available for this endpoint yet.

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. Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug Body (JSON): - product_id: string (required) - variant_id: string (required) - quantity: number >= 1 (required) - note: string (optional) - modifiers: Array<{ modifier_option_id: string; quantity?: number }> (optional) Responses: - 200: { success: true, data: Cart } - 400: { success: false, message } - 401: { success: false, message: 'login_required' } - 404: { success: false, message: 'restaurant_not_found' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/restaurant/:slug/cart/items" \2  --header "Authorization: Bearer {{token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "product_id": "{{product_id}}",7  "variant_id": "{{variant_id}}",8  "quantity": 1,9  "note": null,10  "modifiers": []11}'
Request body
json
1{2  "product_id": "{{product_id}}",3  "variant_id": "{{variant_id}}",4  "quantity": 1,5  "note": null,6  "modifiers": []7}

Path parameters

slugRequired
path string

Request body fields

product_idExample
string

Example field from the request body.

variant_idExample
string

Example field from the request body.

quantityExample
number

Example field from the request body.

noteExample
null

Example field from the request body.

modifiersExample
array

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

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. Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug - itemId: cart item id Body (JSON): - quantity?: number >= 0 - note?: string Responses: - 200: { success: true, data: Cart } - 400: { success: false, message } - 401: { success: false, message: 'login_required' } - 404: { success: false, message: 'restaurant_not_found' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/restaurant/:slug/cart/items/:itemId" \2  --header "Authorization: Bearer {{token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "quantity": 2,7  "note": null8}'
Request body
json
1{2  "quantity": 2,3  "note": null4}

Path parameters

slugRequired
path string
itemIdRequired
path string

Request body fields

quantityExample
number

Example field from the request body.

noteExample
null

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

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. Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug - itemId: cart item id Body (JSON): - modifiers: Array<{ modifier_option_id: string; quantity?: number; price_delta_snapshot?: number }> Responses: - 200: { success: true, data: Cart } - 400: { success: false, message } - 401: { success: false, message: 'login_required' } - 404: { success: false, message: 'restaurant_not_found' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/restaurant/:slug/cart/items/:itemId/modifiers" \2  --header "Authorization: Bearer {{token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "modifiers": [7    {8      "modifier_option_id": "{{modifier_option_id}}",9      "quantity": 1,10      "price_delta_snapshot": 011    }12  ]13}'
Request body
json
1{2  "modifiers": [3    {4      "modifier_option_id": "{{modifier_option_id}}",5      "quantity": 1,6      "price_delta_snapshot": 07    }8  ]9}

Path parameters

slugRequired
path string
itemIdRequired
path string

Request body fields

modifiersExample
array<object>

Example field from the request body.

modifiers.modifier_option_idExample
string

Example field from the request body.

modifiers.quantityExample
number

Example field from the request body.

modifiers.price_delta_snapshotExample
number

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

Clear Cart

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

Clear all items from the authenticated user's cart for the specified restaurant slug. Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug Responses: - 200: { success: true, data: Cart } - 401: { success: false, message: 'login_required' } - 404: { success: false, message: 'restaurant_not_found' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request DELETE "$ONDI_BASE_URL/restaurant/:slug/cart" \2  --header "Authorization: Bearer {{token}}"

Path parameters

slugRequired
path string

Headers

AuthorizationOptional
header string

Bearer {{token}}

Responses

No response example is available for this endpoint yet.

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). Auth: - Header: Authorization: Bearer {{token}} Path Parameters: - slug: restaurant location slug 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' }

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/restaurant/:slug/cart/availability" \2  --header "Authorization: Bearer {{token}}"

Path parameters

slugRequired
path string

Headers

AuthorizationOptional
header string

Bearer {{token}}

Responses

No response example is available for this endpoint yet.