Connect API Documentation

https://connect.yourbarmate.com/api
Changelog

Update an existing product

PATCH /products/:id

Parameters

  • id: The identifier as specified when the product was created

Request properties

Any combination of these properties can be updated.

  • status: One of "ACTIVE", "INACTIVE" or "OUT_OF_STOCK"
  • category: The ID of the product category
  • name: The product name. Will be trimmed and must be at least 3 characters and not longer than 64 characters. May not contain newlines or tabs.
  • order_by: Whether to order by "vessel" or "kg". If set to "kg", vessel must be omitted or set to { size: 1, unit: "kg" }.
  • vessel: The vessel object:
    • id: An custom vessel identifier, not visible to customers (optional)
    • size: Size of the vessel in the specified unit
    • unit: One of "l", "dl", "cl", "ml", "kg", "g" or "quantity"
    • type: See vessel and bundle types (optional)
  • bundles: The bundle object array:
    • id: A custom bundle identifier, not visible to customers (optional)
    • id_override: A custom product ID override (optional)
    • type: See vessel and bundle types
    • size: The number of vessels in the bundle, or the number of bundles on the pallet if type is "PX"
    • unit: Set to kg, if the bundle is by weight (optional)
    • pallet_bundle: Only if type is "PX". Specifies the bundle on the pallet. The bundle must also exist in the bundles array.
  • price: The vessel price in cents
  • price_per: One of "vessel", "l", "kg" or "100g"
  • min_order_count: The minimum number of vessels or kilos that can be ordered, depending on order_by (optional)
  • delivery_days: An object with one required (lead_days) and one optional (cutoff) parameter, indexed by the day of the week as a number between 0 (Sunday) and 6 (Saturday)
  • delivery_date_overrides: An object with one required (lead_days) and one optional (cutoff) parameter, indexed by the ISO date it refers to (e.g. "2023-12-26")
  • dates_with_no_delivery: A list of dates in ISO date format. It contains all the dates when the supplier will not deliver this item.
  • pricing: Optional scaled pricing setup
    • strategy: The pricing strategy, one of "VOLUME", "INCREMENTAL", or "DIVISIBLE"
    • price_points: The prices used in the pricing based on the quantity of items.
      • from: The number of items the price point is applied from
      • price: The price for one item
    • date_overrides: An array of date periods where the price points are different from the default ones (optional). Each item of the array can have the following properties:
      • from_date: The start of the validity for the date override. Can be open ended if no to_date is given.
      • to_date: The last day of the date range (optional). It is inclusive, the override is still valid on this date.
      • price_points: The price points to be used for this date range or from this start date.

Status codes

  • 200 on success
  • 400 if the request is invalid
  • 404 if no product with the given id was found

Response properties

The full updated product as returned by GET /products/:id.

Example request to update the status

{
"status": "OUT_OF_STOCK"
}

Example request to update name and price

{
"name": "Vodka",
"price": 750
}

Example request to update the available product bundles

{
"bundles": [
{
"id": "001",
"type": "CT",
"size": 6
},
{
"id": "002",
"type": "PX",
"size": 40,
"pallet_bundle": {
"type": "CT",
"size": 6
}
}
]
}

Example request to update delivery data

{
"delivery_days": {
"1": { "lead_days": 3 },
"2": { "lead_days": 1, "cutoff": "11:00" },
"3": { "lead_days": 1, "cutoff": "11:00" },
"4": { "lead_days": 1, "cutoff": "11:00" },
"5": { "lead_days": 1, "cutoff": "11:00" }
},
"delivery_date_overrides": {
"2023-12-27": {
"lead_days": 4,
"cutoff": "16:00"
}
},
"dates_with_no_delivery": ["2023-12-26"]
}