Update a Supplier

PATCH /suppliers/:id

Status codes

  • 200 on success
  • 400 on invalid request
  • 404 on supplier not found

Request properties

All optional properties that can overwrite the current value:

  • name: The assigned name.
  • connect: Boolean, used for internal purposes.
  • email: The contact email for the supplier.
  • phone: The contact phone number for the supplier.
  • website: The contact website for the supplier.
  • lang: The preferred language for email communication.
  • min_order_amount: A total amount that is required in the shop when ordering from this supplier.
  • customer_id: The supplier's reference ID for the account.
  • price_group: The price group associated with the account.
  • preferred_delivery_days: Map representing the preferred delivery schedule. The keys are the days indexed from 0 (Sunday) to 6 (Saturday) and the values are objects:
    • enabled: Boolean representing if the day is enabled for delivery.
    • time: Time in "HH:MM" string format, representing preferred delivery time. (optional)

Response properties

The response is the updated Item.

You can see all the Supplier properties on the GET /suppliers/:id page under "Response properties".

Example request and response

Orignial Supplier object:

{
  "id": 1655819191963,
  "name": "Test Supplier",
  "email": "test-supplier@yourbarmate.com",
  "customer_id": "cus_123456"
}

Request:

PATCH /suppliers/1655819191963
{
  "customer_id": "cus_99",
  "price_group": "zurich-ch"
}

Response:

{
  "id": 1655819191963,
  "name": "Test Supplier",
  "email": "test-supplier@yourbarmate.com",
  "customer_id": "cus_99",
  "price_group": "zurich-ch"
}