Create a Supplier

POST /suppliers

Create a Supplier you manage yourself. The request needs a name and an email address; separate multiple addresses with commas. To connect with a Supplier using YBM Connect, request a connection instead.

Request properties

  • name: Supplier name. (required)
  • email: Supplier contact email address. (required)
  • phone: Contact phone number. (optional)
  • website: Contact website. (optional)
  • lang: Preferred language for email communication. (optional)
  • customer_id: Your customer number at this Supplier. (optional)
  • min_order_amount: Minimum order value in cents. (optional)
  • last_delivery: Timestamp of the last delivery in milliseconds since the Unix epoch. (optional)
  • preferred_delivery_days: Map keyed by weekday from 0 (Sunday) to 6 (Saturday). Each value has an enabled boolean and may have a time in HH:MM format. (optional)

connect and connect_account are set by YourBarMate and cannot be supplied in this request. Although the schema accepts last_delivery, set it only when importing an existing delivery history: it prevents later deletion through DELETE /suppliers/:id.

Status codes

  • 200 on success
  • 400 on invalid request data

Response properties

The created Supplier object, including its numeric id.

Example request

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

Example response

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