Supplier Orders

Sends email notification about order creation to the supplier email address.

Parameters
  • idpath integerRequired

    Sends email to a specific id.

  • localequery string

    Current locale of Foodetective app. Locale options: ar, de, en, es, fr, it, ms, pt, ru, zh-CN

GET/api/v1/supplier_orders/{id}/send_created_email

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

  const data = await res.json();
}

RESPONSE


Request Object

The required Request Object.

REQUEST OBJECT

{
  "data": {
    "type": "supplier_orders",
    "attributes": {
      "desired_delivery_date": "",
      "comment": ""
    },
    "relationships": {
      "business": {
        "id": "62a05bd2-2f0e-4bac-8f8b-63947f4df16f",
        "type": "business"
      },
      "supplier": {
        "id": "62a05bd2-2f0e-4bac-8f8b-63947f4df16f",
        "type": "supplier"
      }
    }
  }
}

Create Supplier Order

Create a Supplier Order for current business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new Supplier Order for current business.

    • typestringRequired

      Provide Supplier Order type. Current selection is only supplier_orders.

    • attributesformData, objectRequired

      Attributes object.

      • desired_delivery_datedateRequired

        Date should be formated as a ISO date.

      • commentstring

        Comment around the Supplier Order.

    • relationshipsformData, object

      Relationships object with business object.

      • businessformData, object

        Add a Business relationships link.

        • idstring

          Related Business id.

        • typestring

          Business type; business.

      • supplierformData, object

        Add a Supplier relationships link.

        • idstring

          Related Supplier id.

        • typestring

          Supplier type; supplier.

POST/api/v1/supplier_orders

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

  const data = await res.json();
}

RESPONSE