Connect API Documentation

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

Update a customer

Update the settings for one customers. Overrides account settings for deliveries for the given customer.

Request

PATCH /customers/:id

Parameters

  • id: The customer ID

Request properties

Any combination of these properties can be updated.

  • price_group: The customer's price group. Set to null to clear the price group.
  • delivery_days: An object where keys are numbers 0 (Sunday) to 6 (Saturday) and values are objects with the following properties. Set to null to clear delivery days.
    • lead_days: The number of days that customers have to order in advance. Use 0 for same day delivery. Required.
    • cutoff: The time until when orders have to be placed in the format HH:mm. After this time lead_days is incremented by one. Optional, defaults to 23:59.
  • delivery_date_overrides: An object where keys are ISO dates (e.g. 2023-12-26) and values are objects with the following properties. Set to null to clear delivery date overrides.
    • lead_days: The number of days that customers have to order in advance. Use 0 for same day delivery. Required.
    • cutoff: The time until when orders have to be placed in the format HH:mm. After this time lead_days is incremented by one. Optional, defaults to 23:59.
  • dates_with_no_delivery: An array of dates in ISO date format. Customers cannot send orders for these dates. Set to null to clear the dates with no delivery.

Status codes

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

Response properties

The full customer settings as returned by GET /customer/:id.

Example request to update price group

{
"delivery_days": { "price_group": "group-1" }
}

Example request to update delivery days

{
"delivery_days": { "1": { "lead_days": 0 } }
}

Example request to remove all optional properties

{
"delivery_days": null,
"delivery_date_overrides": null,
"dates_with_no_delivery": null
}

Example request to set delivery details

{
"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-25"]
}

Example response

{
"id": "CS334002",
"name": "Bar in Zug",
"price_group": "group-1",
"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-25"]
}