List orders
const url = 'https://example.com/orders?status=draft&excludeCancelled=true&excludeRefunded=true&customerId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&unassigned=true&deliveryStage=waiting&fulfilment=delivery&shopId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&paid=yes&late=true&sort=placed&order=asc&limit=50&offset=0';const options = { method: 'GET', headers: {cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/orders?status=draft&excludeCancelled=true&excludeRefunded=true&customerId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&unassigned=true&deliveryStage=waiting&fulfilment=delivery&shopId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f&paid=yes&late=true&sort=placed&order=asc&limit=50&offset=0' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token>Filter by order status, current delivery stage, customer, whether an order is still unassigned, or the day it is wanted.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Customer name, order reference, invoice number or product name.
Customer name, order reference, invoice number or product name.
Exclude cancelled orders before counting and pagination.
Exclude cancelled orders before counting and pagination.
Exclude orders with a full or partial shop refund or a recorded Bottle refund.
Exclude orders with a full or partial shop refund or a recorded Bottle refund.
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Only these orders: up to 200 order ids, separated by commas. Ids from another business are ignored.
Only these orders: up to 200 order ids, separated by commas. Ids from another business are ignored.
Only the orders on these invoices: up to 200 invoice ids, separated by commas. Covers both an invoice raised for one order and a weekly, monthly or quarterly invoice that billed several.
Only the orders on these invoices: up to 200 invoice ids, separated by commas. Covers both an invoice raised for one order and a weekly, monthly or quarterly invoice that billed several.
The day they are wanted.
The day they are wanted.
Only orders that are not currently on a round.
Only orders that are not currently on a round.
Only open deliveries waiting to be planned, assigned to a planned round, or currently out.
Only open deliveries waiting to be planned, assigned to a planned round, or currently out.
Placed on or after this day.
Placed on or after this day.
Placed on or before this day.
Placed on or before this day.
Delivery: goes on a round. collection: the customer picks it up from the yard; never planned onto a van, and comes off stock when marked collected.
Delivery: goes on a round. collection: the customer picks it up from the yard; never planned onto a van, and comes off stock when marked collected.
Only orders that came from this connected shop.
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fOnly orders that came from this connected shop.
Whether they have been paid for. ‘no’ is orders that still owe money: not on account, not cancelled, not marked paid.
Whether they have been paid for. ‘no’ is orders that still owe money: not on account, not cancelled, not marked paid.
Only placed orders wanted on a day already gone.
Only placed orders wanted on a day already gone.
Only orders delivered or collected on this day.
Only orders delivered or collected on this day.
What to put the list in order by: placed (when it was taken, the default), wanted (the day wanted) or customer (the customer name).
What to put the list in order by: placed (when it was taken, the default), wanted (the day wanted) or customer (the customer name).
Which way. Placed is newest first unless asc; wanted is soonest first and customer A to Z unless desc.
Which way. Placed is newest first unless asc; wanted is soonest first and customer A to Z unless desc.
Responses
Section titled “Responses”Orders
object
object
UUID v7
UUID v7
Consumer: use consumer list prices. trade: use trade prices where set. Agreed rates, customer price lists and price rules still take priority.
UUID v7
object
UUID v7
object
UUID v7
object
UUID v7
The drop that failed, while the order is open, for delivery and not back on a round. Only the full order fills it: not the items of GET /orders.
object
UUID v7
Delivery: goes on a round. collection: the customer picks it up from the yard; never planned onto a van, and comes off stock when marked collected.
UUID v7
Bottle: Bottle owns invoicing and payment. shop: the connected shop owns both, so Bottle must only fulfil the order. elsewhere: the business invoiced or took payment outside Bottle, so Bottle only fulfils the order.
object
object
object
UUID v7
On_account: billed later, nothing to collect. link: a payment link raised in the accounting system. cash: the driver takes it at the door.
object
UUID v7
UUID v7
Pence, as agreed when the order was written, and as typed.
object
UUID v7
object
UUID v7
object
object
object
UUID v7
UUID v7
object
object
UUID v7
Own_driver: the business’s own driver delivered it. delivery_partner: another company delivered it for the business.
object
UUID v7
UUID v7
object
UUID v7
UUID v7
object
object
UUID v7
UUID v7
Example
{ "items": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "customerId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "pricingAudience": "consumer", "deliveryAddressId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "placement": "drop", "roundId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "round": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "status": "planned" }, "deliveredBy": { "roundId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }, "failedDrop": { "reason": "nobody_in", "roundId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }, "status": "draft", "fulfilment": "delivery", "source": "office", "shopId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "billingOwner": "bottle", "trackingRef": "7K3M9QWXZ2", "leaveInstruction": "none", "deliveryOptionId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "surchargeAppliesTo": "all_orders", "surchargeChargeBy": "per_order", "surchargeTargetIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "paymentMethod": "on_account", "cylinderCharge": "deposit", "lines": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productName": "19kg propane" } ], "collect": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productName": "19kg propane" } ], "returned": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productName": "19kg propane" } ], "availableDepositRefund": { "lines": [ { "depositProductId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "cylinderProductId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ] }, "payments": [ { "method": "cash", "cashLocation": "office" } ], "paidVia": "online", "invoice": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "number": "INV-BTL00042", "status": "sent" }, "deliveryMethod": "own_driver", "partnerDelivery": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "partnerId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "sentVia": "email", "edited": [ "products" ] }, "deliveryCorrections": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "kind": "delivered", "lineId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "deliveryProofs": [ { "kind": "signature" } ], "deliveryNotes": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "orderId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ] } ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed, or a line names something not sold
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}