Skip to main content

Categories

List, create, rename, reorder and delete the menu's categories, and reorder their products.

Every operation comes with its curl and an example response; the keys and ids in the examples are made up. Fields marked with * are required.

List the categories

get/restaurants/{ref}/categoriesrequires menu:readlistCategories

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants

Example

curl -X GET "https://delimenu.co/api/v1/restaurants/pizzeria-roma/categories" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response 200

{
  "categories": [
    {
      "id": "k3Qm8vXb2LpN7wRt1YaZ",
      "name": "Pizzas",
      "position": 1
    },
    {
      "id": "c7Wd2Bn5Kq9Xr4Ms8Lt1",
      "name": "Bebidas",
      "position": 2
    }
  ]
}

Response fields

FieldTypeDescription
categories*object[]
id*string
name*string
translationsobjectThe name in other languages, keyed by language code, e.g. { "en": { "name": "Large" } }. Absent when nothing is translated; a language missing here falls back to `name`.
esobject
namestring
enobject
namestring
ptobject
namestring
frobject
namestring
deobject
namestring
itobject
namestring
position*integermin -9007199254740991 · max 9007199254740991

Errors

  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 500 INTERNAL — something failed on our side; retry in a moment

Create a category

post/restaurants/{ref}/categoriesrequires menu:writecreateCategory

Adds a category at the end of the menu. name is in the menu's primary language; translations carries it in the others.

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants

Body (JSON)

FieldTypeDescription
name*stringCategory nameup to 50 characters
translationsobjectThe category name in the menu's other languages, e.g. { "en": { "name": "Drinks" } }. Keyed by language code (es, en, pt, fr, de, it). Shown to diners who read the menu in that language; a language without a translation falls back to the original text, and an entry in the menu's primary language is ignored. Replaces the whole map when provided; {} removes every translation.
esobject
namestringThe name in that languageup to 50 characters
enobject
namestringThe name in that languageup to 50 characters
ptobject
namestringThe name in that languageup to 50 characters
frobject
namestringThe name in that languageup to 50 characters
deobject
namestringThe name in that languageup to 50 characters
itobject
namestringThe name in that languageup to 50 characters

Example

curl -X POST "https://delimenu.co/api/v1/restaurants/pizzeria-roma/categories" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Postres","translations":{"en":{"name":"Desserts"}}}'

Response 201

{
  "category": {
    "id": "d4Fg6Hj8Kl0Zx2Cv4Bn6",
    "name": "Postres",
    "translations": {
      "en": {
        "name": "Desserts"
      }
    }
  }
}

Response fields

FieldTypeDescription
category*object
id*string
name*string
translationsobjectThe name in other languages, keyed by language code, e.g. { "en": { "name": "Large" } }. Absent when nothing is translated; a language missing here falls back to `name`.
esobject
namestring
enobject
namestring
ptobject
namestring
frobject
namestring
deobject
namestring
itobject
namestring

Errors

  • 400 VALIDATION — a field is missing or malformed; `issues` names it
  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 409 CONFLICT — a category with that name already exists
  • 500 INTERNAL — something failed on our side; retry in a moment

Reorder the categories

put/restaurants/{ref}/category-orderrequires menu:writereorderCategories

Sets the display order. Pass every category id exactly once, in the new order.

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants

Body (JSON)

FieldTypeDescription
category_ids*string[]Every category id exactly once, in the new display order

Example

curl -X PUT "https://delimenu.co/api/v1/restaurants/pizzeria-roma/category-order" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"category_ids":["c7Wd2Bn5Kq9Xr4Ms8Lt1","k3Qm8vXb2LpN7wRt1YaZ"]}'

Response 200

{
  "order_categories": [
    "c7Wd2Bn5Kq9Xr4Ms8Lt1",
    "k3Qm8vXb2LpN7wRt1YaZ"
  ]
}

Response fields

FieldTypeDescription
order_categories*string[]

Errors

  • 400 VALIDATION — a field is missing or malformed; `issues` names it
  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 500 INTERNAL — something failed on our side; retry in a moment

Rename or translate a category

patch/restaurants/{ref}/categories/{id}requires menu:writeupdateCategory

Pass name, translations or both; what is not passed is left as it is. translations replaces the whole map, and {} removes every translation.

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants
id*pathThe category id, from GET /restaurants/{ref}/categories

Body (JSON)

FieldTypeDescription
namestringCategory nameup to 50 characters
translationsobjectThe category name in the menu's other languages, e.g. { "en": { "name": "Drinks" } }. Keyed by language code (es, en, pt, fr, de, it). Shown to diners who read the menu in that language; a language without a translation falls back to the original text, and an entry in the menu's primary language is ignored. Replaces the whole map when provided; {} removes every translation.
esobject
namestringThe name in that languageup to 50 characters
enobject
namestringThe name in that languageup to 50 characters
ptobject
namestringThe name in that languageup to 50 characters
frobject
namestringThe name in that languageup to 50 characters
deobject
namestringThe name in that languageup to 50 characters
itobject
namestringThe name in that languageup to 50 characters

Example

curl -X PATCH "https://delimenu.co/api/v1/restaurants/pizzeria-roma/categories/k3Qm8vXb2LpN7wRt1YaZ" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Pizzas artesanales"}'

Response 200

{
  "category": {
    "id": "k3Qm8vXb2LpN7wRt1YaZ",
    "name": "Pizzas artesanales"
  }
}

Response fields

FieldTypeDescription
category*object
id*string
name*string
translationsobjectThe name in other languages, keyed by language code, e.g. { "en": { "name": "Large" } }. Absent when nothing is translated; a language missing here falls back to `name`.
esobject
namestring
enobject
namestring
ptobject
namestring
frobject
namestring
deobject
namestring
itobject
namestring

Errors

  • 400 VALIDATION — a field is missing or malformed; `issues` names it
  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 500 INTERNAL — something failed on our side; retry in a moment

Delete a category

delete/restaurants/{ref}/categories/{id}requires menu:writedeleteCategory

Refused with 409 while the category still has products, unless delete_products is true, in which case the products are deleted too.

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants
id*pathThe category id, from GET /restaurants/{ref}/categories
delete_productsqueryDelete the products in the category too. Without it a non-empty category is refused with 409.

Example

curl -X DELETE "https://delimenu.co/api/v1/restaurants/pizzeria-roma/categories/k3Qm8vXb2LpN7wRt1YaZ?delete_products=true" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response 200

{
  "deleted": "k3Qm8vXb2LpN7wRt1YaZ",
  "deleted_products": 3
}

Response fields

FieldTypeDescription
deleted*string
deleted_products*integermin -9007199254740991 · max 9007199254740991

Errors

  • 400 VALIDATION — a field is missing or malformed; `issues` names it
  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 409 CONFLICT — the category still has products
  • 500 INTERNAL — something failed on our side; retry in a moment

Reorder the products of a category

put/restaurants/{ref}/categories/{id}/product-orderrequires menu:writereorderProducts

Pass every product id of that category exactly once, in the new order.

Parameters

NameInDescription
ref*pathThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants
id*pathThe category id, from GET /restaurants/{ref}/categories

Body (JSON)

FieldTypeDescription
product_ids*string[]Every product id of the category exactly once, in the new display order

Example

curl -X PUT "https://delimenu.co/api/v1/restaurants/pizzeria-roma/categories/k3Qm8vXb2LpN7wRt1YaZ/product-order" \
  -H "Authorization: Bearer dmk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"product_ids":["q2Jk5Lm8Np1Qr4St7Uv0","p9Hs4TqL2mNc8VbX6Rdy"]}'

Response 200

{
  "category_id": "k3Qm8vXb2LpN7wRt1YaZ",
  "order_products": [
    "q2Jk5Lm8Np1Qr4St7Uv0",
    "p9Hs4TqL2mNc8VbX6Rdy"
  ]
}

Response fields

FieldTypeDescription
category_id*string
order_products*string[]

Errors

  • 400 VALIDATION — a field is missing or malformed; `issues` names it
  • 401 UNAUTHORIZED — the key is missing, unknown or revoked
  • 402 NOT_PREMIUM — the restaurant has no active subscription or trial
  • 403 FORBIDDEN — the key lacks the scope this endpoint needs
  • 404 NOT_FOUND — no such restaurant in this account, or no such item in it
  • 500 INTERNAL — something failed on our side; retry in a moment

Developers