Connect API Documentation

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

Create a new product or update an existing one

PUT /products/:id

Parameters

  • id: The unique product identifier to use. Must be URL friendly ([a-zA-Z0-9_-]).

Request properties

  • id: Same as the id in the URL (optional).
  • status: One of "ACTIVE", "INACTIVE" or "OUT_OF_STOCK" (optional)
  • 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" (optional). If set to "kg", the vessel property must be omitted or set to { size: 1, unit: "kg" }.
  • vessel: The vessel object (optional):
    • 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 (optional):
    • 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 (optional)
  • price_per: One of "vessel", "l", "kg" or "100g" (optional)
  • 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.
  • image: Object representing the image associated with the product. (optional)
    • url: Publicly accessible URL where we can download the file from.
    • etag: ETag for cache invalidation - if not provided, we add it when downloading it. (optional)
    • last_modified: Last modified timestamp for cache invalidation - if not provided, we add it when downloading it. (optional)

New products must at least contain the fields id, status, category and name.

The id field cannot be changed. Once a product is in use by customers, it cannot be deleted.

Status codes

  • 200 on success
  • 400 if the request is invalid

Response properties

The new product as returned by GET /products/:id.

Example requests

Bottle with 7 dl, price is per vessel:

{
"id": "123456789",
"status": "ACTIVE",
"category": "DRINKS",
"name": "Vodka",
"vessel": {
"size": 7,
"unit": "dl",
"type": "BO"
},
"bundles": [
{
"id": "001",
"type": "CT",
"size": 6
}
],
"price": 750,
"min_order_count": 6
}

Barrel with 40 l, price is per liter:

{
"id": "123456789",
"status": "ACTIVE",
"category": "DRINKS",
"name": "Lager",
"vessel": {
"size": 40,
"unit": "l",
"type": "BA"
},
"price": 175,
"price_per": "l"
}

Piece of meat, average size is 250 g, price is per kilo:

{
"id": "123456789",
"status": "ACTIVE",
"category": "FOOD",
"name": "Meat",
"vessel": {
"size": 250,
"unit": "g",
"type: "NA"
},
"price": 3200,
"price_per": "kg"
}

Tomatoes, can be ordered in any quantity of "kg", price is per kilo:

{
"id": "123456789",
"status": "ACTIVE",
"category": "FOOD",
"name": "Tomato",
"order_by": "kg",
"price": 290,
"price_per": "kg"
}

Porcini mushrooms, only available to be delivered on Mondays:

{
"id": "123456789",
"status": "ACTIVE",
"category": "FOOD",
"name": "Porcini (Fresh)",
"order_by": "kg",
"price": 1290,
"price_per": "kg",
"delivery_days": {
"1": { "lead_days": 2 }
}
}