Guides
Receive orders by pulling
The simplest way: no public address, no inbound connections. Good for POS and kitchen systems behind a firewall. Used when settings.orders.delivery is pull.
The flow#
- Customer → Let's PizzaConfirms and pays
- Let's PizzaOrder placed, awaiting your ack
- Your system → Let's PizzaAnything new?
GET /partner/v1/orders?cursor=… - Let's Pizza → Your systemOrders and the next cursor
- Your system → Let's PizzaGot it; my number for it is …
POST /partner/v1/orders/{id}/ack - Your system → Let's PizzaAccepted, preparing, ready
POST /partner/v1/orders/{id}/status
The pull loop#
- Ask for orders with the cursor you saved (none the first time).
- Store each order in your system, in one transaction with the new cursor.
- Acknowledge each order. An order you did not acknowledge comes again on the next pull.
- If nextCursor is not null, pull again at once; otherwise wait a few seconds.
let cursor = await store.loadCursor();
for (;;) {
const res = await fetch(`${process.env.LP_BASE_URL}/partner/v1/orders${cursor ? `?cursor=${cursor}` : ''}`, {
headers: { Authorization: `Bearer ${process.env.LP_API_KEY}` },
});
if (res.status === 429) { await sleep(Number(res.headers.get('retry-after') ?? 5) * 1000); continue; }
const page = await res.json();
for (const item of page.items) {
await store.saveOrder(item.order); // idempotent on item.order.id
await ack(item.order.id); // POST /partner/v1/orders/{id}/ack
}
if (page.nextCursor) { cursor = page.nextCursor; await store.saveCursor(cursor); continue; }
await sleep(5000);
}Acknowledging#
An acknowledgement means the order is in your system. Send your own number for it, so branch staff see it. If an order is not acknowledged within settings.orders.ackMinutes minutes, the branch is alerted to handle it from our board.
The order#
Each item of the feed carries order (the order itself), state (awaiting ack, acked or closed), the ack deadline ackDueAt, and your number once acknowledged. The full shape is in Models.
And this is the order of a really priced order from branch At Takhassusi: two large Margheritas with tomato sauce and two cans of cola, delivery, cash at the door. Amounts in halalas.
{
"id": "7f3a2c10-5b8e-4d21-9c47-1a2b3c4d5e01",
"number": "261119-0041",
"status": "placed",
"channel": "app",
"branchId": "28",
"fulfilment": "delivery",
"paymentMethod": "cash_on_delivery",
"catalogVersion": "taker-2026-10-06.5d01b76bc1",
"lines": [
{
"lineIndex": 0,
"line": {
"productId": "649",
"qty": 2,
"selections": [
{
"groupId": "1362",
"optionId": "11836",
"qty": 1
}
],
"source": {
"experience": "classic"
}
},
"unitPrice": 4200,
"lineTotal": 8400,
"snapshot": {
"names": {
"ar": "مارقريتا",
"en": "Margherita Pizza"
},
"options": [
{
"groupId": "1362",
"optionId": "11836",
"names": {
"ar": "صلصة طماطم",
"en": "Tomato Sauce"
},
"qty": 1,
"price": 0
}
]
}
},
{
"lineIndex": 1,
"line": {
"productId": "740",
"qty": 2,
"selections": [],
"source": {
"experience": "classic"
}
},
"unitPrice": 600,
"lineTotal": 1200,
"snapshot": {
"names": {
"ar": "كولا",
"en": "Coca Cola Can"
},
"options": []
}
}
],
"subtotal": 9600,
"discounts": [],
"discountTotal": 0,
"deliveryFee": 1800,
"total": 11400,
"vat": {
"rateBps": 1500,
"amount": 1487,
"includesDeliveryFee": true
},
"cutlery": false,
"ifUnavailable": "call",
"delivery": {
"address": "حي المعذر الشمالي، شارع الأمير سلطان، عمارة 14",
"details": "الدور الثاني، شقة 5، بجوار الصيدلية",
"location": {
"lat": 24.6921,
"lng": 46.6853
},
"contactName": "عبدالله",
"contactPhone": "+966500000000"
},
"createdAt": "2026-11-19T19:30:12+03:00",
"history": [
{
"from": null,
"to": "placed",
"at": "2026-11-19T19:30:12+03:00",
"actor": "customer"
}
]
}Endpoints used#
Anything marked “Coming soon” is not served yet; it joins the reference as soon as it ships.