{"openapi":"3.1.0","info":{"title":"Rylix Fleet API","version":"1.0.0","description":"Create and follow Rylix deliveries from your own website, POS or ERP, and receive signed webhooks when an order's status changes."},"servers":[{"url":"https://connect.rylixfleet.com","description":"Production"}],"security":[{"bearerAuth":[]}],"x-rylix-rate-limit":{"requests":120,"windowSeconds":60},"x-rylix-scopes":["orders:read","orders:write","locations:read","locations:write","webhooks:manage"],"paths":{"/api/v1/orders":{"get":{"operationId":"listOrders","summary":"List orders","description":"Newest first. Cursor pagination: pass `nextCursor` as `cursor`.","x-rylix-scope":"orders:read","parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Comma-separated statuses: pending, assigned, picked_up, on_the_way, arrived, delivered, failed, returning, returned, cancelled."},{"name":"created_from","in":"query","schema":{"type":"string"},"description":"ISO 8601 date-time, or YYYY-MM-DD (a calendar day in the business's time zone)."},{"name":"created_to","in":"query","schema":{"type":"string"},"description":"ISO 8601 date-time (inclusive), or YYYY-MM-DD (the whole day)."},{"name":"reference","in":"query","schema":{"type":"string"},"description":"Your own order reference, exact match."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of orders.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"},"example":{"object":"list","data":[{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"order","reference":"WEB-10042","orderName":"WEB-10042","trackingNumber":"RX1234567","trackingUrl":"https://track.rylixfleet.com/t/Zx8k2mQ4pL9vB7nR","status":"pending","kind":"delivery","source":"api","customer":{"name":"Rana Haddad","phone":"+96170123456"},"address":{"text":"Hamra St, Bldg 12, 3rd floor","lat":33.8959,"lng":35.4787},"pickupLocationId":"cm4w5q9yz0000s8z0l0c4t1on","note":"Call on arrival","cashOnDelivery":{"amount":"25.00","currency":"USD"},"items":[{"title":"Running shoes","quantity":1,"unitPrice":"25.00"}],"pieces":1,"failureCategory":null,"etaMinutes":null,"createdAt":"2026-11-29T09:30:00.000Z","updatedAt":"2026-11-29T09:30:00.000Z","terminalAt":null,"rescheduled":{"active":false,"until":null,"count":0,"lastAt":null}}],"hasMore":false,"nextCursor":null}}}},"400":{"description":"A filter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}},"post":{"operationId":"createOrder","summary":"Create an order","description":"Creates a delivery exactly as the dashboard's order form does: the customer is saved, dispatch starts at once. Coordinates are required. Without `pickupLocationId` the business's default pickup location is used.","x-rylix-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"},"example":{"reference":"WEB-10042","customer":{"name":"Rana Haddad","phone":"+96170123456"},"address":{"text":"Hamra St, Bldg 12, 3rd floor","lat":33.8959,"lng":35.4787},"cashOnDelivery":{"amount":"25.00","currency":"USD"},"note":"Call on arrival","items":[{"title":"Running shoes","quantity":1,"unitPrice":"25.00"}]}}}},"responses":{"200":{"description":"An earlier request with the same Idempotency-Key created this order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"201":{"description":"The order was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"order","reference":"WEB-10042","orderName":"WEB-10042","trackingNumber":"RX1234567","trackingUrl":"https://track.rylixfleet.com/t/Zx8k2mQ4pL9vB7nR","status":"pending","kind":"delivery","source":"api","customer":{"name":"Rana Haddad","phone":"+96170123456"},"address":{"text":"Hamra St, Bldg 12, 3rd floor","lat":33.8959,"lng":35.4787},"pickupLocationId":"cm4w5q9yz0000s8z0l0c4t1on","note":"Call on arrival","cashOnDelivery":{"amount":"25.00","currency":"USD"},"items":[{"title":"Running shoes","quantity":1,"unitPrice":"25.00"}],"pieces":1,"failureCategory":null,"etaMinutes":null,"createdAt":"2026-11-29T09:30:00.000Z","updatedAt":"2026-11-29T09:30:00.000Z","terminalAt":null,"rescheduled":{"active":false,"until":null,"count":0,"lastAt":null}}}}},"400":{"description":"A field is missing or not valid (see `fields`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"409":{"description":"An order with this reference exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"duplicate_reference","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"422":{"description":"The Idempotency-Key was used with another request (idempotency_key_reused), the pickup location is inactive (location_inactive), or — delivery agencies — the client is paused (client_paused) or its rate card does not serve the order (not_served, with `fields.reason`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_key_reused","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/orders/{id}":{"get":{"operationId":"getOrder","summary":"Get an order","x-rylix-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The order id."}],"responses":{"200":{"description":"The order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"order","reference":"WEB-10042","orderName":"WEB-10042","trackingNumber":"RX1234567","trackingUrl":"https://track.rylixfleet.com/t/Zx8k2mQ4pL9vB7nR","status":"pending","kind":"delivery","source":"api","customer":{"name":"Rana Haddad","phone":"+96170123456"},"address":{"text":"Hamra St, Bldg 12, 3rd floor","lat":33.8959,"lng":35.4787},"pickupLocationId":"cm4w5q9yz0000s8z0l0c4t1on","note":"Call on arrival","cashOnDelivery":{"amount":"25.00","currency":"USD"},"items":[{"title":"Running shoes","quantity":1,"unitPrice":"25.00"}],"pieces":1,"failureCategory":null,"etaMinutes":null,"createdAt":"2026-11-29T09:30:00.000Z","updatedAt":"2026-11-29T09:30:00.000Z","terminalAt":null,"rescheduled":{"active":false,"until":null,"count":0,"lastAt":null}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such order in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/orders/{id}/cancel":{"post":{"operationId":"cancelOrder","summary":"Cancel an order","description":"Cancels an order that is not delivered, failed, returned or cancelled yet.","x-rylix-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The order id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours."}],"responses":{"200":{"description":"The cancelled order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"},"example":{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"order","reference":"WEB-10042","orderName":"WEB-10042","trackingNumber":"RX1234567","trackingUrl":"https://track.rylixfleet.com/t/Zx8k2mQ4pL9vB7nR","status":"cancelled","kind":"delivery","source":"api","customer":{"name":"Rana Haddad","phone":"+96170123456"},"address":{"text":"Hamra St, Bldg 12, 3rd floor","lat":33.8959,"lng":35.4787},"pickupLocationId":"cm4w5q9yz0000s8z0l0c4t1on","note":"Call on arrival","cashOnDelivery":{"amount":"25.00","currency":"USD"},"items":[{"title":"Running shoes","quantity":1,"unitPrice":"25.00"}],"pieces":1,"failureCategory":null,"etaMinutes":null,"createdAt":"2026-11-29T09:30:00.000Z","updatedAt":"2026-11-29T09:30:00.000Z","terminalAt":null,"rescheduled":{"active":false,"until":null,"count":0,"lastAt":null}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such order in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"409":{"description":"The order is already finished.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_state","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/orders/{id}/tracking":{"get":{"operationId":"getOrderTracking","summary":"Order status and tracking link","x-rylix-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The order id."}],"responses":{"200":{"description":"The status, the customer's tracking link and the status timeline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tracking"},"example":{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"tracking","status":"on_the_way","trackingNumber":"RX1234567","trackingUrl":"https://track.rylixfleet.com/t/Zx8k2mQ4pL9vB7nR","etaMinutes":12,"failureCategory":null,"updatedAt":"2026-11-29T10:05:00.000Z","events":[{"type":"order.created","at":"2026-11-29T09:30:00.000Z"},{"type":"order.assigned","at":"2026-11-29T09:31:10.000Z"},{"type":"order.picked_up","at":"2026-11-29T09:52:40.000Z"},{"type":"order.on_the_way","at":"2026-11-29T09:53:00.000Z"}]}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such order in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/locations":{"get":{"operationId":"listLocations","summary":"List pickup locations","x-rylix-scope":"locations:read","responses":{"200":{"description":"Every pickup location of the business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationList"},"example":{"object":"list","data":[{"id":"cm4w5q9yz0000s8z0l0c4t1on","object":"location","name":"Main store","address":"Mar Mikhael, Armenia St","lat":33.8969,"lng":35.5226,"isDefault":true,"kind":"branch","active":true,"phone":"+9611234567","hours":{"week":{"mon":[["09:00","23:00"]]}},"parentBranchId":null,"createdAt":"2026-11-01T08:00:00.000Z"}]}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}},"post":{"operationId":"createLocation","summary":"Create a pickup location","description":"The business's first location becomes its default, so it must be an active branch. Branch fields (`kind`, `active`, `phone`, `hours`, `parentBranchId`) are optional: without them the location is an active branch. API keys are organization-wide: a key reads and creates every branch.","x-rylix-scope":"locations:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationCreate"},"example":{"name":"Main store","address":"Mar Mikhael, Armenia St","lat":33.8969,"lng":35.5226,"phone":"01 234 567","hours":{"week":{"mon":[["09:00","23:00"]]}}}}}},"responses":{"201":{"description":"The location was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Location"},"example":{"id":"cm4w5q9yz0000s8z0l0c4t1on","object":"location","name":"Main store","address":"Mar Mikhael, Armenia St","lat":33.8969,"lng":35.5226,"isDefault":true,"kind":"branch","active":true,"phone":"+9611234567","hours":{"week":{"mon":[["09:00","23:00"]]}},"parentBranchId":null,"createdAt":"2026-11-01T08:00:00.000Z"}}}},"400":{"description":"A field is missing or not valid (`fields` names each one). Branch fields: `kind`, `active`, `phone`, `hours` or `parentBranchId` is `invalid` (a parent must be a branch of this business and is only for a `client_pickup`); the business's first location answers `kind: first_location_must_be_branch` or `active: default_must_be_active`. Nothing is created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","x-rylix-scope":"webhooks:manage","responses":{"200":{"description":"The business's webhook endpoints (never their secrets).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"},"example":{"object":"list","data":[{"id":"cm4w5s7ab0002s8z0w3bh00k1","object":"webhook_endpoint","url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"],"enabled":true,"disabledReason":null,"consecutiveFailures":0,"lastSuccessAt":null,"lastFailureAt":null,"createdAt":"2026-11-29T09:00:00.000Z","conditions":[{"field":"order.payment","op":"eq","value":"cod"}],"fields":{},"headers":[{"name":"X-Api-Key","preview":"••••9f3a"}],"timeoutMs":10000,"filteredToday":0}]}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}},"post":{"operationId":"createWebhookEndpoint","summary":"Register a webhook endpoint","description":"HTTPS on a public host only. The signing `secret` is in this answer only: store it. Options (conditions, fields, headers, timeoutMs) are optional; left out, the endpoint receives every subscribed event with the default fields, no custom headers and a 10-second timeout.","x-rylix-scope":"webhooks:manage","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255},"description":"Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"},"example":{"url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"]}}}},"responses":{"201":{"description":"The endpoint, with its signing secret (shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"},"example":{"id":"cm4w5s7ab0002s8z0w3bh00k1","object":"webhook_endpoint","url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"],"enabled":true,"disabledReason":null,"consecutiveFailures":0,"lastSuccessAt":null,"lastFailureAt":null,"createdAt":"2026-11-29T09:00:00.000Z","conditions":[{"field":"order.payment","op":"eq","value":"cod"}],"fields":{},"headers":[{"name":"X-Api-Key","preview":"••••9f3a"}],"timeoutMs":10000,"filteredToday":0,"secret":"whsec_…"}}}},"400":{"description":"The URL or the events are not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"409":{"description":"The business has the most endpoints allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"too_many_endpoints","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"422":{"description":"invalid_condition, invalid_fields, invalid_header or invalid_timeout (see fields).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_condition","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/webhook-endpoints/{id}":{"get":{"operationId":"getWebhookEndpoint","summary":"Read a webhook endpoint","x-rylix-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."}],"responses":{"200":{"description":"The endpoint with its options and never-match warnings (never its secret or a header value).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"},"example":{"id":"cm4w5s7ab0002s8z0w3bh00k1","object":"webhook_endpoint","url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"],"enabled":true,"disabledReason":null,"consecutiveFailures":0,"lastSuccessAt":null,"lastFailureAt":null,"createdAt":"2026-11-29T09:00:00.000Z","conditions":[{"field":"order.payment","op":"eq","value":"cod"}],"fields":{},"headers":[{"name":"X-Api-Key","preview":"••••9f3a"}],"timeoutMs":10000,"filteredToday":0,"warnings":[]}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such endpoint in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}},"patch":{"operationId":"updateWebhookEndpoint","summary":"Change a webhook endpoint","description":"Only the keys you send change. A new `url` is checked like a new endpoint and keeps the signing secret. Headers: `set` adds or replaces values, `remove` drops names; values are never returned.","x-rylix-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"},"example":{"conditions":[{"field":"order.payment","op":"eq","value":"cod"},{"field":"order.branch","op":"in","value":["cm4w5r2xk0009s8z0loc00001"]}],"fields":{"order_status":["order.status","order.trackingNumber","order.cashOnDelivery"]},"headers":{"set":[{"name":"X-Api-Key","value":"your-receiver-key"}],"remove":[]},"timeoutMs":15000}}}},"responses":{"200":{"description":"The endpoint after the change, with never-match warnings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"},"example":{"id":"cm4w5s7ab0002s8z0w3bh00k1","object":"webhook_endpoint","url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"],"enabled":true,"disabledReason":null,"consecutiveFailures":0,"lastSuccessAt":null,"lastFailureAt":null,"createdAt":"2026-11-29T09:00:00.000Z","conditions":[{"field":"order.payment","op":"eq","value":"cod"}],"fields":{},"headers":[{"name":"X-Api-Key","preview":"••••9f3a"}],"timeoutMs":15000,"filteredToday":0,"warnings":[]}}}},"400":{"description":"The URL, events or description are not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such endpoint in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"409":{"description":"The stored header values can no longer be read: set every header again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"headers_unavailable","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"422":{"description":"invalid_condition, invalid_fields, invalid_header or invalid_timeout (see fields).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_condition","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete a webhook endpoint","x-rylix-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."}],"responses":{"204":{"description":"Deleted, with its pending deliveries."},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such endpoint in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/webhook-endpoints/{id}/test":{"post":{"operationId":"sendWebhookTest","summary":"Send a test event","description":"Sends the fixture event of `type` (never your real data) to the endpoint now, signed with its secret, with its custom headers and timeout, marked `\"test\": true` and `Rylix-Test: 1`. One attempt, never retried, never counted toward auto-disable. 10 per endpoint and 30 per business per rolling hour.","x-rylix-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed","order.unassigned","order.reassigned","order.attempt_failed","order.redelivery_scheduled","order.pieces_scanned","order.proof_added","order.change_requested","order.change_declined","order.phone_updated","order.rated","order.cash_collected","settlement.submitted","settlement.confirmed","settlement.rejected","return.started","return.received","order.exchange_created","order.linked_created","remittance.ready","remittance.confirmed","remittance.disputed","location.created","location.updated","driver.shift_started","driver.shift_ended"]}}},"example":{"type":"order.delivered"}}}},"responses":{"200":{"description":"What your endpoint answered (the test is logged as a test delivery).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"},"example":{"object":"webhook_test","id":"cm4w5u9ef0004s8z0t3s7x8y9","eventId":"evt_test_4fJk2LmN8pQr5sTu7vWx9yZa","type":"order.delivered","statusCode":200,"durationMs":184,"errorCode":null}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such endpoint in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"409":{"description":"The endpoint is disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"endpoint_disabled","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"422":{"description":"The endpoint is not subscribed to this type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_event","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Too many test sends in the last hour (Retry-After), or the key's rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/webhook-endpoints/{id}/preview":{"get":{"operationId":"previewWebhookEvent","summary":"Preview an event body","description":"The exact JSON body a test send of `type` would carry for this endpoint (fixture data, after its field selection). No network call, no signature.","x-rylix-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."},{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed","order.unassigned","order.reassigned","order.attempt_failed","order.redelivery_scheduled","order.pieces_scanned","order.proof_added","order.change_requested","order.change_declined","order.phone_updated","order.rated","order.cash_collected","settlement.submitted","settlement.confirmed","settlement.rejected","return.started","return.received","order.exchange_created","order.linked_created","remittance.ready","remittance.confirmed","remittance.disputed","location.created","location.updated","driver.shift_started","driver.shift_ended"]},"description":"The event type to preview."}],"responses":{"200":{"description":"The body, and conditions that can never match this type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPreview"},"example":{"object":"webhook_preview","body":{"id":"evt_test_4fJk2LmN8pQr5sTu7vWx9yZa","type":"order.delivered","createdAt":"2026-11-30T09:00:00.000Z","test":true,"data":{"order":{"id":"ord_test_000000000000000000","object":"order","status":"delivered"}}},"warnings":[]}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"404":{"description":"No such endpoint in this business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"422":{"description":"Not a webhook event type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_event","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/webhook-catalog":{"get":{"operationId":"getWebhookCatalog","summary":"The webhook option catalog","description":"Event groups, event families and their approved fields, condition fields and operators, header rules, timeout bounds and test limits: everything needed to build an endpoint editor.","x-rylix-scope":"webhooks:manage","responses":{"200":{"description":"The catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCatalog"}}}},"401":{"description":"Missing, malformed, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"403":{"description":"insufficient_scope, feature_off, or (writes) suspended or read_only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_scope","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}},"429":{"description":"Rate limit reached for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"…","requestId":"req_3kTq0yXzv1n5aB2c"}}}}}}}},"/api/v1/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This document","security":[],"responses":{"200":{"description":"The OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"webhooks":{"orderEvent":{"post":{"summary":"An event","description":"POSTed to each enabled endpoint subscribed to the event. Verify `Rylix-Signature` (t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>) and refuse timestamps more than 300 seconds old. Answer 2xx within the endpoint's timeout (10 seconds by default, 1–15 configurable); anything else is retried with exponential backoff (8 attempts). Deduplicate by `id`.","parameters":[{"name":"Rylix-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Rylix-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Rylix-Event-Type","in":"header","required":true,"schema":{"type":"string"}},{"name":"Rylix-Test","in":"header","required":false,"schema":{"type":"string","enum":["1"]},"description":"Present on test sends only."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"evt_cm4w5t1cd0003s8z0e7v3n4t5","type":"order.failed","createdAt":"2026-11-29T11:02:00.000Z","data":{"order":{"id":"cm4w5r2xk0001s8z0a1b2c3d4","object":"order","reference":"WEB-10042","orderName":"WEB-10042","trackingNumber":"RX1234567","status":"failed","kind":"delivery","source":"api","pickupLocationId":"cm4w5q9yz0000s8z0l0c4t1on","cashOnDelivery":{"amount":"25.00","currency":"USD"},"pieces":1,"failureCategory":"no_answer","etaMinutes":null,"createdAt":"2026-11-29T09:30:00.000Z","updatedAt":"2026-11-29T09:30:00.000Z","terminalAt":null},"failureCategory":"no_answer"}}}}},"responses":{"200":{"description":"Received."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key from Settings → Developers: Authorization: Bearer rxk_… . Keep it on your server."}},"schemas":{"Error":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["code","message","requestId"],"additionalProperties":false,"properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}},"requestId":{"type":"string"}}}}},"Order":{"type":"object","additionalProperties":false,"required":["id","object","reference","orderName","trackingNumber","trackingUrl","status","kind","source","customer","address","pickupLocationId","note","cashOnDelivery","items","pieces","failureCategory","etaMinutes","createdAt","updatedAt","terminalAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["order"]},"reference":{"type":["string","null"]},"orderName":{"type":"string"},"trackingNumber":{"type":"string"},"trackingUrl":{"type":"string"},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"kind":{"type":"string","enum":["delivery","return"]},"source":{"type":"string","enum":["shopify","manual","csv","return","api"]},"customer":{"type":"object","additionalProperties":false,"required":["name","phone"],"properties":{"name":{"type":"string"},"phone":{"type":["string","null"]}}},"address":{"type":"object","additionalProperties":false,"required":["text","lat","lng"],"properties":{"text":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]}}},"pickupLocationId":{"type":["string","null"]},"note":{"type":["string","null"]},"cashOnDelivery":{"type":["object","null"],"additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"string"},"currency":{"type":"string","enum":["USD","LBP"]}}},"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["title","quantity","unitPrice"],"properties":{"title":{"type":"string"},"quantity":{"type":"integer"},"unitPrice":{"type":["string","null"]}}}},"pieces":{"type":"integer","minimum":1},"failureCategory":{"type":["string","null"]},"etaMinutes":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"terminalAt":{"type":["string","null"],"format":"date-time"},"rescheduled":{"type":"object","additionalProperties":false,"required":["active","until","count","lastAt"],"description":"Spec 048. Additive (absent from responses before this release): the Rescheduled display status and the permanent mark. `status` never takes a `rescheduled` value. `active` while the order was moved to a later day that has not started and it is not yet picked up; `until` is that day's start (null when not active); `count` how many times it was moved to a later day; `lastAt` the last such move.","properties":{"active":{"type":"boolean"},"until":{"type":["string","null"],"format":"date-time"},"count":{"type":"integer","minimum":0},"lastAt":{"type":["string","null"],"format":"date-time"}}}}},"OrderCreate":{"type":"object","required":["customer","address"],"properties":{"reference":{"type":"string","maxLength":64,"description":"Your own order number. Must be unique in the business."},"customer":{"type":"object","required":["name","phone"],"properties":{"name":{"type":"string"},"phone":{"type":"string","description":"International (+961…) or local to the business's country."}}},"address":{"type":"object","required":["text","lat","lng"],"properties":{"text":{"type":"string"},"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}}},"pickupLocationId":{"type":"string"},"clientId":{"type":"string","description":"Delivery agencies: the client the order is for (its client card id). Without it (and without clientCode) the pickup location's client is used, else the agency's walk-in client. Unknown or archived: 400 with fields.clientId = client_not_found."},"clientCode":{"type":"string","description":"Delivery agencies: the client's short code, instead of clientId (not both)."},"cashOnDelivery":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"string","description":"Decimal, e.g. \"25.00\"."},"currency":{"type":"string","enum":["USD","LBP"]}}},"note":{"type":"string"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["title","quantity"],"properties":{"title":{"type":"string"},"quantity":{"type":"integer","minimum":1,"maximum":999},"unitPrice":{"type":"string"}}}},"pieces":{"type":"integer","minimum":1,"maximum":50}}},"OrderList":{"type":"object","additionalProperties":false,"required":["object","data","hasMore","nextCursor"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}}},"Tracking":{"type":"object","additionalProperties":false,"required":["id","object","status","trackingNumber","trackingUrl","etaMinutes","failureCategory","updatedAt","events"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["tracking"]},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"trackingNumber":{"type":"string"},"trackingUrl":{"type":"string"},"etaMinutes":{"type":["integer","null"]},"failureCategory":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time"},"events":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type","at"],"properties":{"type":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed"]},"at":{"type":"string","format":"date-time"}}}}}},"Location":{"type":"object","additionalProperties":false,"required":["id","object","name","address","lat","lng","isDefault","createdAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["location"]},"name":{"type":"string"},"address":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"isDefault":{"type":"boolean"},"kind":{"type":"string","enum":["branch","client_pickup"],"description":"A branch of the business, or a pickup point of one of its clients."},"active":{"type":"boolean","description":"Inactive locations take no new orders (422 location_inactive)."},"phone":{"type":["string","null"],"description":"The branch's phone (E.164)."},"hours":{"description":"Opening hours in the business's time zone: `{ week: { mon: [[\"09:00\",\"23:00\"]] }, closed: [\"2026-12-25\"] }`, or null. Informational."},"parentBranchId":{"type":["string","null"],"description":"A client pickup point's handling branch (its orders count as that branch's); null: the default branch handles it."},"createdAt":{"type":"string","format":"date-time"}}},"LocationCreate":{"type":"object","required":["name","lat","lng"],"properties":{"name":{"type":"string","maxLength":80},"address":{"type":"string"},"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"kind":{"type":"string","enum":["branch","client_pickup"],"default":"branch","description":"The business's first location must be a branch (it becomes the default)."},"active":{"type":"boolean","default":true,"description":"Inactive locations take no new orders. The first location must be active."},"phone":{"type":["string","null"],"description":"The branch's phone, stored as E.164 (local numbers use the business's country)."},"hours":{"description":"Opening hours: `{ week: { mon: [[\"09:00\",\"23:00\"]] }, closed: [\"2026-12-25\"] }` (days mon–sun, HH:MM ranges, an end before the start runs past midnight), or null."},"parentBranchId":{"type":["string","null"],"description":"Only for `kind: client_pickup`: a branch of this business that handles it."}}},"LocationList":{"type":"object","additionalProperties":false,"required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}},"WebhookEndpoint":{"type":"object","additionalProperties":false,"required":["id","object","url","description","events","enabled","disabledReason","consecutiveFailures","lastSuccessAt","lastFailureAt","createdAt","conditions","fields","headers","timeoutMs","filteredToday"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["webhook_endpoint"]},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed","order.unassigned","order.reassigned","order.attempt_failed","order.redelivery_scheduled","order.pieces_scanned","order.proof_added","order.change_requested","order.change_declined","order.phone_updated","order.rated","order.cash_collected","settlement.submitted","settlement.confirmed","settlement.rejected","return.started","return.received","order.exchange_created","order.linked_created","remittance.ready","remittance.confirmed","remittance.disputed","location.created","location.updated","driver.shift_started","driver.shift_ended"]}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"consecutiveFailures":{"type":"integer"},"lastSuccessAt":{"type":["string","null"],"format":"date-time"},"lastFailureAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"conditions":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/WebhookCondition"},"description":"All must hold; empty: every subscribed event."},"fields":{"$ref":"#/components/schemas/WebhookFields"},"headers":{"type":"array","maxItems":5,"description":"Custom header names with a masked tail. Values are never returned.","items":{"type":"object","additionalProperties":false,"required":["name","preview"],"properties":{"name":{"type":"string"},"preview":{"type":"string"}}}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":15000,"default":10000,"description":"How long Rylix waits for your answer's status, in milliseconds: one deadline for the whole request (connecting included). The response body is never read."},"filteredToday":{"type":"integer","minimum":0,"description":"Events the conditions filtered out today (since local midnight in the business's time zone)."},"warnings":{"type":"array","description":"Subscribed events a condition can never match (for example an order condition on a settlement event).","items":{"type":"object","additionalProperties":false,"required":["event","index","field"],"properties":{"event":{"type":"string"},"index":{"type":"integer","minimum":0},"field":{"type":"string"}}}},"secret":{"type":["string","null"],"description":"Only in the answer that creates the endpoint (null on an Idempotency-Key replay)."}}},"WebhookCondition":{"type":"object","additionalProperties":false,"required":["field","op","value"],"description":"One condition from the fixed catalog (GET /api/v1/webhook-catalog): enum and id fields take eq, neq, in, not_in (lists of 1–50); money takes gt, gte, lt, lte ({ amount, currency }) or between ({ min, max, currency }), compared in integer minor units in that currency only; booleans take is. A condition on a fact the event does not have never matches. No free text, no expressions.","properties":{"field":{"type":"string","enum":["order.payment","order.cod_amount","order.branch","order.pickup_location","order.client","order.account","order.service","order.kind","order.source","order.urgent","order.failure_category","order.status","driver.group","money.currency"]},"op":{"type":"string","enum":["eq","neq","in","not_in","gt","gte","lt","lte","between","is"]},"value":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string"}},{"type":"object","additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"string","description":"Decimal text: USD up to 2 decimals, LBP whole."},"currency":{"type":"string","enum":["USD","LBP"]}}},{"type":"object","additionalProperties":false,"required":["min","max","currency"],"properties":{"min":{"type":"string"},"max":{"type":"string"},"currency":{"type":"string","enum":["USD","LBP"]}}}]}}},"WebhookFields":{"type":"object","additionalProperties":false,"description":"Field selection per event family. A family left out sends every approved field (the default). An empty list sends only the ids. The subject's id and object, and the envelope, are always sent; no customer field can be chosen.","properties":{"order_status":{"type":"array","items":{"type":"string","enum":["order.reference","order.orderName","order.trackingNumber","order.status","order.kind","order.source","order.pickupLocationId","order.cashOnDelivery","order.pieces","order.failureCategory","order.etaMinutes","order.createdAt","order.updatedAt","order.terminalAt","failureCategory"]}},"order_summary":{"type":"array","items":{"type":"string","enum":["order.reference","order.orderName","order.trackingNumber","order.status","order.kind","order.updatedAt"]}},"settlement":{"type":"array","items":{"type":"string","enum":["settlement.driverId","settlement.status","settlement.period","settlement.day","settlement.submitted","settlement.expected","settlement.confirmed","settlement.difference","settlement.submittedAt","settlement.decidedAt"]}},"location":{"type":"array","items":{"type":"string","enum":["location.name","location.address","location.lat","location.lng","location.isDefault","location.kind","location.active","location.phone","location.hours","location.parentBranchId","location.createdAt"]}},"driver":{"type":"array","items":{"type":"string","enum":["shift.driverId","shift.startedAt","shift.endedAt"]}},"remittance":{"type":"array","items":{"type":"string","enum":["remittance.clientId","remittance.number","remittance.status","remittance.currency","remittance.cutoffAt","remittance.grossCod","remittance.adjustments","remittance.feesNetted","remittance.remittanceFee","remittance.net","remittance.amountHanded","remittance.receiptMethod","remittance.readyAt","remittance.confirmedAt"]}}}},"WebhookEndpointUpdate":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","format":"uri"},"description":{"type":["string","null"],"maxLength":200},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed","order.unassigned","order.reassigned","order.attempt_failed","order.redelivery_scheduled","order.pieces_scanned","order.proof_added","order.change_requested","order.change_declined","order.phone_updated","order.rated","order.cash_collected","settlement.submitted","settlement.confirmed","settlement.rejected","return.started","return.received","order.exchange_created","order.linked_created","remittance.ready","remittance.confirmed","remittance.disputed","location.created","location.updated","driver.shift_started","driver.shift_ended"]}},"conditions":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/WebhookCondition"}},"fields":{"$ref":"#/components/schemas/WebhookFields"},"headers":{"type":"object","additionalProperties":false,"properties":{"set":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["name","value"],"properties":{"name":{"type":"string","minLength":1,"maxLength":64},"value":{"type":"string","minLength":1,"maxLength":1024}}}},"remove":{"type":"array","items":{"type":"string"}}}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":15000,"default":10000,"description":"How long Rylix waits for your answer's status, in milliseconds: one deadline for the whole request (connecting included). The response body is never read."}}},"WebhookTestResult":{"type":"object","additionalProperties":false,"required":["object","id","eventId","type","statusCode","durationMs","errorCode"],"properties":{"object":{"type":"string","enum":["webhook_test"]},"id":{"type":"string","description":"The logged test delivery."},"eventId":{"type":"string"},"type":{"type":"string"},"statusCode":{"type":["integer","null"]},"durationMs":{"type":"integer","minimum":0},"errorCode":{"type":["string","null"],"description":"Null on 2xx; else http_<status>, timeout, network, blocked_address, secret_unavailable or headers_unavailable."}}},"WebhookPreview":{"type":"object","additionalProperties":false,"required":["object","body","warnings"],"properties":{"object":{"type":"string","enum":["webhook_preview"]},"body":{"$ref":"#/components/schemas/WebhookEvent"},"warnings":{"type":"array","description":"Subscribed events a condition can never match (for example an order condition on a settlement event).","items":{"type":"object","additionalProperties":false,"required":["event","index","field"],"properties":{"event":{"type":"string"},"index":{"type":"integer","minimum":0},"field":{"type":"string"}}}}}},"WebhookCatalog":{"type":"object","additionalProperties":false,"required":["object","eventGroups","families","conditions","headers","timeoutMs","tests"],"properties":{"object":{"type":"string","enum":["webhook_catalog"]},"eventGroups":{"type":"array","items":{"type":"object"}},"families":{"type":"array","items":{"type":"object"}},"conditions":{"type":"object"},"headers":{"type":"object"},"timeoutMs":{"type":"object"},"tests":{"type":"object"}}},"WebhookEndpointCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","required":["secret"],"properties":{"secret":{"type":["string","null"],"description":"The signing secret. Null on an Idempotency-Key replay: it is shown once."}}}]},"WebhookEndpointCreate":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"description":{"type":"string","maxLength":200},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed","order.unassigned","order.reassigned","order.attempt_failed","order.redelivery_scheduled","order.pieces_scanned","order.proof_added","order.change_requested","order.change_declined","order.phone_updated","order.rated","order.cash_collected","settlement.submitted","settlement.confirmed","settlement.rejected","return.started","return.received","order.exchange_created","order.linked_created","remittance.ready","remittance.confirmed","remittance.disputed","location.created","location.updated","driver.shift_started","driver.shift_ended"]}},"conditions":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/WebhookCondition"}},"fields":{"$ref":"#/components/schemas/WebhookFields"},"headers":{"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["name","value"],"properties":{"name":{"type":"string","minLength":1,"maxLength":64},"value":{"type":"string","minLength":1,"maxLength":1024}}}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":15000,"default":10000,"description":"How long Rylix waits for your answer's status, in milliseconds: one deadline for the whole request (connecting included). The response body is never read."}}},"WebhookEndpointList":{"type":"object","additionalProperties":false,"required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"OrderSummary":{"type":"object","additionalProperties":false,"required":["id","object","reference","orderName","trackingNumber","status","kind","updatedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["order"]},"reference":{"type":["string","null"]},"orderName":{"type":"string"},"trackingNumber":{"type":"string"},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"kind":{"type":"string","enum":["delivery","return"]},"updatedAt":{"type":"string","format":"date-time"}}},"WebhookOrder":{"type":"object","additionalProperties":false,"description":"The order in an order status event. No customer personal data (name, phone, address, coordinates, note), no order lines and no tracking link: fetch GET /api/v1/orders/{id} with a key that has orders:read when you need them.","required":["id","object","reference","orderName","trackingNumber","status","kind","source","pickupLocationId","cashOnDelivery","pieces","failureCategory","etaMinutes","createdAt","updatedAt","terminalAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["order"]},"reference":{"type":["string","null"]},"orderName":{"type":"string"},"trackingNumber":{"type":"string"},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"kind":{"type":"string","enum":["delivery","return"]},"source":{"type":"string","enum":["shopify","manual","csv","return","api"]},"pickupLocationId":{"type":["string","null"]},"cashOnDelivery":{"type":["object","null"],"additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"string"},"currency":{"type":"string","enum":["USD","LBP"]}}},"pieces":{"type":"integer","minimum":1},"failureCategory":{"type":["string","null"]},"etaMinutes":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"terminalAt":{"type":["string","null"],"format":"date-time"}}},"WebhookOrderProjected":{"type":"object","additionalProperties":false,"description":"The order in an order status event. No customer personal data (name, phone, address, coordinates, note), no order lines and no tracking link: fetch GET /api/v1/orders/{id} with a key that has orders:read when you need them.","required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["order"]},"reference":{"type":["string","null"]},"orderName":{"type":"string"},"trackingNumber":{"type":"string"},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"kind":{"type":"string","enum":["delivery","return"]},"source":{"type":"string","enum":["shopify","manual","csv","return","api"]},"pickupLocationId":{"type":["string","null"]},"cashOnDelivery":{"type":["object","null"],"additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"string"},"currency":{"type":"string","enum":["USD","LBP"]}}},"pieces":{"type":"integer","minimum":1},"failureCategory":{"type":["string","null"]},"etaMinutes":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"terminalAt":{"type":["string","null"],"format":"date-time"}}},"WebhookOrderSummary":{"type":"object","additionalProperties":false,"required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["order"]},"reference":{"type":["string","null"]},"orderName":{"type":"string"},"trackingNumber":{"type":"string"},"status":{"type":"string","enum":["pending","assigned","picked_up","on_the_way","arrived","delivered","failed","returning","returned","cancelled"]},"kind":{"type":"string","enum":["delivery","return"]},"updatedAt":{"type":"string","format":"date-time"}}},"WebhookSettlement":{"type":"object","additionalProperties":false,"description":"A driver's cash hand-over. Amounts per currency; the driver is named by id only.","required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["settlement"]},"driverId":{"type":"string"},"status":{"type":"string","enum":["pending","confirmed","rejected"]},"period":{"type":"string","enum":["shift","day","orders"]},"day":{"type":"string","description":"Business-local date, YYYY-MM-DD."},"submitted":{"type":"object","additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"expected":{"type":"object","additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"confirmed":{"type":["object","null"],"additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"difference":{"type":["object","null"],"additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}},"description":"Confirmed minus expected (negative: short). Null until confirmed."},"submittedAt":{"type":"string","format":"date-time"},"decidedAt":{"type":["string","null"],"format":"date-time"}}},"WebhookShift":{"type":"object","additionalProperties":false,"description":"A driver's shift. Never a location.","required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["shift"]},"driverId":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}},"WebhookLocation":{"type":"object","additionalProperties":false,"required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["location"]},"name":{"type":"string"},"address":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"isDefault":{"type":"boolean"},"kind":{"type":"string","enum":["branch","client_pickup"],"description":"A branch of the business, or a pickup point of one of its clients."},"active":{"type":"boolean","description":"Inactive locations take no new orders (422 location_inactive)."},"phone":{"type":["string","null"],"description":"The branch's phone (E.164)."},"hours":{"description":"Opening hours in the business's time zone: `{ week: { mon: [[\"09:00\",\"23:00\"]] }, closed: [\"2026-12-25\"] }`, or null. Informational."},"parentBranchId":{"type":["string","null"],"description":"A client pickup point's handling branch (its orders count as that branch's); null: the default branch handles it."},"createdAt":{"type":"string","format":"date-time"}}},"Settlement":{"type":"object","additionalProperties":false,"description":"A driver's cash hand-over. Amounts per currency; the driver is named by id only.","required":["id","object","driverId","status","period","day","submitted","expected","confirmed","difference","submittedAt","decidedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["settlement"]},"driverId":{"type":"string"},"status":{"type":"string","enum":["pending","confirmed","rejected"]},"period":{"type":"string","enum":["shift","day","orders"]},"day":{"type":"string","description":"Business-local date, YYYY-MM-DD."},"submitted":{"type":"object","additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"expected":{"type":"object","additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"confirmed":{"type":["object","null"],"additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}}},"difference":{"type":["object","null"],"additionalProperties":false,"required":["USD","LBP"],"properties":{"USD":{"type":"string","description":"US dollars, two decimals."},"LBP":{"type":"string","description":"Whole Lebanese pounds."}},"description":"Confirmed minus expected (negative: short). Null until confirmed."},"submittedAt":{"type":"string","format":"date-time"},"decidedAt":{"type":["string","null"],"format":"date-time"}}},"Shift":{"type":"object","additionalProperties":false,"description":"A driver's shift. Never a location.","required":["id","object","driverId","startedAt","endedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["shift"]},"driverId":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"}}},"WebhookRemittance":{"type":"object","additionalProperties":false,"description":"An agency cash box: the COD collected for one client in one currency, paid to that client (spec 041). Amounts are decimal strings in the box's currency (USD with 2 decimals, LBP whole pounds); USD and LBP are never in one box. Never the signer's name, the signature or a receipt note.","required":["id","object"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["remittance"]},"clientId":{"type":"string"},"number":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ready","handed_over","confirmed","disputed","cancelled"]},"currency":{"type":"string","enum":["USD","LBP"]},"cutoffAt":{"type":"string","format":"date-time"},"grossCod":{"type":"string"},"adjustments":{"type":"string"},"feesNetted":{"type":"string"},"remittanceFee":{"type":"string"},"net":{"type":"string"},"amountHanded":{"type":["string","null"]},"receiptMethod":{"type":["string","null"],"enum":["client_code","signature","bank_transfer","wallet","manual",null]},"readyAt":{"type":["string","null"],"format":"date-time"},"confirmedAt":{"type":["string","null"],"format":"date-time"}}},"Remittance":{"type":"object","additionalProperties":false,"description":"An agency cash box: the COD collected for one client in one currency, paid to that client (spec 041). Amounts are decimal strings in the box's currency (USD with 2 decimals, LBP whole pounds); USD and LBP are never in one box. Never the signer's name, the signature or a receipt note.","required":["id","object","clientId","number","status","currency","cutoffAt","grossCod","adjustments","feesNetted","remittanceFee","net","amountHanded","receiptMethod","readyAt","confirmedAt"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["remittance"]},"clientId":{"type":"string"},"number":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ready","handed_over","confirmed","disputed","cancelled"]},"currency":{"type":"string","enum":["USD","LBP"]},"cutoffAt":{"type":"string","format":"date-time"},"grossCod":{"type":"string"},"adjustments":{"type":"string"},"feesNetted":{"type":"string"},"remittanceFee":{"type":"string"},"net":{"type":"string"},"amountHanded":{"type":["string","null"]},"receiptMethod":{"type":["string","null"],"enum":["client_code","signature","bank_transfer","wallet","manual",null]},"readyAt":{"type":["string","null"],"format":"date-time"},"confirmedAt":{"type":["string","null"],"format":"date-time"}}},"WebhookEvent":{"description":"One event. No event carries customer personal data (name, phone, address, coordinates, note). The order status events carry the webhook order; every other event carries its own fields and, when it is about an order, the order summary. Fetch GET /api/v1/orders/{id} for the full order.","oneOf":[{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.created","order.assigned","order.picked_up","order.on_the_way","order.arrived","order.delivered","order.failed","order.returned","order.cancelled","order.rescheduled","order.address_changed"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderProjected"},"failureCategory":{"type":["string","null"]},"dateOnly":{"type":"boolean","description":"order.rescheduled only: true when the new schedule is a whole day with no time window (delivery any time that business day), false for a time window or back to as soon as possible. Absent on events recorded before this field existed."}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.unassigned","order.reassigned","order.phone_updated"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","by"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"by":{"type":"string","enum":["customer","driver","office","api","shopify","system"],"description":"Who did it, as a kind (never a person's id or name)."}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.attempt_failed"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","failureCategory"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"failureCategory":{"type":["string","null"]}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.redelivery_scheduled"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.pieces_scanned"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","via","piece"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"via":{"type":"string","enum":["scan","office"]},"piece":{"type":["integer","null"],"minimum":1}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.proof_added"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","proof"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"proof":{"description":"What was added: proof photos (kind photo, with how many) or the customer's signature at handover (kind signature). Never an image, a link, a hash or the signer's name.","oneOf":[{"type":"object","additionalProperties":false,"required":["kind","count"],"properties":{"kind":{"type":"string","enum":["photo"]},"count":{"type":"integer","minimum":1}}},{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["signature"]}}}]}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.change_requested","order.change_declined"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","changeId","parts","by"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"changeId":{"type":["string","null"]},"parts":{"type":"array","items":{"type":"string","enum":["address","schedule"]}},"by":{"type":"string","enum":["customer","driver","office","api","shopify","system"],"description":"Who did it, as a kind (never a person's id or name)."}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.rated"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","rating"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"rating":{"type":"object","additionalProperties":false,"required":["stars"],"properties":{"stars":{"type":"integer","minimum":1,"maximum":5}}}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.cash_collected"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","cash"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"cash":{"type":"object","additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"}}}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["settlement.submitted","settlement.confirmed","settlement.rejected"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["settlement"],"properties":{"settlement":{"$ref":"#/components/schemas/WebhookSettlement"}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["return.started","return.received"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","return"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"return":{"type":"object","additionalProperties":false,"required":["id","object","originalOrderId"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["return"]},"originalOrderId":{"type":"string"}}}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["order.exchange_created","order.linked_created"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["order","linkType","originalOrderId"],"properties":{"order":{"$ref":"#/components/schemas/WebhookOrderSummary"},"linkType":{"type":"string","enum":["missing_items","exchange"]},"originalOrderId":{"type":["string","null"]}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["location.created","location.updated"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["location"],"properties":{"location":{"$ref":"#/components/schemas/WebhookLocation"}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["driver.shift_started","driver.shift_ended"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["shift"],"properties":{"shift":{"$ref":"#/components/schemas/WebhookShift"}}}}},{"type":"object","additionalProperties":false,"required":["id","type","createdAt","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["remittance.ready","remittance.confirmed","remittance.disputed"]},"createdAt":{"type":"string","format":"date-time"},"test":{"type":"boolean","enum":[true],"description":"Present (true) only on a test send: fixture data, id evt_test_…, header Rylix-Test: 1."},"data":{"type":"object","additionalProperties":false,"required":["remittance"],"properties":{"remittance":{"$ref":"#/components/schemas/WebhookRemittance"}}}}}]}}}}