Order lists

Order lists in the YourBarMate Shop are saved lists of Items you can use again when preparing an order. Saving a list does not send an order to a supplier or book anything into stock.

The API calls an Order list a Shop session with status: "TEMPLATE". All paths below are relative to the base URL, require an API token and need Deliveries:READ_LIST permission.

Find and inspect order lists

Method Path What it does
GET /shop/sessions?status=TEMPLATE Lists saved order lists
GET /shop/sessions/{id} Reads one order list and its Items

The list endpoint returns up to 25 entries per page. Each entry includes an id, status, total and suppliers; it can also include the list's name. If the response includes a numeric cursor, pass it unchanged as cursor in the next request. Use the numeric id to read a list's details, including its products and Item order.

curl 'https://app.yourbarmate.com/api/shop/sessions?status=TEMPLATE' \
  --header 'accept: application/json' \
  --header 'authorization: token YOUR_API_TOKEN'

Create or change an order list

Method Path What it does
POST /shop/sessions Creates a saved order list
PATCH /shop/sessions/{id} Changes an existing order list
DELETE /shop/sessions/{id} Deletes an order list from your account

For POST /shop/sessions, set status to TEMPLATE. The request also needs preferred_delivery_schedule (null if you do not set one), timezone_offset in minutes and a products map keyed by existing Item IDs. Each product needs a count of at least 0. You can add a name, product_order and group_by (ordered or category). The response contains the new list's numeric id.

{
  "status": "TEMPLATE",
  "name": "Weekly order",
  "preferred_delivery_schedule": null,
  "timezone_offset": 0,
  "products": {
    "ITEM_ID": { "count": 2 }
  }
}

Use PATCH /shop/sessions/{id} to change the name or products. Check that the ID belongs to a TEMPLATE before editing: the same route can also change other Shop sessions. If you send products, include the full map of Items you want the list to retain; it replaces the list's current products. Send name: null to remove the name. To make a copy, read the existing list and create a new one with POST /shop/sessions, a new name and the products you want to keep; there is no separate duplicate endpoint. Deleting an Order list removes the saved list, not the Items it refers to, and returns status: "DELETED".

Use a list to prepare an order

POST /shop/sessions/{id} with a body such as { "timezone_offset": 0 } prepares a draft from that Order list. It returns the draft data but does not save a new session or send an order. The response can be 202 when delivery dates need recalculation. You can review and adjust the draft before using the Shop ordering flow. Do not treat this request as confirmation that a Supplier received an order.

For orders, deliveries and open order drafts, see Read orders and Read Shop order drafts.