Webhooks
Webhooks push order, production and actual shipping events from Meykt to an HTTPS endpoint you control, so your integration can reduce polling and reconcile changes promptly. Endpoints are managed through the API with a live API key that carries the webhooks:manage scope, and every delivery is signed with an HMAC-SHA256 signature you must verify. Events cover only API orders in the live environment — never test orders, never orders that came from a connected shop.
All webhook API operations require this live key: registering, listing and disabling endpoints, reading the delivery log, reading or replacing event subscriptions, and sending a test ping. A test key with webhooks:manage receives 403 unsupported_test_operation. Rejected calls read no webhook data and contact no target.
Existing endpoints created with a test key receive no real business events. An endpoint created with a live key retains its independent lifetime: revoking or expiring that key alone does not disable the endpoint. Separately key-authorized event subscriptions still depend on their current grant, as described under Explicit event subscriptions.
#Register an endpoint
POST https://api.meykt.com/v1/webhook-endpoints creates an endpoint. Requires a live key with the webhooks:manage scope.
curl -X POST https://api.meykt.com/v1/webhook-endpoints \
-H "Authorization: Bearer $MEYKT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://erp.musterwerkstatt.example/meykt/webhook",
"description": "Musterwerkstatt ERP"
}'{
"data": {
"endpoint": {
"id": "b7f1c2a4-9d3e-4c1b-8a52-0f6d9e4a7c31",
"url": "https://erp.musterwerkstatt.example/meykt/webhook",
"description": "Musterwerkstatt ERP",
"is_active": true,
"disabled_reason": null,
"consecutive_failures": 0,
"last_success_at": null,
"last_failure_at": null,
"created_at": "2026-08-07T09:12:44.118Z"
},
"secret": "whsec_EXAMPLE_DO_NOT_USE_00000000000000"
}
}Rules that apply at registration time:
- The
secretis returned exactly once, in this response. It cannot be retrieved later — not through the API, not through the dashboard. Store it in your configuration before you do anything else. If you lose it, delete the endpoint and register a new one. httpsonly. Anhttp://URL is rejected with422webhook_url_invalid. URLs with embedded credentials (https://user:pass@…) are rejected the same way.- Private and reserved addresses are rejected with
422webhook_target_blocked. Meykt resolves the target host again before each delivery and verifies the address is public; DNS changes behind load balancers or CDNs are followed automatically. If the host later resolves only to a private or reserved address, that delivery fails instead of connecting. - Redirects are not followed. A
301/302response counts as a failed delivery. Point the endpoint at its final URL. - At most 5 active endpoints per connection. A sixth registration returns
422webhook_limit_reached. Disable one first.
#Listing and disabling endpoints
GET https://api.meykt.com/v1/webhook-endpoints returns your endpoints (up to 50, newest first). Secrets are never included.
curl https://api.meykt.com/v1/webhook-endpoints \
-H "Authorization: Bearer $MEYKT_API_KEY"Each entry carries id, url, description, is_active, disabled_reason, consecutive_failures, last_success_at, last_failure_at and created_at. Use consecutive_failures and disabled_reason for health monitoring.
DELETE https://api.meykt.com/v1/webhook-endpoints/{id} disables an endpoint permanently. It is a deactivation, not a row deletion: the delivery log stays readable. The response is {"data": {"id": "...", "is_active": false}}. An unknown or foreign id returns 404 not_found — never 403.
#Event types
Events come in two groups. Default order events are delivered to every active endpoint unless you change its subscription. Subscription-only events are never delivered until you add them to an endpoint's subscription, and each needs a data-read scope on the same live key.
#Default order events
| Event type | Sent when | Additional data fields |
|---|---|---|
order.received | An API order was accepted and newly created (HTTP 201) | — |
order.updated | A change command was applied, or dispatch progress changed the order (reason: "dispatch_progress") | command_id, revision, code for commands; reason for dispatch progress |
order.update_rejected | A change command ended as rejected | command_id, revision, code |
order.cancel_rejected | A cancellation command ended as rejected | command_id, revision, code |
order.production_started | The production order moved to in_progress | production_order_id, production_status |
order.production_completed | The production order moved to completed | production_order_id, production_status |
order.production_failed | The production order moved to failed | production_order_id, production_status; for a failure the fulfiller reports by hand also reason and note |
order.cancelled | The source API order was actually cancelled — by your order command or by the merchant in Meykt (sent once the order status is cancelled, also after a fulfiller confirmed a requested cancellation); replacing a partner copy or cancelling one run is insufficient | command_id, revision, code when produced by an order command |
order_item.completed | A production job for one order item was completed | order_item_id, production_job_id, sku, name |
order.shipped | Actual physical dispatch of a current own/partner execution, projected onto your source order — from the Meykt warehouse, or reported as shipped outside it | shipments, complete; for a reported shipment also source: "external" and completion |
ping | You called the test endpoint | message only — no order fields |
Partner-produced orders carry "produced_by_partner": true on their production events; see Orders produced by a partner and Fulfillment via API.
#Subscription-only events
| Event type | Sent when | Needs scope |
|---|---|---|
dispatch.confirmed | A dispatch section containing your order was physically confirmed | orders:read |
shipment.tracking_changed | Tracking was recorded or corrected on such a dispatch section | orders:read |
order.partially_fulfilled | A dispatch section was confirmed and quantities of your order remain | orders:read |
order.fulfilled | A dispatch section was confirmed and all ordered quantities have shipped | orders:read |
order.handed_over | The order (or the partner's copy of it) was reported as handed over without a parcel: picked up, on site, in person, nothing to ship, or just completed (handover_kind: "outside_meykt") | orders:read |
order.message_received | Your fulfiller wrote a message or asked a question about your order (Questions and messages) | orders:read |
order.production_held | Your fulfiller set its order to query, paused or on_hold | orders:read |
order.production_resumed | Your fulfiller continues after query, paused or on_hold | orders:read |
order.partner_cancelled | Your fulfiller cancelled its order for your order on its own, without your request (Changes and cancellation) | orders:read |
order.partner_handover_incomplete | Lines of your order did not reach a fulfiller (new or changed gap) | orders:read |
order.partner_handover_completed | A reported gap has closed: every line is at a fulfiller | orders:read |
dispatch.production_completed | All production required for a dispatch section is ready | orders:read |
fulfillment_order.received | As a fulfiller: an order from a client arrived completely (Receiving orders as a fulfiller) | fulfillment:read |
fulfillment_order.updated | As a fulfiller: the client changed the shipping address of a received order (reason: "shipping_address_changed") | fulfillment:read |
fulfillment_order.cancelled | As a fulfiller: a received order was cancelled or replaced by a new one | fulfillment:read |
fulfillment_order.change_requested | As a fulfiller: the client asks for a change or cancellation of a received order | fulfillment:read |
fulfillment_order.message_received | As a fulfiller: the client wrote in the thread of a received order | fulfillment:read |
inventory.changed | Authorized inventory changed; carries a revision range and cursor | inventory:read |
inventory.positions_changed | Condition positions need a refresh (refresh_required: true) | conditions:read |
article.updated | An article or one of its variants was created or changed | products:read |
structure.activated | A stock structure version was activated | products:read |
inbound.announced, inbound.updated, inbound.eta_changed, inbound.arrived, inbound.received, inbound.closed, inbound.cancelled, inbound.availability_changed | The matching step of an inbound delivery | inbound:read |
return.announced, return.updated, return.received, return.inspected, return.decision_required, return.disposition_completed, return.closed | The matching step of a return | returns:read |
kit.assembled, kit.disassembled, production.material_consumed, production.output_recorded, production.scrap_recorded | A manufacturing booking | inventory:read |
delivery.succeeded, delivery.failed, delivery.paused | Meykt's own transfer of stock or shipment data to a connected Shopify store succeeded, failed or was paused. These events do not describe parcel delivery to an end customer. | webhooks:manage |
The dispatch-section events (dispatch.*, shipment.tracking_changed, order.fulfilled, order.partially_fulfilled) come only from the dispatch-section workflow. A whole order shipped from the Meykt warehouse produces order.shipped instead. If you need one signal for every physical dispatch, use order.shipped and reread Shipping and progress.
Scope and limits of the event stream:
- Production completion is separate from shipment.
order.shippedrequires actual physical handover; labels and packed status alone do not produce it. Use Shipping and progress for current source quantities, packages and tracking. - Inventory: notification plus delta read.
inventory.changedonly tells you that something changed; it is not a movement journal. Read Inventory with its cursor to obtain the current state, and keep polling as a fallback. Do not treat order events as stock bookings. - A shipment reported outside the Meykt warehouse (your own
POST /v1/orders/{id}/completion, a report in Meykt, or your fulfiller's report on its copy) sendsorder.shippedwith"source": "external","shipments": []andcompletion: { completion_id, kind, completed_at, reported_by, tracking[] }.reported_byisapi,meykt,automaticorpartner. For a partner report,completeis true only when every line of your order went to partners that reported completion. Tracking carriers are free text here (for exampleGLS). The event is not delivered if the report is withdrawn before delivery. order.handed_overcarries{ order_id, external_order_id, completion_id, handover_kind, handed_over_at, reported_by }and needs an explicit subscription.order.message_receivedcarries{ order_id, external_order_id, message }.messagehas the same fields as inGET /v1/orders/{id}/messages:id,from(partner),kind(messageorquestion),reason,body,reply_to,partner_order_number,created_at. Answer a question withreply_to: message.id.order.production_heldcarries{ order_id, external_order_id, fulfillment_status, produced_by_partner: true, reason, note };reasonis one ofaddress_undeliverable,file_unusable,personalization_unclear,item_unavailable,deadline_at_risk,other, ornull.order.production_resumedcarries{ order_id, external_order_id, fulfillment_status, produced_by_partner: true, note }.order.partner_cancelledcarries{ order_id, external_order_id, fulfillment_status: "cancelled", produced_by_partner: true, partner_order_number, reason, note };reasonuses the same values asorder.production_heldor isnull,noteis the fulfiller's message. Your own order is not cancelled: decide whether to request fulfillment again (POST /v1/orders/{id}/handover-retry), produce it elsewhere or cancel it yourself. A cancellation that answers your own cancellation request sends noorder.partner_cancelled.order.partner_handover_incompleteandorder.partner_handover_completedcarry{ order_id, external_order_id, partner_handover }with the samepartner_handoverobject as the order read (reasons).fulfillment_order.*carry{ fulfillment_order_id, order_number, client_id, client_order_number, status };change_requestedaddsrequest_idandrequest_cancel,message_receivedaddsmessage_idandkind,updatedaddsreason. They go to every subscribed endpoint of your organization (received orders belong to no connection) and never name the client's internal ids. Read the order withGET /v1/fulfillment/orders/{id}for the details.- A tracking number added later sends no event for whole-order shipments.
order.shippedcarries the tracking known at dispatch. Reread the shipment when you need numbers recorded afterwards. - Live API orders only. Test orders (keys with the
mk_test_prefix) and orders that arrived through a shop connection never produce events. order.receivedfires only for newly created orders. A repeatedPOST /v1/orderswith identical content answers200with the existing order and produces no event. That is intentional: the retry is a no-op, so there is nothing new to report.- Status transitions only. If a production order is set to a status it already has, no event is produced.
- Event type names are a permanent contract. New types may be added; existing ones are never renamed or repurposed. Treat an unknown
typeas "ignore" rather than as an error.
#Payload
Every delivery is a POST with Content-Type: application/json and this envelope:
{
"id": "1f4d2a67-5b83-4e0c-9a11-8c7de2b45f90",
"type": "order.production_completed",
"created_at": "2026-08-07T11:04:02.517Z",
"api_version": "v1",
"data": {
"order_id": "9c2b7d18-3e54-42a7-b6f0-5a1d8e93c204",
"external_order_id": "ORDER-2026-1044",
"production_order_id": "44a0f6c9-71b2-4d38-9e5c-2f8b0a7e1d36",
"production_status": "completed"
}
}id— unique per event. Use it for deduplication (see Delivery guarantees). It is also sent as theX-Meykt-Event-Idheader.type— one of the values in Event types. Also sent asX-Meykt-Event-Type.created_at— ISO 8601 UTC timestamp of when the event was recorded, not of the delivery attempt.api_version— always"v1"for this API version.data— containsorder_idandexternal_order_idfor every order event, plus the event-specific fields from the table.pingis the only type without order fields.
The data object may gain new fields at any time. Ignore fields you do not know; never reject a payload because it contains more than you expected.
Additional request headers on every delivery: X-Meykt-Signature, X-Meykt-Event-Id, X-Meykt-Event-Type, User-Agent: Meykt-Webhooks/1.0.
#Verifying the signature
Every delivery carries a signature header:
X-Meykt-Signature: t=1786633442,v1=6b2f9c1e84a70d5f3e2c9b81a4d70f6e5c3b2a19d8e7f6c5b4a39281706f5e4dt— Unix timestamp in seconds at the moment of signing. It is generated fresh for every delivery attempt, so a retry of the same event carries a differenttand a differentv1. Never cache or compare against a previously seen signature.v1— lowercase hex HMAC-SHA256 over the string"{t}.{raw request body}", keyed with your secret.
Use the secret exactly as we gave it to you — including the whsec_ prefix. The whole string, as UTF-8 bytes, is the HMAC key. Do not strip the prefix, do not base64-decode it, do not hex-decode it. This is the single most common reason a first integration produces a mismatch.
Four rules, all mandatory:
- Sign the raw body bytes. Do not parse the JSON and re-serialize it — key order and whitespace would change and the signature would never match. Read the request body as a raw string or byte buffer before any JSON middleware touches it.
- Enforce a tolerance window. Reject the request if
tdeviates from your own clock by more than ±5 minutes (300 seconds). This blocks replay of an old, valid payload. - Compare in constant time. Use
timingSafeEqual/hash_equals/hmac.compare_digest, never==on the hex strings. - Treat a missing or malformed header as a failure. If
X-Meykt-Signatureis absent, or does not parse into atand av1value, reject — do not fall through to processing the body.
Reject with 401 and process nothing if any of these checks fails.
#Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';
function verifyMeyktSignature(header, rawBody, secret, toleranceSeconds = 300) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const t = Number(parts.t);
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const given = Buffer.from(parts.v1 ?? '', 'hex');
const want = Buffer.from(expected, 'hex');
return given.length === want.length && timingSafeEqual(given, want);
}In Express, mount express.raw({ type: 'application/json' }) on the webhook route so req.body is the untouched buffer.
#PHP
function meykt_verify_signature(
string $header,
string $rawBody,
string $secret,
int $toleranceSeconds = 300
): bool {
$parts = [];
foreach (explode(',', $header) as $piece) {
$kv = explode('=', $piece, 2);
if (count($kv) === 2) {
$parts[trim($kv[0])] = trim($kv[1]);
}
}
if (!isset($parts['t'], $parts['v1'])) return false;
$t = (int) $parts['t'];
if (abs(time() - $t) > $toleranceSeconds) return false;
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
return hash_equals($expected, $parts['v1']);
}
// Usage
$rawBody = file_get_contents('php://input');
$header = $_SERVER['HTTP_X_MEYKT_SIGNATURE'] ?? '';
if (!meykt_verify_signature($header, $rawBody, getenv('MEYKT_WEBHOOK_SECRET'))) {
http_response_code(401);
exit;
}
$event = json_decode($rawBody, true);#Python
import hashlib
import hmac
import time
def verify_meykt_signature(header: str, raw_body: bytes, secret: str, tolerance_seconds: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
try:
t = int(parts["t"])
given = parts["v1"]
except (KeyError, ValueError):
return False
if abs(time.time() - t) > tolerance_seconds:
return False
expected = hmac.new(
secret.encode("utf-8"),
f"{t}.".encode("utf-8") + raw_body,
hashlib.sha256,
).hexdigest()
return hmac.compare_digest(expected, given)In Flask use request.get_data(); in Django use request.body. Both give you the raw bytes.
#Orders produced by a partner
Some Meykt organizations do not produce every order themselves — they pass items to a partner workshop. Partner production events refer to your own source order and carry "produced_by_partner": true. Current generations and source coverage are checked before aggregate partner completion is announced. A replaced copy never by itself produces order.cancelled for your whole order. Physical shipping has its own order.shipped event with source line quantities and all known package tracking; foreign copy identifiers are not returned. Reload the shipment/progress endpoints for the current state.
One difference: order_item.completed is not emitted for partner-produced orders. Your item IDs do not exist in the partner's system, so an item-level event could not name an item you can look up. Use the order-level events instead.
#Delivery guarantees
Delivery uses retries with at-least-once handling: one event can arrive more than once after a timeout, retry or manual redelivery. This is not a guarantee that every event will eventually reach a recipient: retries are bounded, targets/formats can be paused and access can be withdrawn. Monitor the delivery log and reconcile canonical reads.
- Deduplication is your responsibility. Store the event
id(or theX-Meykt-Event-Idheader) and discard anything you have already processed. Do not rely on event order either: retries can make a later event arrive before an earlier one. - Respond
2xxwithin 10 seconds. Anything else —3xx,4xx,5xx, a connection error, or a timeout — counts as a failed attempt. Acknowledge first, do the heavy work afterwards in your own queue. - The response body is ignored. Only the status code matters. An empty
200is a perfectly good answer. - Retry schedule after a failed attempt: 1 min, 5 min, 15 min, then 1 h, 3 h, 6 h, 12 h, 24 h. After the last attempt the delivery is marked permanently failed and is not retried again. Counting from the first failure, the last attempt happens about 46 hours later.
- Automatic shutdown after 25 consecutive failures. The endpoint is set to
is_active: falsewithdisabled_reason: "too_many_failures". A successful delivery resets the counter to zero. Once disabled, the endpoint receives nothing until you register a new one — monitorconsecutive_failuresthroughGET /v1/webhook-endpointsor the dashboard card.
#Testing
POST https://api.meykt.com/v1/webhook-endpoints/{id}/test requires a live key with webhooks:manage. It queues a synthetic ping event to that one endpoint and wakes the delivery worker; delivery typically starts within a few seconds, sometimes up to about 35 seconds, and up to about a minute under sustained load (wake-ups are coalesced and delivery runs start at most once every 30 seconds). Use it to prove that your signature check and your server work — no real order required.
curl -X POST https://api.meykt.com/v1/webhook-endpoints/b7f1c2a4-9d3e-4c1b-8a52-0f6d9e4a7c31/test \
-H "Authorization: Bearer $MEYKT_API_KEY"The API answers 202 with {"data": {"queued": true}}; this confirms queueing rather than receipt. Delivery normally follows the worker wake; inspect the delivery log instead of assuming a fixed delivery deadline. The payload uses the normal envelope with "type": "ping" and a data object containing only a message.
A disabled endpoint returns 422 validation_failed; an unknown or foreign id returns 404 not_found.
#Delivery log
GET https://api.meykt.com/v1/webhook-deliveries returns the recent delivery attempts for your endpoints, newest first.
| Parameter | Meaning |
|---|---|
endpoint_id | Restrict to one endpoint. UUID letters are case-insensitive. An id that is not yours returns 404 not_found. |
limit | 1–100, default 25. |
curl "https://api.meykt.com/v1/webhook-deliveries?limit=10" \
-H "Authorization: Bearer $MEYKT_API_KEY"Each entry contains id, endpoint_id, event_id, event_type, status, attempts, next_attempt_at, last_attempt_at, response_status, response_snippet, error_code and created_at. The request body is not returned — you already know the contract; the log exists to explain *what happened to the delivery*. response_snippet holds the beginning of your server's response and is usually the fastest way to find a misconfigured receiver.
The same information is available in the dashboard under Integrations → API access → Webhooks, together with a "Redeliver" action for individual deliveries.
#No public server?
Webhooks require a publicly reachable HTTPS endpoint. If you do not have one — an on-premise ERP behind a firewall, a workshop PC, a scheduled script — polling is a fully supported path, not a workaround:
curl "https://api.meykt.com/v1/orders?updated_since=2026-08-07T10:00:00Z&limit=100" \
-H "Authorization: Bearer $MEYKT_API_KEY"Poll GET /v1/orders with updated_since on your own schedule and compare the returned status against what you last stored. Overlap the window slightly (for example, ask for the last 10 minutes every 5 minutes) so a clock skew cannot skip a change. Keep the rate limit of 120 requests per minute per key in mind: one list call with updated_since is always cheaper than one call per order. Details on paging and the updated_since parameter are on the orders page.
#Explicit event subscriptions
GET /v1/webhook-endpoints/{id}/subscriptions returns endpoint_id, revision and event_types for an active endpoint of this connection. PATCH /v1/webhook-endpoints/{id}/subscriptions replaces the complete selection:
{ "idempotency_key": "11111111-1111-4111-8111-111111111111", "expected_revision": 0, "event_types": ["order.received", "inventory.changed"] }Both operations require a live key with webhooks:manage. New event families additionally require their data-read scope on the same live key: inventory → inventory:read; article/structure → products:read; inbound → inbound:read; returns → returns:read; dispatch/tracking/progress → orders:read. The complete event enum is in OpenAPI. Existing endpoints retain the original order-event selection; new data families are never subscribed automatically.
An empty list disables business notifications. An explicitly requested connectivity ping remains possible. Subscription changes need the current revision; an exact retry with the same idempotency key returns its saved receipt. A deleted/revoked/expired authorizing key or revoked owner permission stops queued messages as well as future ones. A saved subscription alone is not proof of current delivery permission.
inventory.changed carries a revision range and cursor. Read the change feed to obtain current authorized inventory. Do not interpret a notification as a complete movement journal. Deliveries remain at-least-once: deduplicate event IDs, retain a local cursor, and reconcile after an outage.
#Complete field reference
- Webhooks: field reference — all request, response and parameter fields, including required values and conditional alternatives.
Machine-readable version of this page: https://www.meykt.com/developers/webhooks.md