Request Object

The required Request Object.

REQUEST OBJECT

{
  "data": {
    "type": "supplier_elements",
    "attributes": {
      "quantity": ""
    },
    "relationships": {
      "supplier_order": {
        "id": "62a05bd2-2f0e-4bac-8f8b-63947f4df16f",
        "type": "supplier_order"
      },
      "supplier_product": {
        "id": "62a05bd2-2f0e-4bac-8f8b-63947f4df16f",
        "type": "supplier_product"
      }
    }
  }
}

Create Supplier Element

Create a supplier element of a supplier order.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new supplier element of a supplier order.

    • typestringRequired

      Provide Supplier Element type. Current selection is only supplier_elements.

    • attributesformData, objectRequired

      Attributes object.

      • quantityintegerRequired

        Amount of given supplier product.

    • relationshipsformData, objectRequired

      Relationships object with Supplier Order and Supplier Product objects.

      • supplier_orderformData, objectRequired

        Add a Supplier Order relationships link.

        • idstringRequired

          Related Supplier Order id.

        • typestringRequired

          Supplier Order type; supplier_order.

      • supplier_productformData, objectRequired

        Add a Supplier Product relationships link.

        • idstringRequired

          Related Supplier Product id.

        • typestringRequired

          Supplier Product type; supplier_product.

POST/api/v1/supplier_elements

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

  const data = await res.json();
}

RESPONSE