Create Favourite Suppliers

Add given supplier to current busineses favourites

Parameters
  • dataformData, objectRequired

    Form Data needed when adding given supplier to current businesses favourites.

    • typestringRequired

      Provide Favourite Suppliers type. Current selection is only favorite_suppliers.

    • relationshipsformData, objectRequired

      Relationships object with business or supplier objects.

      • businessformData, objectRequired

        Add a relationships link between Favourite Suppliers and related Business.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

      • supplierformData, objectRequired

        Add a Supplier relationships link.

        • idstringRequired

          Related Supplier id.

        • typestringRequired

          Business type; supplier.

POST/api/v1/favorite_suppliers

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "f888c694-55a6-4323-8226-a3c51cc3c7bd",
    "type": "favorite-suppliers",
    "links": {
      "self": "/favorite-suppliers/f888c694-55a6-4323-8226-a3c51cc3c7bd"
    }
  }
}

Delete Favourite Supplier

Delete a Favourite Supplier.

Parameters
  • idpath integerRequired

    Delete a Favourite Supplier by specific id.

DELETE/api/v1/favorite_suppliers/{id}

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