Skip to main content

Categories

5 API calls in this section.

Create Category

Restaurant Menu / Categories
POST/restaurant/locations/:locationId/categories
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/restaurant/locations/:locationId/categories" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --data '{5  "parent_id": null,6  "name": {7    "en": "Burgers"8  },9  "description": {},10  "is_active": true,11  "sort_order": 0,12  "category_image": "https://example.com/cat.jpg"13}'
Request body
json
1{2  "parent_id": null,3  "name": {4    "en": "Burgers"5  },6  "description": {},7  "is_active": true,8  "sort_order": 0,9  "category_image": "https://example.com/cat.jpg"10}

Path parameters

locationIdRequired
path string

Request body fields

parent_idExample
null

Example field from the request body.

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

is_activeExample
boolean

Example field from the request body.

sort_orderExample
number

Example field from the request body.

category_imageExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Update Category

Restaurant Menu / Categories
PUT/restaurant/categories/:id
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/restaurant/categories/:id" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --data '{5  "parent_id": null,6  "name": {7    "en": "Burgers & Sandwiches"8  },9  "description": {},10  "is_active": true,11  "sort_order": 10,12  "category_image": "https://example.com/cat-new.jpg"13}'
Request body
json
1{2  "parent_id": null,3  "name": {4    "en": "Burgers & Sandwiches"5  },6  "description": {},7  "is_active": true,8  "sort_order": 10,9  "category_image": "https://example.com/cat-new.jpg"10}

Path parameters

idRequired
path string

Request body fields

parent_idExample
null

Example field from the request body.

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

is_activeExample
boolean

Example field from the request body.

sort_orderExample
number

Example field from the request body.

category_imageExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

List Categories (with filters)

Restaurant Menu / Categories
GET/restaurant/locations/:locationId/categories?root_category=true&parent_id={{parent_id}}&is_active={{is_active}}&search={{search}}&includeAvailableCounts=true&page=1&limit=10
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/restaurant/locations/:locationId/categories?root_category=true&parent_id={{parent_id}}&is_active={{is_active}}&search={{search}}&includeAvailableCounts=true&page=1&limit=10" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

locationIdRequired
path string

Query parameters

root_categoryOptional
query string

true

Set 'true' to fetch only root categories (ignores parent_id if true).

parent_idOptional
query string

{{parent_id}}

Use 'null' (string) to filter root categories (ignored if root_category=true)

is_activeOptional
query string

{{is_active}}

searchOptional
query string

{{search}}

includeAvailableCountsOptional
query string

true

Include count of currently available products per category (uses availability view)

pageOptional
query string

1

limitOptional
query string

10

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Get Category (with count)

Restaurant Menu / Categories
GET/restaurant/categories/:id?active_only=true
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/restaurant/categories/:id?active_only=true" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

Query parameters

active_onlyOptional
query string

true

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Delete Category

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

Path parameters

idRequired
path string

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.