Skip to content

Orders ​

Create an order ​

http
POST /api/web-orders/v1/orders
Authorization: Bearer <token>
X-Idempotency-Key: SITE-10023
Content-Type: application/json
json
{
  "externalOrderId": "SITE-10023",
  "customer": { "name": "Ayşe Y.", "phone": "+905321234567" },
  "delivery": {
    "type": "delivery",
    "address": {
      "text": "Atatürk Cd. No:5 Kadıköy/İstanbul",
      "doorNo": "4", "flatNo": "7", "directions": "Above the pharmacy",
      "lat": 40.9901, "lng": 29.0275
    }
  },
  "items": [
    {
      "productId": "8f1c2a90-6c1e-4f6b-9a0e-1b2c3d4e5f60",
      "name": "Adana Wrap", "quantity": 2, "unitPrice": 180.00, "note": "no onions",
      "options": [ { "name": "Ayran", "price": 20.00 } ]
    },
    { "externalProductId": "SKU-55", "name": "Künefe", "quantity": 1, "unitPrice": 150.00 }
  ],
  "deliveryFee": 25.00,
  "discount": 0,
  "total": 575.00,
  "payment": { "status": "paid", "method": "online" },
  "note": "Do not ring the bell"
}

201 response:

json
{ "success": true, "data": { "orderId": "e5a9f0d3-...", "orderNumber": "WB-261109-14", "status": "pending", "test": false } }

Store orderId: status, cancel and webhooks all carry it.

Fields ​

FieldRequiredNotes
externalOrderIdyesYour order number, up to 64 chars. Echoed back in webhooks
customer.name, customer.phonerecommendedSo the courier and restaurant can reach the customer
delivery.typeyesdelivery or pickup (customer collects, no courier)
delivery.address.text, lat, lngyes for deliveryLocation drives courier assignment
items[].name, quantity, unitPriceyesQuantity is an integer ≥ 1
items[].productIdnoHızlıyo product id (catalog); lets stock and reports recognise the item
items[].externalProductIdnoYour SKU (for your records). Items without productId are taken by name; stock deduction and product reports will not recognise them
items[].options[]noOptions (name + price), price per unit
deliveryFee, discountnoDefault 0
totalyesWhat the customer pays
payment.statusyespaid (charged on your site, courier collects nothing) or unpaid (pay at the door)
payment.methodyes when unpaidcash or card
notenoOrder note; item notes are shown to the restaurant together with it

Rules ​

  • The total must add up: Σ (unitPrice + option prices) × quantity + deliveryFee − discount = total (±0.01), otherwise TOTAL_MISMATCH. You own the prices; Hızlıyo does not reprice against its menu.
  • Idempotency: send X-Idempotency-Key (falls back to externalOrderId). A repeat with the same key and body returns the first response and creates no second order; the same key with a different body is DUPLICATE_ORDER (409).
  • Acceptance: if the restaurant accepts orders manually the order comes back pending; with auto-accept, accepted. Either way, the next steps arrive as webhooks.

Get status ​

GET /api/web-orders/v1/orders/{orderId} returns orderId, externalOrderId, orderNumber, status, createdAtUtc, lastStatusChangeAtUtc.

statusMeaning
pendingWaiting for the restaurant to accept
received / acceptedReceived / accepted by the restaurant
preparing, readyBeing prepared, ready
picked_up, on_the_wayCourier picked it up, on the way
deliveredDelivered
cancelledCancelled or rejected

Webhooks are the primary channel; use this when one is missed (600 requests per minute).

Cancel ​

POST /api/web-orders/v1/orders/{orderId}/cancel with { "reason": "..." }. Only while the order is pending. After the restaurant accepts, the kitchen may have started: you get CANCEL_NOT_ALLOWED (409) and the customer should call the restaurant.

Catalog ​

GET /api/web-orders/v1/catalog returns the restaurant's items on sale (Hızlıyo product id, name, price, options). It is available when Hızlıyo has linked a catalog to your credentials; otherwise CATALOG_NOT_CONFIGURED (404) — keep sending items by name and price.

Is the store open? ​

GET /api/web-orders/v1/store/status → { "acceptingOrders": true }. Informational, for showing "we're closed" on your site; the restaurant may reject orders received while closed.

Hızlıyo Vendor API v1