SmartRoutes Open API (2.0.0)

Download OpenAPI specification:Download


Introduction

The SmartRoutes Open API allows you to use the power of the SmartRoutes Routing Engine directly from within your own software application.

To use the API, you will need to generate an API Access Key for your SmartRoutes account. To generate, login to your SmartRoutes account and navigate to Settings > Integrations > SmartRoutes Open API and click 'Generate API Key'. For more details on SmartRoutes integrations, click here.

This access key can be used to connect to the API.

Webhooks

Configure a webhook receiver URL in your depot settings and SmartRoutes will deliver event notifications as they happen. Seven event types are emitted:

EventType IDFires whendata payload
ORDERS_STATUS2An order's status changes (line-item or order-level transition){ "order_id": <int>, "order_number": <string>, "status": <OrderStatus> }
PLANS_CREATED4A Plan row is persisted (after POST /plans/optimise/orders or /orders-for-ids). Fires before optimisation completes — see the optimise endpoint description.{ "id": <int> } — plan id
PLANS_DISPATCHED5A Plan is dispatched (routes published to drivers).{ "id": <int> } — plan id
ROUTES_EDITED6A dispatched route is edited (re-ordering stops, etc.){ "id": <int> } — route id
ROUTES_DELETED7One or more dispatched routes are deleted (typically as part of solution replacement){ "id": <int> } — route id
ROUTES_COMPLETED8A dispatched route is completed by the driver.{ "id": <int> } — route id
PLANS_DELETED9A Plan row is destroyed{ "id": <int> } — plan id

Delivery envelope

Each event is delivered as an HTTP POST to the receiver URL configured in your depot settings. The request body is always a JSON object of shape:

{ "type": <event type string from the table above>, "data": <payload object from the table above> }

The data field is the payload object for a single event — NOT an array. Bulk operations (e.g. order-status changes from a route delete) fan out into one POST per event, each with its own data object.

Headers

Outgoing requests carry Content-Type: application/json and an HTTP Basic Authorization header derived from the username/password you supplied when configuring the webhook. No HMAC signature header is sent; treat the basic-auth credentials as the integrity check and rotate them if compromised.

Timeout and retries

Each delivery has a server-side request timeout of 3 seconds. On failure (HTTP error, timeout, or connection error) the delivery is retried up to 3 times total; after the third failure the task is marked permanently ERROR and not retried again. Your receiver should respond 2xx quickly — slow receivers will be treated as failures.

Machine-readable schemas

The delivery envelope and per-event payloads are also defined under #/components/schemas/: WebhookDelivery, WebhookOrdersStatusPayload, WebhookPlanIdPayload, WebhookRouteIdPayload. Reference these from your own integration's tests / contract tools to catch shape drift early.

Headers

All requests expect the API Access key to be provided in a header x-access-key:YOUR_ACCESS_KEY

Rate Limits

Every endpoint has a per-minute limit, and most also have a short burst limit. Requests are rejected as soon as either limit is hit.

Most endpoints fall into one of these tiers:

TierRate limitDescription
Standard60 / min (max 5 / sec)Single-resource reads and writes (e.g. GET /orders/{id}, PUT /orders/{id})
Listing30 / min (max 5 / sec)Paginated lists (e.g. /customers, /plans, /routes)
Reference60 / min (max 1 / sec)Reference data (e.g. depots, capacities, custom fields, vehicles, zone groups)
Bulk30 / min (max 1 per 2 sec)Bulk creates and heavy deletes
Upload15 / min (max 1 / sec)File uploads (e.g. POST /orders/{id}/attachments)

The following endpoints have a stricter limit of 5 / min (max 2 per 15 sec):

  • Plan optimisation: POST /plans/optimise/orders, POST /plans/optimise/orders-for-ids
  • Booking availability: POST /booking/availability, POST /booking/available-dates, POST /booking/available-slots
  • Route reversal: POST /routes/{id}/reverse

When a limit is hit, the API returns HTTP 403 with a Retry-After header and details.retry_after_seconds in the body — both give the seconds until the limit resets.

We may temporarily reduce these limits to protect platform stability. We aim to keep such reductions brief and rare. However, your application should be built to handle rate limits gracefully.

Idempotency

State-changing POST endpoints accept an optional idempotency-key request header. The mechanism is Stripe-style: send the same key with a retry of the same request and the server returns the original response without re-executing the underlying operation.

Header: idempotency-key: <opaque string, 1–255 characters>. The key can be any client-chosen identifier — a UUID is recommended. Keys are scoped per (api-key, endpoint), so the same key on two different endpoints is treated as two distinct operations.

Retention: 24 hours from the time the original request was received.

Behaviour:

  • Replay (same key, same body, completed) — server returns the original status code and response body. The response header idempotency-replay: true indicates the response is a cached replay. The underlying operation is not re-executed. Replays do not consume rate-limit or data-row quota.
  • Body mismatch (same key, different body) — server returns 422 IDEMPOTENCY_KEY_REUSED_WITH_DIFFERENT_BODY.
  • In-flight (same key, original request still processing) — server returns 409 IDEMPOTENCY_REQUEST_IN_PROGRESS with a Retry-After header. Retry after the period given.
  • 5xx server error — the cached reservation is released. A retry with the same key is treated as a fresh request and can re-execute. 4xx client errors are cached: replays return the same 4xx response.
  • Invalid key (empty, or longer than 255 chars) — server returns 400 IDEMPOTENCY_INVALID_KEY.

Supporting endpoints (Phase 1):

  • POST /orders
  • POST /depots/{id}/orders
  • POST /plans/optimise/orders
  • POST /plans/optimise/orders-for-ids
  • POST /customers/
  • POST /vehicles/
  • POST /notifications/schedule/orders

Other POST endpoints ignore the header. Multipart uploads (POST /orders/{id}/attachments) are excluded from idempotency in this phase.

Paging

Usage:

Make an initial request to the API endpoint with the desired query parameters. The API response includes the requested data and a Link header for the next page. Use the URL provided in the Link header to make subsequent requests for the next page.

Example: "<https://api.smartroutes.io/v2/orders?page_info=PAGE_INFO_STRING&limit=100>; rel=next"

Query Parameters

limit: Specifies the maximum number of items per page. Limited to a maximum of 100

Example: limit=50

updated_at_min: Filters results based on the minimum update timestamp in the format YYYY-MM-DD hh:mm:ss or YYYY-MM-DDTHH:mm:ss.SSSZ.

Example: updated_at_min=2023-01-01 12:00:00 OR updated_at_min=2023-01-01T12:00:00.000Z

status: Filters results based on the order status.

Example: status=Pending

Error Responses

Errors are classified into specific types, each identified by a unique name and accompanied by an appropriate HTTP statusCode. The error responses include a brief description of the error, and additional details that provide more context about the specific issue.

Error Types

RESOURCE_NOT_FOUND - statusCode: 404 - description: The requested resource could not be found.

INVALID_INPUT

  • statusCode: 400
  • description: The submitted input data is invalid.
  • details: An object { validationErrors: An array of Zod errors specifying validation issues in the submitted data. } containing additional details about the error. For processing validation errors, refer to Zod Documentation .

GEOCODING_FAILED

  • statusCode: 500
  • description: Geocoding operation failed.
  • details: An object containing additional details about the error.

Booking

Check Booking Availability

Endpoint to check whether an order can be booked on a specified day

Request Body schema: application/json
date
required
string <date>

Requested date for order collection/delivery.

required
object

Location and other routing information for booking availability check.

vehicles
Array of arrays

Array of vehicles to attempt to route the order with. If no vehicles provided, active vehicles will be used.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "booking": {
    }
}

Capacities

Get All Capacities

Endpoint to retrieve all capacities.

Responses

Response samples

Content type
application/json
{
  • "capacities": [
    ]
}

Custom Fields

Get All Custom Fields

Endpoint to retrieve all custom fields.

Responses

Response samples

Content type
application/json
{
  • "custom_fields": [
    ]
}

Customers

Get Customers Page

Endpoint to retrieve a page of customers.

query Parameters
page_info
string

Information about the page for pagination. Generated by the OpenAPI

updated_at_min
string <date-time>

Minimum updated date and time for filtering.

limit
integer
Default: 100

Maximum number of customers to retrieve per page.

Responses

Response samples

Content type
application/json
{
  • "customers": [
    ]
}

Bulk Create Customers

Creates multiple customers in a single request (max 100). All referenced tags, skills, and capacities must already exist. custom_fields can be matched by id or name.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
required
Array (<= 100 items)
name
string <= 100 characters

Full name of the customer

account
required
string <= 100 characters

Unique account reference (required)

address
string <= 255 characters
postcode
string <= 20 characters
phone
string <= 30 characters
email
string <email>
lat
number

Latitude coordinate

lng
number

Longitude coordinate

duration
number [ 1 .. 9999 ]

Visit duration in minutes

notes
string <= 40000 characters
Array of objects

List of predefined capacity types by ID

skills
Array of strings

List of skill names (must already exist)

tags
Array of strings

List of tag names (must already exist)

Array of objects <= 2 items

Up to two delivery/pickup time windows per customer

Array of objects

Custom field values. Use id or name to identify each custom field.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "customers": [
    ],
  • "errors": [ ]
}

Get Customer by ID

Retrieve a customer based on ID.

path Parameters
id
required
string

ID of the customer to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": 123,
  • "name": "John Doe",
  • "account": "NO123",
  • "address": "123 Main St 12345",
  • "postcode": "12345",
  • "lat": 12.345,
  • "lng": -67.89,
  • "phone": "+1234567890",
  • "email": "john@doe.com",
  • "duration": 30,
  • "notes": "Leave at the doorstep",
  • "created": "2022-04-29T16:12:08.000Z",
  • "updated": "2022-09-29T10:11:06.000Z",
  • "capacities": [
    ],
  • "time_windows": [
    ],
  • "skills": [
    ],
  • "tags": [
    ],
  • "custom_fields": [
    ]
}

Update Customer by ID

Update a customer based on ID.

path Parameters
id
required
string

ID of the customer to update.

Request Body schema: application/json
name
string

Name of the customer.

account
string

Account number of the customer.

address
string

Address of the customer.

postcode
string

Postcode for the customer address.

lat
number

Latitude of the customer location.

lng
number

Longitude of the customer location.

phone
string

Contact number of the customer.

email
string <email>

Email of the customer.

duration
number

Duration for customer interaction in minutes.

notes
string

Notes for customer interaction.

Array of objects

List of time windows for the customer.

skills
Array of strings

List of required skills for the customer.

tags
Array of strings

List of tags for the customer

Array of objects

List of capacities for the customer.

Array of objects

List custom fields for the customer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "account": "string",
  • "address": "string",
  • "postcode": "string",
  • "lat": 0,
  • "lng": 0,
  • "phone": "string",
  • "email": "user@example.com",
  • "duration": 0,
  • "notes": "string",
  • "time_windows": [
    ],
  • "skills": [
    ],
  • "tags": [
    ],
  • "capacities": [
    ],
  • "custom_fields": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 123,
  • "name": "John Doe",
  • "account": "NO123",
  • "address": "123 Main St 12345",
  • "postcode": "12345",
  • "lat": 12.345,
  • "lng": -67.89,
  • "phone": "+1234567890",
  • "email": "john@doe.com",
  • "duration": 30,
  • "notes": "Leave at the doorstep",
  • "capacities": [
    ],
  • "time_windows": [
    ],
  • "skills": [
    ],
  • "tags": [
    ],
  • "custom_fields": [
    ]
}

Depots

Get All Depots

Endpoint to retrieve a list of all depots.

Responses

Response samples

Content type
application/json
{
  • "depots": [
    ]
}

Bulk Add Orders to Depot

Endpoint to bulk add orders to a depot.

path Parameters
id
required
number

ID of the depot to which bulk orders are added.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
Array
order_number
required
string
type
required
string
Enum: "delivery" "pickup" "shipment"
id (object) or account (object)

Optional. When omitted, the order is created without a customer association (customer_id will be null). Requires the 'Orders Without Customers' depot setting to be enabled.

delivery_contact_name
string
delivery_contact_number
string
delivery_contact_email
string <email>
delivery_address
string
delivery_postcode
string
delivery_lat
number
delivery_lng
number
delivery_notes
string
Array of objects

List of time windows for order delivery.

delivery_date
string <date>
delivery_available_days
Array of strings
Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"

List of available delivery days for the order.

pickup_address
string
pickup_postcode
string
pickup_duration
number
pickup_lat
number
pickup_lng
number
pickup_notes
string
Array of objects

List of time windows for order pickup.

pickup_contact_name
string
pickup_contact_number
string
pickup_contact_email
string <email>
pickup_available_days
Array of strings
Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"

List of available pickup days for the order.

parts
number
Array of objects
skills
Array of strings
Array of objects
Array of objects

List of capacities for the order. Either id or type is required.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "orders": [
    ],
  • "errors": [
    ]
}

Driver Questionnaires

Get a driver questionnaire submission by ID

path Parameters
id
required
integer

Driver Questionnaire Submission ID

Responses

Response samples

Content type
application/json
{
  • "driver_questionnaire_submission": {
    }
}

Notification Tasks

Get Notification Tasks Page

Endpoint to retrieve a page of notification tasks.

query Parameters
page_info
string

Pagination cursor generated by the API. Pass this value to retrieve the next page of results.

limit
integer
Default: 100

Maximum number of notification tasks to retrieve per page. Max 100.

updated_at_min
string <date-time>

Filter tasks modified at or after this datetime. Format: YYYY-MM-DD hh:mm:ss or YYYY-MM-DDTHH:mm:ss.SSSZ.

status
string

Filter notification tasks by status.

type
string
Enum: "SMS" "EMAIL"

Filter notification tasks by type. Accepted values: SMS, EMAIL (case-insensitive).

Responses

Response samples

Content type
application/json
{
  • "notification_tasks": [
    ]
}

Notifications

Get Notification Templates

Endpoint to retrieve a depot's notification templates.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Schedule Order Notifications

Schedule notification dispatches for a set of orders.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
orders
required
Array of arrays

Array of order IDs to create notifications for

templates
required
Array of arrays

Array of template IDs to generate notifications for

send_time_utc
string

UTC Timestamp at which to send the notifications, defaults to current time if not provided.

Responses

Request samples

Content type
application/json
{
  • "orders": [
    ],
  • "templates": [
    ],
  • "send_time_utc": "2024-12-25 12:00:00"
}

Response samples

Content type
application/json
{
  • "notifications": [
    ],
  • "errors": [
    ]
}

Orders

Bulk Add Orders

Endpoint to bulk add orders.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
Array
order_number
required
string

Order number.

id (object) or account (object)

Optional. When omitted, the order is created without a customer association (customer_id will be null). Requires the 'Orders Without Customers' depot setting to be enabled.

type
required
string
Enum: "delivery" "pickup" "shipment"

Type of the order (delivery, pickup, or shipment).

priority
string

Priority of the order (Accepts 'P1', 'P2', 'P3').

delivery_contact_name
string

Name of the contact person.

delivery_contact_number
string

Contact number of the person.

delivery_contact_email
string <email>

Email of the contact person.

delivery_address
string

Delivery address.

delivery_country_code
string

Two letter country code, e.g. 'IE'

delivery_postcode
string

Postcode for delivery address.

delivery_lat
number

Latitude of the delivery location.

delivery_lng
number

Longitude of the delivery location.

delivery_duration
number

Duration for order delivery in minutes.

delivery_notes
string

Notes for delivery instructions.

Array of objects

List of time windows for order delivery.

delivery_date
string <date>

Date for order delivery.

delivery_available_days
Array of strings
Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"

List of available delivery days for the order.

pickup_address
string

Address for order pickup.

pickup_country_code
string

Two letter country code, e.g. 'IE'

pickup_postcode
string

Postcode for pickup address.

pickup_duration
number

Duration for order pickup in minutes.

pickup_lat
number

Latitude of the pickup location.

pickup_lng
number

Longitude of the pickup location.

pickup_notes
string

Notes for pickup instructions.

Array of objects

List of time windows for order pickup.

pickup_contact_name
string

Name of the contact person for pickup.

pickup_contact_number
string

Contact number of the person for pickup.

pickup_contact_email
string <email>

Email of the contact person for pickup.

pickup_available_days
Array of strings
Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"

List of available pickup days for the order.

parts
number

Number of parts in the order.

object
Array of objects
object

Third party object

Array of objects

List of line items in the order.

skills
Array of strings

List of required skills for the order.

Array of objects

List of custom fields for the order.

Array of objects

List of capacities for the order. Either id or type is required.

tags
Array of strings

List of tag names (must already exist)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "orders": [
    ],
  • "errors": [
    ]
}

Get Orders Page

Endpoint to retrieve a page of orders.

query Parameters
page_info
string

Information about the page for pagination. Generated by the OpenAPI

status
string

Status of the orders to filter.

customer_id
integer

Filter orders by the customer they belong to.

order_number
string

Filter orders by a specific order number

updated_at_min
string <date-time>

Minimum updated date and time for filtering.

limit
integer
Default: 100

Maximum number of orders to retrieve per page.

Responses

Response samples

Content type
application/json
{
  • "orders": [
    ]
}

Get Order by ID

Retrieve an order based on ID.

path Parameters
id
required
string

ID of the order to retrieve.

Responses

Response samples

Content type
application/json
{
  • "order_number": "ABC123",
  • "priority": "P1",
  • "customer_id": 101,
  • "delivery_contact_name": "John Doe",
  • "delivery_contact_number": "+1234567890",
  • "delivery_contact_email": "john.doe@example.com",
  • "delivery_address": "123 Main St 12345",
  • "delivery_lat": 12.345,
  • "delivery_lng": -67.89,
  • "delivery_notes": "Leave at the doorstep",
  • "delivery_date": "2023-01-01",
  • "delivery_duration": 30,
  • "delivery_available_days": [
    ],
  • "pickup_address": "456 Oak Ave 67890",
  • "pickup_lat": 12.678,
  • "pickup_lng": -67.432,
  • "pickup_notes": "Collect from reception",
  • "pickup_contact_name": "Jane Smith",
  • "pickup_contact_number": "+0987654321",
  • "pickup_contact_email": "jane.smith@example.com",
  • "pickup_available_days": [
    ],
  • "pickup_duration": 15,
  • "status": "OPEN",
  • "type": "delivery",
  • "parts": 2,
  • "created": "2022-04-29T16:12:08.000Z",
  • "updated": "2022-09-29T10:11:06.000Z",
  • "vehicle_assignment": {
    },
  • "emails": [
    ],
  • "customer": {
    },
  • "third_party": {
    },
  • "tags": [
    ],
  • "line_items": [
    ],
  • "capacities": [
    ],
  • "custom_fields": [
    ],
  • "time_windows": [
    ],
  • "skills": [
    ],
  • "stops": [
    ],
  • "attachments": [
    ]
}

Update Order by ID

Update an order based on ID.

path Parameters
id
required
string

ID of the order to update.

Request Body schema: application/json
Schema not provided

Responses

Request samples

Content type
application/json
{
  • "order_number": "ABC123",
  • "priority": "P1",
  • "customer_id": 101,
  • "delivery_contact_name": "John Doe",
  • "delivery_contact_number": "+1234567890",
  • "delivery_contact_email": "john.doe@example.com",
  • "delivery_address": "123 Main St 12345",
  • "delivery_lat": 12.345,
  • "delivery_lng": -67.89,
  • "delivery_notes": "Leave at the doorstep",
  • "delivery_time_windows": [
    ],
  • "delivery_duration": 30,
  • "delivery_date": "2023-01-01",
  • "delivery_available_days": [
    ],
  • "type": "delivery",
  • "parts": 2,
  • "vehicle_assignment": {
    },
  • "emails": [
    ],
  • "updated": "2023-01-04T08:45:00Z",
  • "third_party": {
    },
  • "tags": [
    ],
  • "line_items": [
    ],
  • "capacities": [
    ],
  • "skills": [
    ]
}

Response samples

Content type
application/json
{
  • "order": {
    },
  • "errors": [ ]
}

Add Attachment to Order by ID

Upload a single attachment file to the order. Only one file can be uploaded per request. Supported file types: pdf, png, jpg, jpeg. Maximum file size: 10MB. Maximum of 2 attachments are allowed per order overall.

path Parameters
id
required
string

The ID of the order to attach the file to.

Request Body schema: multipart/form-data
required
attachment
required
string <binary>

Upload a single file (allowed types: pdf, png, jpg, jpeg; max size 10MB).

Responses

Response samples

Content type
application/json
{
  • "id": 58,
  • "order_id": "451020",
  • "depot_id": 578,
  • "name": "SmartRoutes-Orders1.pdf",
  • "mime": "application/pdf",
  • "ext": "pdf",
  • "size": 473892,
  • "is_compressed": false,
  • "modified": "2025-09-01T14:02:02.922Z",
  • "created": "2025-09-01T14:02:02.922Z"
}

Delete Orders by Order Number

Delete orders based on order number.

path Parameters
order_number
required
string

Order number to delete orders.

Responses

Response samples

Content type
application/json
{
  • "deleted": {
    }
}

Plans

Optimise Orders

Async optimisation. Returns 200 immediately with a Plan id and an optimisation job id. The optimisation runs in the background; poll GET /plans/{id} to check progress.

Initial response: { "optimisation": { "id": "<uuid>", "in_progress": true }, "plan": { "id": <integer>, "dispatched": false } }

PollingGET /plans/{id}:

  • Completed: plan.routes is non-empty (or plan.unserved is non-empty if no routes are viable). Either signals the optimisation has finished.
  • Still running: plan.routes and plan.unserved are both empty.
  • Failed: there is no terminal failure signal on the Plan resource today. A failed job leaves the Plan in the same "empty arrays" state as a still-running job. Implement a client-side hard timeout — recommended 10 minutes — after which the job should be considered abandoned.

Recommended polling cadence:

  • First minute: every 2 seconds.
  • After 1 minute: every 10 seconds, exponential backoff up to 30 seconds.
  • Hard timeout: 10 minutes total.

Webhook coupling: the PLANS_CREATED webhook fires immediately after the Plan is persisted — before the optimisation job has completed. A webhook delivery does not imply the optimisation finished. Consumers receiving PLANS_CREATED should still poll GET /plans/{id} to learn the outcome.

Concurrency limits per depot (queue, not timeout): STANDARD 100, LONG 100, DIST 7, BOOKING_CHECK 1. No documented per-job timeout; typical jobs complete in 5–30 seconds.

Idempotency: Supports the idempotency-key request header for safe retries. See the Idempotency section in the API description.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
delivery_date
required
string <date>

The delivery date YYYY-MM-DD for optimizing orders.

object
required
object
Array of objects or null
zone_group_id
integer

The ID of the zone group for optimization.

Responses

Request samples

Content type
application/json
{
  • "delivery_date": "2023-12-31",
  • "settings": {
    },
  • "zone_group_id": 123
}

Response samples

Content type
application/json
{
  • "optimisation": {
    },
  • "plan": {
    }
}

Optimise Orders For IDs

Async optimisation for a specific set of order IDs. Same lifecycle and polling semantics as POST /plans/optimise/orders — see that endpoint's description for completion detection, polling cadence, and the failure-signal gap. Supports the idempotency-key request header for safe retries.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
required
Array of objects
object
required
object
Array of objects or null
zone_group_id
integer

The ID of the zone group for optimization.

Responses

Request samples

Content type
application/json
{
  • "orders": [
    ],
  • "settings": {
    },
  • "zone_group_id": 123
}

Response samples

Content type
application/json
{
  • "optimisation": {
    },
  • "plan": {
    }
}

Get Optimisation Job by ID

Retrieve the status of a plan optimisation by UUID.

path Parameters
id
required
string

ID of the current optimisation to retrieve.

Responses

Response samples

Content type
application/json
{
  • "optimisation": {
    },
  • "plan": {
    }
}

Get Plan by ID

Retrieve a Plan based on ID. When the plan was just created via the optimise endpoint and the optimisation job has not finished, routes and unserved are both empty arrays — see the async optimise endpoint description for polling guidance and failure-signal limitations.

path Parameters
id
required
number

ID of the plan to retrieve.

Responses

Response samples

Content type
application/json
{
  • "plan": {
    }
}

Delete Plan by ID

Delete a plan based on ID.

path Parameters
id
required
number

ID of the plan to delete.

Responses

Response samples

Content type
application/json
{
  • "deleted": {
    }
}

Get Plans Page

Endpoint to retrieve a page of plans.

query Parameters
page_info
string

Information about the page for pagination. Generated by the OpenAPI

updated_at_min
string <date-time>

Minimum updated date and time for filtering.

limit
integer
Default: 100

Maximum number of plans to retrieve per page.

Responses

Response samples

Content type
application/json
{
  • "plans": [
    ]
}

Proof of Delivery

Get Proof of Delivery Photo

Retrieve a proof-of-delivery photo by its ID. By default returns the raw image binary. Use the encoding query parameter to request a Base64-encoded JSON response instead.

path Parameters
id
required
integer

The ID of the photo to retrieve.

query Parameters
encoding
string
Value: "base64"

Set to base64 to receive the image as a Base64-encoded string in a JSON response instead of raw binary.

Responses

Response samples

Content type
No sample

Get Proof of Delivery Signature

Retrieve a proof-of-delivery signature by its ID. By default returns the raw image binary. Use the encoding query parameter to request a Base64-encoded JSON response instead.

path Parameters
id
required
integer

The ID of the signature to retrieve.

query Parameters
encoding
string
Value: "base64"

Set to base64 to receive the image as a Base64-encoded string in a JSON response instead of raw binary.

Responses

Response samples

Content type
No sample

Routes

Get Route by ID

Retrieve a route based on ID.

path Parameters
id
required
number

ID of the route to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": 12345,
  • "plan_id": 67,
  • "name": "Route 1",
  • "dispatched": true,
  • "date": "2023-12-31",
  • "start_time": "08:00",
  • "started_ts": "2024-07-09T09:00:00.000Z",
  • "end_time": "16:00",
  • "completed_ts": "2024-07-09T17:18:40.000Z",
  • "total_time": 480,
  • "travel_time": 300,
  • "planned_distance": 50,
  • "actual_distance": 45,
  • "vehicle": {
    },
  • "stops": [
    ],
  • "created": "2024-06-19T08:56:43.000Z",
  • "updated": "2024-06-19T08:56:43.000Z",
  • "driver_questionnaire_submissions": [
    ]
}

Reverse Route by ID

Reverse a route based on ID.

path Parameters
id
required
number

ID of the route to reverse.

Responses

Response samples

Content type
application/json
{
  • "id": 12345,
  • "plan_id": 67,
  • "name": "Route 1",
  • "date": "2023-12-31",
  • "start_time": "08:00",
  • "started_ts": "2024-07-09T09:00:00.000Z",
  • "end_time": "16:00",
  • "completed_ts": "2024-07-09T17:18:40.000Z",
  • "total_time": 480,
  • "travel_time": 300,
  • "planned_distance": 50,
  • "actual_distance": 45,
  • "vehicle": {
    },
  • "stops": [
    ]
}

Get Routes Page

Endpoint to retrieve a page of routes.

query Parameters
page_info
string

Information about the page for pagination. Generated by the OpenAPI

updated_at_min
string <date-time>

Minimum updated date and time for filtering.

limit
integer
Default: 100

Maximum number of routes to retrieve per page.

Responses

Response samples

Content type
application/json
{
  • "routes": [
    ]
}

Third Parties

Get All Third Parties

Endpoint to retrieve all third parties.

Responses

Response samples

Content type
application/json
{
  • "third-parties": [
    ]
}

Vehicles

Add Vehicle

Endpoint to add a vehicle.

header Parameters
idempotency-key
string [ 1 .. 255 ] characters

Optional idempotency key for safe retries. See the Idempotency section of the API description for behaviour. 1–255 characters; UUID recommended.

Request Body schema: application/json
name
string

Name of the vehicle.

availability
required
string
Enum: "shift" "full_day" "always"

Availability status of the vehicle.

shift_start
string or null <time>

Start time of the vehicle's shift (if availability is 'shift').

shift_end
string or null <time>

End time of the vehicle's shift (if availability is 'shift').

start_location
required
string
Enum: "depot" "other" "app-location"

Location type where the vehicle starts.

start_address
string or null

Address where the vehicle starts (if location is 'other').

start_lng
number or null

Longitude of the starting location (if location is 'other').

start_lat
number or null

Latitude of the starting location (if location is 'other').

end_location
required
string
Enum: "depot" "other" "none"

Location type where the vehicle ends.

end_address
string or null

Address where the vehicle ends (if location is 'other').

end_lng
number or null

Longitude of the ending location (if location is 'other').

end_lat
number or null

Latitude of the ending location (if location is 'other').

break
boolean

Flag indicating whether the vehicle has a break.

break_start
string or null <time>

Start time of the vehicle's break (if it has a break).

break_end
string or null <time>

End time of the vehicle's break (if it has a break).

break_duration
number or null

Duration of the vehicle's break in minutes (if it has a break).

active
boolean

Flag indicating whether the vehicle is active.

skills
Array of strings

Array of skills associated with the vehicle.

Array of objects

Array of capacities associated with the vehicle.

Responses

Request samples

Content type
application/json
{
  • "name": "Vehicle Name",
  • "availability": "shift",
  • "shift_start": "08:00",
  • "shift_end": "17:30",
  • "start_location": "depot",
  • "end_location": "none",
  • "break": false,
  • "capacities": [
    ]
}

Response samples

Content type
application/json
{
  • "vehicle": {
    }
}

Get All Vehicles

Endpoint to retrieve all vehicles.

Responses

Response samples

Content type
application/json
{
  • "vehicles": [
    ]
}

Update Vehicle by ID

Update a vehicle based on ID.

path Parameters
id
required
number

ID of the vehicle to update.

Request Body schema: application/json
name
string

Name of the vehicle.

availability
required
string
Enum: "shift" "full_day" "always"

Availability status of the vehicle.

shift_start
string or null <time>

Start time of the vehicle's shift (if availability is 'shift').

shift_end
string or null <time>

End time of the vehicle's shift (if availability is 'shift').

start_location
required
string
Enum: "depot" "other" "app-location"

Location type where the vehicle starts.

start_address
string or null

Address where the vehicle starts (if location is 'other').

start_lng
number or null

Longitude of the starting location (if location is 'other').

start_lat
number or null

Latitude of the starting location (if location is 'other').

end_location
required
string
Enum: "depot" "other" "none"

Location type where the vehicle ends.

end_address
string or null

Address where the vehicle ends (if location is 'other').

end_lng
number or null

Longitude of the ending location (if location is 'other').

end_lat
number or null

Latitude of the ending location (if location is 'other').

break
boolean

Flag indicating whether the vehicle has a break.

break_start
string or null <time>

Start time of the vehicle's break (if it has a break).

break_end
string or null <time>

End time of the vehicle's break (if it has a break).

break_duration
number or null

Duration of the vehicle's break in minutes (if it has a break).

active
boolean

Flag indicating whether the vehicle is active.

skills
Array of strings

Array of skills associated with the vehicle.

Array of objects

Array of capacities associated with the vehicle.

Responses

Request samples

Content type
application/json
{
  • "name": "Vehicle Name",
  • "availability": "shift",
  • "shift_start": "08:00",
  • "shift_end": "17:30",
  • "start_location": "depot",
  • "end_location": "none",
  • "break": false,
  • "capacities": [
    ]
}

Response samples

Content type
application/json
{
  • "vehicle": {
    }
}

Get Vehicle by ID

Retrieve a vehicle based on ID.

path Parameters
id
required
number

ID of the vehicle to retrieve.

Responses

Response samples

Content type
application/json
{
  • "vehicle": {
    }
}

Delete Vehicle by ID

Delete a vehicle based on ID.

path Parameters
id
required
number

ID of the vehicle to delete.

Responses

Response samples

Content type
application/json
{
  • "deleted": {
    }
}

Zone Groups

Get Zone Groups

Endpoint to retrieve zone groups.

Responses

Response samples

Content type
application/json
{
  • "zone_groups": [
    ]
}

Get Zone for Location

Endpoint to return the zone name and zone ID for a given location within a specified zone group.

path Parameters
id
required
number

ID of the zone group.

Request Body schema: application/json
required
object

Location information for zone. If no lat, lng is provided, address or postcode is required.

Responses

Request samples

Content type
application/json
{
  • "location": {
    }
}

Response samples

Content type
application/json
{
  • "zone": {
    }
}