Create deliveries from your own website, POS or ERP, follow them, and receive a signed webhook each time an order's status changes. For stores and partners that are not on Shopify.
This documentation is in English. An Arabic version is planned.
Getting started
The business owner creates an API key in the Rylix dashboard: Settings > Developers. Choose only the scopes the integration needs. The key is shown once.
Call the API from your server over HTTPS. Never put a key in a browser, a mobile app or a public repository. Revoke a key in Settings > Developers as soon as it may have leaked.
Every request and answer is JSON. Times are ISO 8601 in UTC; amounts are decimal strings.
Base URL
https://connect.rylixfleet.com
Authentication and scopes
Send the key in the Authorization header: Authorization: Bearer rxk_… . A missing, malformed, unknown or revoked key answers 401. A key without the scope an operation needs answers 403 insufficient_scope. While a business is suspended every write answers 403 suspended, and while it is read-only every write answers 403 read_only; reads keep working in both.
Scope
Allows
orders:read
List orders, read one order, its status and tracking link.
orders:write
Create and cancel orders.
locations:read
List pickup locations.
locations:write
Add pickup locations.
webhooks:manage
List, register, change and delete webhook endpoints, send test events and read the option catalog.
Rate limits
Each key may make 120 requests per minute. Every answer carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds). Over the limit the API answers 429 rate_limited with Retry-After.
Errors
Every error has the same shape. `code` is stable and safe to branch on; `message` is for people; `fields` names the request fields that were refused; `requestId` (also in the Request-Id header) helps Rylix support find the request.
JSON
{
"error": {
"code": "invalid_request",
"message": "The request is not valid. See `fields` for details.",
"fields": {
"customer.phone": "invalid"
},
"requestId": "req_3kTq0yXzv1n5aB2c"
}
}
Code
HTTP
Meaning
invalid_request
400
A field or filter is missing or not valid; see fields.
unauthorized
401
No valid API key.
insufficient_scope
403
The key lacks the scope; fields.scope names it.
feature_off
403
The developer API is not on the business's plan.
suspended
403
The business is suspended: writes are refused.
read_only
403
The business is read-only: writes are refused, reads keep working.
plan_limit
403
The plan allows no more orders now.
not_found
404
No such resource in this business.
method_not_allowed
405
The path does not take this method.
duplicate_reference
409
An order with this reference exists.
client_paused
422
Delivery agencies: the client is paused and takes no new orders.
not_served
422
Delivery agencies: the client's rate card does not serve this order.
invalid_state
409
The order is already finished.
idempotency_in_progress
409
The first request with this key is still running.
idempotency_key_reused
422
The key was used with a different request.
rate_limited
429
Too many requests; retry after Retry-After seconds.
internal_error
500
A problem on our side; retry later.
Idempotency
Send an Idempotency-Key header (a UUID) with every POST. If the network fails, send the same request with the same key: you get the first answer back, with Idempotent-Replayed: true, and nothing is done twice. A key is kept 24 hours. Reusing it with a different body answers 422.
Pagination
Lists are newest first. Ask for up to 100 items with limit (25 by default). When hasMore is true, pass nextCursor as cursor to get the next page.
Order statuses
Orders use these public statuses. pending: waiting for a driver. assigned: a driver holds it before pickup. picked_up, on_the_way, arrived: on its way to the customer. delivered, failed, returned, cancelled: finished. returning: being brought back to the store.
Endpoints
GET/api/v1/orders
List orders
Newest first. Cursor pagination: pass `nextCursor` as `cursor`.
Answers: 200 A page of orders. · 400 A filter is not valid. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 429 Rate limit reached for this key.
POST/api/v1/orders
Create an order
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.
Scope: orders:write
Parameters
Name
In
About
Idempotency-Key
header
Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours.
Answers: 200 An earlier request with the same Idempotency-Key created this order. · 201 The order was created. · 400 A field is missing or not valid (see `fields`). · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 409 An order with this reference exists. · 422 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`). · 429 Rate limit reached for this key.
GET/api/v1/orders/{id}
Get an order
Scope: orders:read
Parameters
Name
In
About
id (required)
path
The order id.
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The order. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such order in this business. · 429 Rate limit reached for this key.
POST/api/v1/orders/{id}/cancel
Cancel an order
Cancels an order that is not delivered, failed, returned or cancelled yet.
Scope: orders:write
Parameters
Name
In
About
id (required)
path
The order id.
Idempotency-Key
header
Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours.
curl
curl -X POST "https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4/cancel" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4/cancel", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The cancelled order. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such order in this business. · 409 The order is already finished. · 429 Rate limit reached for this key.
GET/api/v1/orders/{id}/tracking
Order status and tracking link
Scope: orders:read
Parameters
Name
In
About
id (required)
path
The order id.
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4/tracking" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/orders/cm4w5r2xk0001s8z0a1b2c3d4/tracking", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The status, the customer's tracking link and the status timeline. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such order in this business. · 429 Rate limit reached for this key.
GET/api/v1/locations
List pickup locations
Scope: locations:read
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/locations" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/locations", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 Every pickup location of the business. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 429 Rate limit reached for this key.
POST/api/v1/locations
Create a pickup location
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.
Scope: locations:write
Parameters
Name
In
About
Idempotency-Key
header
Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours.
Answers: 201 The location was created. · 400 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. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 429 Rate limit reached for this key.
GET/api/v1/webhook-endpoints
List webhook endpoints
Scope: webhooks:manage
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-endpoints", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The business's webhook endpoints (never their secrets). · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 429 Rate limit reached for this key.
POST/api/v1/webhook-endpoints
Register a webhook endpoint
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.
Scope: webhooks:manage
Parameters
Name
In
About
Idempotency-Key
header
Any unique string (a UUID). Replaying the same request with the same key returns the first answer without doing anything again. Kept 24 hours.
curl
curl -X POST "https://connect.rylixfleet.com/api/v1/webhook-endpoints" \
-H "Authorization: Bearer $RYLIX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"url":"https://example.com/rylix/webhooks","description":"Order status to our ERP","events":["order.delivered","order.failed"]}'
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-endpoints", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
"url": "https://example.com/rylix/webhooks",
"description": "Order status to our ERP",
"events": [
"order.delivered",
"order.failed"
]
}),
});
const data = await response.json();
Answers: 201 The endpoint, with its signing secret (shown once). · 400 The URL or the events are not valid. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 409 The business has the most endpoints allowed. · 422 invalid_condition, invalid_fields, invalid_header or invalid_timeout (see fields). · 429 Rate limit reached for this key.
GET/api/v1/webhook-endpoints/{id}
Read a webhook endpoint
Scope: webhooks:manage
Parameters
Name
In
About
id (required)
path
The endpoint id.
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/webhook-endpoints/cm4w5r2xk0001s8z0a1b2c3d4" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-endpoints/cm4w5r2xk0001s8z0a1b2c3d4", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The endpoint with its options and never-match warnings (never its secret or a header value). · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such endpoint in this business. · 429 Rate limit reached for this key.
PATCH/api/v1/webhook-endpoints/{id}
Change a webhook endpoint
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.
Answers: 200 The endpoint after the change, with never-match warnings. · 400 The URL, events or description are not valid. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such endpoint in this business. · 409 The stored header values can no longer be read: set every header again. · 422 invalid_condition, invalid_fields, invalid_header or invalid_timeout (see fields). · 429 Rate limit reached for this key.
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-endpoints/cm4w5r2xk0001s8z0a1b2c3d4", {
method: "DELETE",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
if (!response.ok) throw await response.json();
Answers: 204 Deleted, with its pending deliveries. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such endpoint in this business. · 429 Rate limit reached for this key.
POST/api/v1/webhook-endpoints/{id}/test
Send a test event
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.
Answers: 200 What your endpoint answered (the test is logged as a test delivery). · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such endpoint in this business. · 409 The endpoint is disabled. · 422 The endpoint is not subscribed to this type. · 429 Too many test sends in the last hour (Retry-After), or the key's rate limit.
GET/api/v1/webhook-endpoints/{id}/preview
Preview an event body
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.
Scope: webhooks:manage
Parameters
Name
In
About
id (required)
path
The endpoint id.
type (required)
query
The event type to preview.
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/webhook-endpoints/cm4w5r2xk0001s8z0a1b2c3d4/preview" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-endpoints/cm4w5r2xk0001s8z0a1b2c3d4/preview", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The body, and conditions that can never match this type. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 404 No such endpoint in this business. · 422 Not a webhook event type. · 429 Rate limit reached for this key.
GET/api/v1/webhook-catalog
The webhook option catalog
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.
Scope: webhooks:manage
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/webhook-catalog" \
-H "Authorization: Bearer $RYLIX_API_KEY"
JavaScript
const apiKey = "rxk_…"; // From Settings > Developers. Keep it on your server.
const response = await fetch("https://connect.rylixfleet.com/api/v1/webhook-catalog", {
method: "GET",
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
const data = await response.json();
Answers: 200 The catalog. · 401 Missing, malformed, unknown or revoked API key. · 403 insufficient_scope, feature_off, or (writes) suspended or read_only. · 429 Rate limit reached for this key.
GET/api/v1/openapi.json
This document
Public, no key
curl
curl -X GET "https://connect.rylixfleet.com/api/v1/openapi.json"
Register an HTTPS endpoint in Settings > Developers (or with POST /api/v1/webhook-endpoints) and choose its events. Rylix POSTs one JSON event per change to each enabled endpoint subscribed to it, for every order of the business, whichever way it was created.
Answer with any 2xx status within the endpoint's timeout (10 seconds unless you set 1–15), counted from the start of the request; the response body is not read. Anything else, a timeout or a redirect is retried up to 8 times with exponential backoff starting at 30 seconds. After 5 events in a row fail every attempt, the endpoint is switched off and the business owner is emailed; switch it back on in Settings > Developers. Each delivery and attempt is in the delivery log there, with a Resend button.
Events can arrive more than once and out of order: deduplicate by id and use data.order.status and data.order.updatedAt.
Each endpoint receives only the events it lists. No event carries customer personal data: never the customer's name, phone number, address, coordinates or order note, and never a comment or a driver location. The order status events carry data.order with the order's ids and facts (id, reference, order name, tracking number, status, kind, source, pickup location id, cash on delivery, pieces, failure category, ETA, createdAt, updatedAt, terminalAt). Every other event carries data.order as a summary (id, reference, order name, tracking number, status, kind, updatedAt) when it is about an order, plus its own fields. To get the customer and address, fetch GET /api/v1/orders/{id} with a key that has orders:read.
Order status
Event
Sent when
order.created
An order is created (API, dashboard, CSV import or Shopify).
order.assigned
A driver is assigned.
order.picked_up
The driver picked the order up.
order.on_the_way
The driver is on the way to the customer.
order.arrived
The driver arrived at the address.
order.delivered
The order was delivered.
order.failed
Delivery failed; data.failureCategory says why.
order.returned
The order is back at the store.
order.cancelled
The order was cancelled.
order.rescheduled
The delivery time changed; data.dateOnly is true when it is now a whole day with no time window.
order.address_changed
The delivery address changed.
Order lifecycle
Event
Sent when
order.unassigned
The order lost its driver (the office removed them or the driver gave it back); data.by says who.
order.reassigned
Another driver took over the order from the previous one.
order.attempt_failed
The driver could not deliver and is bringing the goods back; data.failureCategory says why. The order is not finished yet.
order.redelivery_scheduled
A failed or returned order was prepared for another delivery attempt.
order.pieces_scanned
A piece label was scanned at pickup (data.via is scan, data.piece its number) or the office marked every piece collected (data.via is office).
order.proof_added
Proof was added to the order: photos (data.proof.kind is photo, data.proof.count says how many) or the customer's signature at handover (data.proof.kind is signature). No image, link or signer name is sent.
Customer actions
Event
Sent when
order.change_requested
An address or delivery time change was requested; data.parts and data.by say what and who.
order.change_declined
A requested change was declined by the customer or the office; data.by says who.
order.phone_updated
The customer changed their phone number. The number is not sent: fetch the order with your key.
order.rated
The customer rated the driver; data.rating.stars is 1 to 5. Comments are never sent.
Money
Event
Sent when
order.cash_collected
The driver recorded the cash of a delivered order; data.cash has the amount and currency.
settlement.submitted
A driver submitted a cash hand-over; data.settlement has its id, the driver id and the amounts.
settlement.confirmed
The office confirmed a cash hand-over; data.settlement has the confirmed amounts and difference.
settlement.rejected
The office rejected a cash hand-over. The reason is not sent.
Returns, exchanges and linked orders
Event
Sent when
return.started
A return was approved and its pickup order created; data.return names the original order.
return.received
The returned goods are back at the store.
order.exchange_created
An exchange order was created from a delivered order; data.originalOrderId names it.
order.linked_created
A linked order (missing items or exchange) was created; data.linkType says which.
Agency cash boxes
Event
Sent when
remittance.ready
Agencies: a cash box for a client is ready to hand over; data.remittance has its number, currency and totals.
remittance.confirmed
Agencies: the client confirmed receiving a cash box (code, signature or transfer); data.remittance.receiptMethod says how.
remittance.disputed
Agencies: the amount handed over differs from the cash box's net; data.remittance.amountHanded has it.
Locations and drivers
Event
Sent when
location.created
A pickup location was added; data.location is the location.
location.updated
A pickup location changed; data.location is the location.
driver.shift_started
A driver started a shift; data.shift has the shift and driver ids.
driver.shift_ended
A driver ended a shift. Driver locations are never sent.
Request headers
Rylix-Signature
t=<unix seconds>,v1=<hex HMAC-SHA256>
Rylix-Event-Id
The event id (the same on retries and resends).
Rylix-Event-Type
The event type, e.g. order.delivered.
Rylix-Delivery-Id
This delivery attempt's log id.
Rylix-Test
1 on a test send only (the body then has "test": true).
Each endpoint can be tuned in Settings > Developers (Edit options) or with PATCH /api/v1/webhook-endpoints/{id}. GET /api/v1/webhook-catalog lists every choice below, so your own tools can offer the same editor.
Conditions
Send only the events that match every condition, for example only cash-on-delivery orders of one branch. Conditions are picked from a fixed list of fields (payment, cash on delivery amount, branch, pickup location, client, account, service, order kind, source, urgent, failure reason, order status, driver group, cash currency) with rules for their type: is, is not, is one of, is none of; more than, at least, less than, at most, between (money, compared in one currency); is (yes/no). Up to 10 conditions, up to 50 values each. There is no free text, no template and no code. Ids must be records of the business. A condition on something an event does not have never matches (for example an order condition on a settlement event); create and update answers list those as warnings. Filtered events are not logged; the endpoint shows how many were filtered today.
Fields to include
Each event family (order status, other order events, settlements, locations, driver shifts) sends every field by default. You may choose the fields of the subject resource per family; an empty list sends only its id and object. The envelope (id, type, createdAt, test) and the event's own fields are always sent. Customer personal data is never offered.
Custom headers
Up to 5 headers sent with every delivery and test, for example your receiver's API key (Authorization is allowed). Names: letters, digits and hyphens, up to 64. Values: printable characters, up to 1024. Refused names: Host, Content-Length, Content-Type, Content-Encoding, Transfer-Encoding, Connection, Keep-Alive, Upgrade, TE, Trailer, Expect, Forwarded, Via, User-Agent, Cookie, Set-Cookie, Date and every Proxy-*, X-Forwarded-* and Rylix-* name. Values are stored encrypted and never returned: the API shows each name with its last four characters (values of 12 characters or more). Rylix's own headers always win.
Timeout
How long Rylix waits for your answer's status, from 1 to 15 seconds (timeoutMs 1000–15000); 10 seconds by default. One deadline covers the whole request, connecting included.
Test events and preview
POST /api/v1/webhook-endpoints/{id}/test sends a sample event of a type the endpoint receives, signed with its secret and sent with its headers and timeout, marked "test": true with the header Rylix-Test: 1 and an id starting evt_test_. It uses fixed sample data, never your orders. One attempt, never retried, never resendable, never counted toward switching the endpoint off. Up to 10 tests per endpoint and 30 per business per rolling hour (429 rate_limited with Retry-After). GET /api/v1/webhook-endpoints/{id}/preview?type= returns the exact body without sending it.
Verifying signatures
Each endpoint has its own secret (whsec_…), shown once when it is created. The v1 signature is the hex HMAC-SHA256 of the timestamp, a dot and the raw request body, with the secret as the key.
Compute it over the raw body exactly as received (before parsing JSON), compare in constant time, and refuse timestamps more than 300 seconds from your clock so a captured request cannot be replayed.