POST /shop/deliveries
Create a delivery for Items that already exist in YourBarMate. This is useful when goods arrive outside the YourBarMate ordering process: the request does not place an order with a Supplier. Creating the delivery alone does not book its Items into an area. This route requires Deliveries:READ_LIST permission.
First find the Item IDs and the destination area. If you expect the booking to increase counted stock, check that the area's stock_pool is STOCK_TRACKING; an ITEMS_ONLY area does not keep a counted balance.
Request properties
products: Object keyed by existing Item IDs. Each entry needs acountof zero or more. The entry may also include a validbundle,pricein cents,price_peroractual_weightwhen applicable. (required)supplier: Numeric supplier ID. Omit it for a delivery without an assigned supplier. (optional)reference: Your reference for the delivery, such as a delivery-note number. (optional)
Use existing Item IDs and product entries that match the Items' units and bundles. If you include a supplier, the delivery cannot contain an Item assigned to a different supplier.
Response
A successful request returns 200 and the created delivery, including its numeric id, products and status ARRIVED. The response also includes reference when you supplied one. Use the returned id for booking the delivery into an area.
The create request is not an idempotent lookup by reference. If the response is lost, check for the delivery before sending the same request again: repeating it could create a second delivery.
Invalid product data or an Item assigned to a different Supplier returns 400. Use Item IDs from your account; the response for an unknown Item ID is not reliably defined by the current backend.
Example
Replace ITEM_ID with an existing Item ID. This request creates a delivery of one Item without assigning a supplier:
curl 'https://app.yourbarmate.com/api/shop/deliveries' \
--request POST \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'authorization: token YOUR_API_TOKEN' \
--data '{"reference":"DELIVERY-NOTE-123","products":{"ITEM_ID":{"count":1}}}'
Next, book the delivery into an area. Without that step, it remains an arrived delivery and does not increase counted stock.