Ir al contenido principal

Categorías

Listar, crear, renombrar, ordenar y borrar las categorías del menú, y ordenar sus productos.

Cada operación trae su curl y su respuesta de ejemplo; las claves y los ids de los ejemplos son ficticios. Los campos marcados con * son obligatorios.

List the categories

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

Parámetros

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

Ejemplo

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

Respuesta 200

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

Campos de la respuesta

CampoTipoDescripción
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

Errores

  • 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}/categoriesrequiere 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.

Parámetros

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

Cuerpo (JSON)

CampoTipoDescripción
name*stringCategory namehasta 50 caracteres
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 languagehasta 50 caracteres
enobject
namestringThe name in that languagehasta 50 caracteres
ptobject
namestringThe name in that languagehasta 50 caracteres
frobject
namestringThe name in that languagehasta 50 caracteres
deobject
namestringThe name in that languagehasta 50 caracteres
itobject
namestringThe name in that languagehasta 50 caracteres

Ejemplo

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"}}}'

Respuesta 201

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

Campos de la respuesta

CampoTipoDescripción
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

Errores

  • 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-orderrequiere menu:writereorderCategories

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

Parámetros

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

Cuerpo (JSON)

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

Ejemplo

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"]}'

Respuesta 200

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

Campos de la respuesta

CampoTipoDescripción
order_categories*string[]

Errores

  • 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}requiere 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.

Parámetros

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

Cuerpo (JSON)

CampoTipoDescripción
namestringCategory namehasta 50 caracteres
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 languagehasta 50 caracteres
enobject
namestringThe name in that languagehasta 50 caracteres
ptobject
namestringThe name in that languagehasta 50 caracteres
frobject
namestringThe name in that languagehasta 50 caracteres
deobject
namestringThe name in that languagehasta 50 caracteres
itobject
namestringThe name in that languagehasta 50 caracteres

Ejemplo

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"}'

Respuesta 200

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

Campos de la respuesta

CampoTipoDescripción
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

Errores

  • 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}requiere menu:writedeleteCategory

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

Parámetros

NombreDóndeDescripción
ref*rutaThe restaurant identifier (the slug in its public URL, e.g. "pizzeria-roma") or its id, as returned by GET /restaurants
id*rutaThe 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.

Ejemplo

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

Respuesta 200

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

Campos de la respuesta

CampoTipoDescripción
deleted*string
deleted_products*integermin -9007199254740991 · max 9007199254740991

Errores

  • 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-orderrequiere menu:writereorderProducts

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

Parámetros

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

Cuerpo (JSON)

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

Ejemplo

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"]}'

Respuesta 200

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

Campos de la respuesta

CampoTipoDescripción
category_id*string
order_products*string[]

Errores

  • 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

Desarrolladores