Guides

Channel Ingest Webhook

Push delivery-app orders (Panoptes or Talabat format) into one channel, signed with HMAC-SHA256.

A delivery aggregator sends each new order to one Panoptes sales channel. Panoptes maps every item to a product and books the order as an on-account delivery-app sale. The order carries the aggregator's order number, the channel's live commission and the receivable that goes with it.

POST /api/v1/internal/channel-ingest/{channelId}/orders?format=panoptes|talabat
Content-Type: application/json
x-panoptes-timestamp: <unix seconds>
x-panoptes-signature: sha256=<hex>

format defaults to panoptes. The route uses no session and no API key. The signature is the only credential.

Before you send

  1. Set up the channel. In the dashboard, open Delivery → Channels and create or edit the delivery app. Give it an External store id. A channel without one does not accept orders. You can also use POST /api/v1/console/delivery/channels or PATCH /api/v1/console/delivery/channels/{id} with externalStoreId. The store id must be unique among active delivery apps.
  2. Map every item. Each product code the aggregator sends needs a product map row for the channel. One unmapped item rejects the whole order (see the errors below).
  3. Get the channel's signing secret from the channel's ingest-signing panel in the dashboard, together with its channelId. Each channel has its own secret, so a signature made for one channel does not verify on another. Keep the secret on your server.

Signing

HeaderValue
x-panoptes-timestampWhen you signed, in Unix seconds. It must be within 5 minutes of the server clock.
x-panoptes-signaturesha256= followed by the lowercase hex HMAC-SHA256 of {timestamp}.{rawBody}, keyed by the channel's secret.

Sign the exact bytes you send. If you re-serialise the JSON after signing, the signature will not match. The body may be at most 256 KiB.

import crypto from 'node:crypto';

const channelId = process.env.PANOPTES_CHANNEL_ID;
const body = JSON.stringify(order);
const timestamp = Math.floor(Date.now() / 1000).toString();
const signature = crypto
  .createHmac('sha256', process.env.PANOPTES_CHANNEL_SECRET)
  .update(`${timestamp}.${body}`)
  .digest('hex');

await fetch(
  `https://api.panoptesos.com/api/v1/internal/channel-ingest/${channelId}/orders?format=panoptes`,
  {
    method: 'POST',
    headers: {
      'content-type': 'application/json',
      'x-panoptes-timestamp': timestamp,
      'x-panoptes-signature': `sha256=${signature}`,
    },
    body,
  },
);
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$(cat order.json)" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -X POST "https://api.panoptesos.com/api/v1/internal/channel-ingest/$CHANNEL_ID/orders?format=panoptes" \
  -H "content-type: application/json" \
  -H "x-panoptes-timestamp: $TS" \
  -H "x-panoptes-signature: sha256=$SIG" \
  --data-binary @order.json

Payloads

format=panoptes

The Panoptes order shape. Use it for any aggregator, or for your own middleware.

{
  "externalOrderId": "TOT-55120",
  "lines": [
    { "productCode": "SHAWARMA-CHK", "quantity": 3, "unitPrice": 5000, "name": "Chicken shawarma" },
    { "productCode": "AYRAN", "quantity": 3, "unitPrice": 1000 }
  ],
  "totals": { "gross": 18000, "discount": 0, "total": 18000 },
  "note": "Leave at reception"
}
FieldRequiredNotes
externalOrderIdyesThe aggregator's order number. It is also the idempotency key.
linesyesAt least one line.
lines[].productCodeyesLooked up in the channel's product map.
lines[].quantityyesA whole number above 0.
lines[].unitPricenoIQD, as an integer.
lines[].namenoShown on the order if the line needs attention.
totalsnoWhat the aggregator charged (gross, discount, total, IQD). Panoptes prices the order itself, then compares and reports any difference.
shift, notenoFree text.
channelCodenoIgnored: the channel always comes from the URL.

format=talabat

Talabat orders use the Delivery Hero POS order shape. The order id is code (or token), and each product's code is its remoteCode (or sku). Set that code on every item of the Talabat menu.

{
  "code": "T-88213907",
  "token": "a1b2c3",
  "shortCode": "907",
  "test": false,
  "products": [
    { "remoteCode": "BURGER-CLASSIC", "name": "Classic burger", "quantity": 2, "unitPrice": 9000, "paidPrice": 18000 },
    { "remoteCode": "FRIES-L", "name": "Large fries", "quantity": 1, "unitPrice": 4000, "paidPrice": 4000 }
  ],
  "discounts": [{ "amount": 2000 }],
  "comments": { "customerComment": "No onions" }
}

Panoptes refuses an order with "test": true and books nothing for it.

Response

Responses use the public envelope.

{
  "ok": true,
  "data": {
    "ingestionId": "0192f0a4-5c1e-7b11-9a0e-3f6c2b7d8e41",
    "status": "accepted",
    "deduped": false,
    "channelId": "0192f0a4-1111-7000-8000-000000000001",
    "orderId": "0192f0a4-2222-7000-8000-000000000002",
    "orderCode": "ORD-2026-004812",
    "grossTotal": 22000,
    "discountAmount": 2000,
    "customerPaid": 20000,
    "netRevenue": 17000,
    "totalsMatch": true,
    "mismatches": []
  }
}
  • 201: a new order was booked.
  • 200 with "deduped": true: this order was already received. Panoptes returns the original order and books nothing new.

The idempotency key is {channelId}:{externalOrderId}, so you can safely retry an order with the same external id.

Errors

A refusal from the signature check is { "ok": false, "error": "<name>" }. Every other failure is { "ok": false, "error": { "code": <status>, "message": "..." } }.

StatusWhenWhat to do
401unauthorized: the signature or timestamp header is missing, the signature is wrong, the timestamp is more than 5 minutes off, or the channel has no secret. All of these return the same response.Check the secret, the channelId, the clock and that you signed the raw body.
403The account is not currently serviceable, or delivery is not part of its plan.Contact the restaurant.
404No active delivery channel accepts signed orders at this address: the channel is unknown or inactive, is not a delivery app, or has no external store id.Check the channelId and the channel's settings.
409One or more product codes are not mapped for this channel, or a mapped product is unavailable (86'd or inactive). The message lists the codes. Nothing is booked.Map the item, or make the product available again, then resend.
413payload_too_large: the body is over 256 KiB.Trim the order.
422The body is not valid JSON, format is unknown, a required field is missing, a quantity is not a whole positive number, there are no lines, or it is a Talabat test order.Fix the payload. Resending it unchanged will fail again.
429More than 120 requests in a minute from your address. The response has a Retry-After header.Wait for Retry-After, then resend with the same externalOrderId.
500The order could not be booked.Retry with the same externalOrderId. This cannot create a duplicate.

A rejected order is logged on the channel's ingest log in the dashboard, but nothing is booked. Resend it after you fix the cause.