Update a Supplier

PATCH /suppliers/:id

Update details stored in your YourBarMate account. For a YBM Connect Supplier, this does not edit the Supplier's products or YBM Connect account. connect and connect_account cannot be changed here.

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.
  • email: Contact email address; separate multiple addresses with commas.
  • 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: Minimum order value in cents. Send 0 to remove it.
  • customer_id: Your customer number at this Supplier. Send an empty string to remove it.
  • last_delivery: Timestamp of the last delivery in milliseconds since the Unix epoch.
  • 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)

Omitted fields remain unchanged. Do not use null to clear fields; the supported removal values are 0 for min_order_amount and "" for customer_id. Setting last_delivery prevents later deletion through DELETE /suppliers/:id.

Response properties

The response is the updated Supplier.

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

Example request and response

Original Supplier object:

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

Request:

PATCH /suppliers/1655819191963
{
  "customer_id": "cus_99"
}

Response:

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