Dishes

Return a Dish.

Parameters
  • idpath integerRequired

    Return a Delivery by specific delivery id.

  • includequery string

    Include associations (delimited with comma). Available associations: pictures, dish_option_categories, business, category

    Example: category,pictures

GET/api/v1/dishes/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/dishes/${id}`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "4d422056-cfda-4887-9261-808448eedead",
    "type": "dishes",
    "links": {
      "self": "/dishes/4d422056-cfda-4887-9261-808448eedead"
    },
    "attributes": {
      "currency": "GBP",
      "description": "This is a test dish description. This dish is so delicious you have to try it!",
      "name": "Test Dish",
      "on-uber-eats": false,
      "price-per-item-cents": 3000,
      "sku-ref": "dsh_1",
      "unavailable": false
    },
    "relationships": {
      "pictures": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/pictures",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/pictures"
        }
      },
      "dish-option-categories": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/dish-option-categories",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/dish-option-categories"
        }
      },
      "business": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/business",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/business"
        }
      },
      "category": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/category",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/category"
        }
      }
    }
  }
}

Create Dish

Create a dish of a business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new Dish.

    • typestringRequired

      Provide Dish type. Current selection is only dishes.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • namestringRequired

      • price_per_item_centsintegerRequired

        Price in cents (currency taken from the business)

      • sku_refstring

      • descriptionstring

      • unavailableundefined

      • on_uber_eatsundefined

    • relationshipsformData, objectRequired

      Relationships object with business or category objects.

      • businessformData, object

        Add a relationships link between dish and related Business.

        • idstringRequired

          Related Business id.

        • typestring

          Type business.

      • categoryformData, object

        Add a relationships link between dish and related Category.

        • idstringRequired

          Related Category id.

        • typestring

          Type category.

POST/api/v1/dishes

{
  const res = await fetch(`${BASE_URL}/api/v1/dishes`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "4d422056-cfda-4887-9261-808448eedead",
    "type": "dishes",
    "links": {
      "self": "/dishes/4d422056-cfda-4887-9261-808448eedead"
    },
    "attributes": {
      "currency": "GBP",
      "description": null,
      "name": "Test Dish",
      "on-uber-eats": false,
      "price-per-item-cents": 3000,
      "sku-ref": "dsh_1",
      "unavailable": false
    },
    "relationships": {
      "pictures": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/pictures",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/pictures"
        }
      },
      "dish-option-categories": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/dish-option-categories",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/dish-option-categories"
        }
      },
      "business": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/business",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/business"
        }
      },
      "category": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/category",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/category"
        }
      }
    }
  }
}

Create Dish Upload

Upload a CSV file with dishes

Parameters
  • dataformData, objectRequired

    Form Data needed for upload a CSV file with dishes.

    • typestringRequired

      Provide Dish type. Current selection is only dishes.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • filefileRequired

        Upload a CSV file.

      • modestringRequired

        You can either add or replace to the dishes.

      • localestring

    • relationshipsformData, objectRequired

      Relationships object with business or category objects.

      • businessformData, object

        Add a relationships link between dish and related Business.

        • idstring

          Related Business id.

        • typestring

          Type business.

POST/api/v1/dishes/upload

  {
    const res = await fetch(`${BASE_URL}/api/v1/dishes/upload`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)});

    const data = await res.json();
  }

RESPONSE


Update Dish

Update a Dish

Parameters
  • idpath integerRequired

    Update a Dish by specific Dish id.

  • includequery stringRequired

    Include associations (delimited with comma). Available associations: pictures, dish_option_categories, business, category.

    Example: business,category

  • dataformData, objectRequired

    Form Data needed when updating a Dish.

    • idstringRequired

      Provide Dish id.

    • typestringRequired

      Provide Dish type. Current selection is only dishes.

    • attributesformData, object

      Attributes object with a few required fields.

      • descriptionstring

      • namestring

      • sku_refstring

      • price_per_item_centsinteger

        Price in cents (currency taken from the business)

      • unavailableundefined

      • on_uber_eatsundefined

    • relationshipsformData, object

      Relationships object with business or category objects.

      • businessformData, object

        Add a relationships link between dish and related Business.

        • idstring

          Related Business id.

        • typestring

          Type business.

      • categoryformData, object

        Add a relationships link between dish and related Category.

        • idstring

          Related Category id.

        • typestring

          Type category.

PATCH/api/v1/dishes/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/dishes/${id}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "4d422056-cfda-4887-9261-808448eedead",
    "type": "dishes",
    "links": {
      "self": "/dishes/4d422056-cfda-4887-9261-808448eedead"
    },
    "attributes": {
      "currency": "GBP",
      "description": "This is a test dish description. This dish is so delicious you have to try it!",
      "name": "Test Dish",
      "on-uber-eats": false,
      "price-per-item-cents": 3000,
      "sku-ref": "dsh_1",
      "unavailable": false
    },
    "relationships": {
      "pictures": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/pictures",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/pictures"
        }
      },
      "dish-option-categories": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/dish-option-categories",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/dish-option-categories"
        }
      },
      "business": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/business",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/business"
        }
      },
      "category": {
        "links": {
          "self": "/dishes/4d422056-cfda-4887-9261-808448eedead/relationships/category",
          "related": "/dishes/4d422056-cfda-4887-9261-808448eedead/category"
        }
      }
    }
  }
}

Delete Dish

Delete a Dish.

Parameters
  • idpath integerRequired

    Delete a Dish by specific Dish id.

DELETE/api/v1/dishes/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/dishes/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}