Create Product

Create a must-eat (product) for business or review.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new Product.

    • typestringRequired

      Provide Product type. Current selection is only products.

    • attributesformData, objectRequired

      Attributes object.

      • namestringRequired

        Product name.

      • photofile

        Photo of the product.

    • relationshipsformData, object

      Relationships object with business or review objects.

      • businessformData, object

        Add a Business relationships link.

        • idstring

          Related Business id.

        • typestring

          Business type; business.

      • reviewformData, object

        Add a Review relationships link.

        • idstring

          Related Review id.

        • typestring

          Review type; review.

POST/api/v1/products

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

  const data = await res.json();
}

RESPONSE


Update Product

Update product

Parameters
  • idpath integerRequired

    Update a Product by specific id.

  • dataformData, objectRequired

    Form Data needed when updating a Product.

    • idstringRequired

      Provide Product id.

    • typestringRequired

      Provide Product type. Current selection is only products.

    • attributesformData, object

      Attributes object.

      • namestringRequired

        Product name.

      • photofile

        Photo of the product.

PATCH/api/v1/products/{id}

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

  const data = await res.json();
}

RESPONSE


Delete Product

Delete a Product.

Parameters
  • idpath integerRequired

    Delete a Product by specific id.

DELETE/api/v1/products/{id}

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