Orders API

Connect your own system to PrimoRoute and create, update, read or cancel orders programmatically.

Getting an API key

Go to Settings → Integrations → API in the PrimoRoute dashboard and generate a key. The full key is shown once. Copy it immediately and store it somewhere safe. From then on it is only shown masked (e.g. pr_api_••••3f2a).

This key is independent from any Zapier connection your company may have, so regenerating or revoking it never affects Zapier, and vice versa.

Authentication

Send your API key in the X-Api-Key header on every request. There is no OAuth flow and no session. The header alone identifies your company.

X-Api-Key: pr_api_your_key_here

A missing, invalid or revoked key returns 401 with errorCode: "INVALID_API_KEY". Your key only ever sees and modifies your own company's orders. There is no way to reach another company's data with it.

Base URL

https://api.primoroute.com

Rate limits

Each API key is limited to 60 requests per minute. The window is fixed, not rolling: it opens with the first request you send and lasts 60 seconds. The counter then resets to zero all at once. It does not follow the clock minute, and it does not slide with each request.

Requests whose key is not recognized (wrong or revoked) are limited separately, per IP address: at most 20 per minute from one IP (for IPv6, one /64 block counts as one IP). Past that, those requests get 429 instead of 401. This counter never affects a valid key.

Exceeding either limit returns 429 with errorCode: "RATE_LIMIT_EXCEEDED" and a Retry-After header: the number of seconds until the current window ends (a whole number, at least 1). Wait that long before you retry.

HTTP/1.1 429 Too Many Requests
Retry-After: 23
Content-Type: application/json

{
  "message": "Çok fazla istek. Bir dakika sonra yeniden deneyin.",
  "errorCode": "RATE_LIMIT_EXCEEDED"
}

Errors

Every error response is JSON with a human-readable message and a stable, language-independent errorCode. Branch your integration on errorCode, not on the message text. Field-level validation errors also include an errors object keyed by field name.

{
  "message": "Validation failed",
  "errorCode": "VALIDATION_ERROR",
  "errors": {
    "Recipient.Name": ["Recipient name is required"],
    "Financial.TotalAmount": ["Total amount is required"]
  }
}

Endpoints

Create an order

POST/api/v1/orders

Creates a new order. Coordinates are resolved from the address automatically if you don't send them. Same validation rules as the PrimoRoute dashboard: a delivery window is required unless noDeliveryTimeConstraint is set.

Request body
{
  "sourceType": "PickupAddress",
  "recipient": {
    "name": "Ada Lovelace",
    "primaryPhoneNumber": "+31600000000",
    "street": "Prinsengracht 1",
    "city": "Amsterdam",
    "country": "NL"
  },
  "sender": {
    "name": "My Warehouse",
    "street": "Havenstraat 10",
    "city": "Rotterdam",
    "country": "NL"
  },
  "logistics": {
    "totalWeight": 3.5,
    "totalVolume": 0.02,
    "pieceCount": 1
  },
  "financial": {
    "totalAmount": 49.90,
    "currency": "Eur"
  },
  "timeline": {
    "deliveryStartDate": "2026-09-19T08:00:00Z",
    "deliveryDate": "2026-09-19T18:00:00Z"
  }
}
Response: 200 OK
{
  "data": {
    "id": "b3f1c2a4-...",
    "orderNumber": "PR-000482",
    "trackingCode": "TRK-9F2K",
    "status": "Pending",
    "sourceType": "PickupAddress",
    "isAssigned": false,
    "recipient": {
      "name": "Ada Lovelace",
      "primaryPhoneNumber": "+31600000000",
      "street": "Prinsengracht 1",
      "city": "Amsterdam",
      "country": "NL",
      "latitude": 52.3702,
      "longitude": 4.8952
    },
    "sender": {
      "name": "My Warehouse",
      "street": "Havenstraat 10",
      "city": "Rotterdam",
      "country": "NL"
    },
    "logistics": {
      "totalWeight": 3.5,
      "totalVolume": 0.02,
      "pieceCount": 1,
      "priority": "Medium"
    },
    "financial": {
      "totalAmount": 49.9,
      "currency": "Eur"
    },
    "timeline": {
      "createdAt": "2026-09-18T09:00:00Z",
      "deliveryStartDate": "2026-09-19T08:00:00Z",
      "deliveryDate": "2026-09-19T18:00:00Z"
    }
  },
  "message": "Success"
}

Update an order

PUT/api/v1/orders/{id}

Partially updates an order: only the fields you send are changed, everything else is left untouched. The status field is applied only to an order that is not yet on a route, and only for the values Cancelled and Delivered. For an order already assigned to a route, and for any other status value, the field is ignored and the status stays derived from the shipments and the route. To cancel an order that is on a route, use the cancel endpoint below: it also removes the order from that route.

Request body
{
  "logistics": {
    "totalWeight": 4.0
  },
  "timeline": {
    "deliveryDate": "2026-09-20T18:00:00Z"
  }
}
Response: 200 OK
{
  "data": {
    "id": "b3f1c2a4-...",
    "orderNumber": "PR-000482",
    "trackingCode": "TRK-9F2K",
    "status": "Pending",
    "sourceType": "PickupAddress",
    "isAssigned": false,
    "recipient": {
      "name": "Ada Lovelace",
      "primaryPhoneNumber": "+31600000000",
      "street": "Prinsengracht 1",
      "city": "Amsterdam",
      "country": "NL",
      "latitude": 52.3702,
      "longitude": 4.8952
    },
    "sender": {
      "name": "My Warehouse",
      "street": "Havenstraat 10",
      "city": "Rotterdam",
      "country": "NL"
    },
    "logistics": {
      "totalWeight": 3.5,
      "totalVolume": 0.02,
      "pieceCount": 1,
      "priority": "Medium"
    },
    "financial": {
      "totalAmount": 49.9,
      "currency": "Eur"
    },
    "timeline": {
      "createdAt": "2026-09-18T09:00:00Z",
      "deliveryStartDate": "2026-09-19T08:00:00Z",
      "deliveryDate": "2026-09-19T18:00:00Z"
    }
  },
  "message": "Success"
}

Get an order

GET/api/v1/orders/{id}

Reads a single order by its PrimoRoute id.

Response: 200 OK
{
  "data": {
    "id": "b3f1c2a4-...",
    "orderNumber": "PR-000482",
    "trackingCode": "TRK-9F2K",
    "status": "Pending",
    "sourceType": "PickupAddress",
    "isAssigned": false,
    "recipient": {
      "name": "Ada Lovelace",
      "primaryPhoneNumber": "+31600000000",
      "street": "Prinsengracht 1",
      "city": "Amsterdam",
      "country": "NL",
      "latitude": 52.3702,
      "longitude": 4.8952
    },
    "sender": {
      "name": "My Warehouse",
      "street": "Havenstraat 10",
      "city": "Rotterdam",
      "country": "NL"
    },
    "logistics": {
      "totalWeight": 3.5,
      "totalVolume": 0.02,
      "pieceCount": 1,
      "priority": "Medium"
    },
    "financial": {
      "totalAmount": 49.9,
      "currency": "Eur"
    },
    "timeline": {
      "createdAt": "2026-09-18T09:00:00Z",
      "deliveryStartDate": "2026-09-19T08:00:00Z",
      "deliveryDate": "2026-09-19T18:00:00Z"
    }
  },
  "message": "Success"
}

Cancel an order

POST/api/v1/orders/{id}/cancel

Cancels the order. If it is already assigned to a route, it is removed from that route as part of the same request and the remaining stops are recalculated. An order that has been picked up or delivered cannot be cancelled and returns 403. Calling this on an already cancelled order is a no-op and returns the order as it is. A cancelled order cannot be un-cancelled through this API.

Response: 200 OK
{
  "data": {
    "id": "b3f1c2a4-...",
    "orderNumber": "PR-000482",
    "trackingCode": "TRK-9F2K",
    "status": "Cancelled",
    "sourceType": "PickupAddress",
    "isAssigned": false,
    "recipient": {
      "name": "Ada Lovelace",
      "primaryPhoneNumber": "+31600000000",
      "street": "Prinsengracht 1",
      "city": "Amsterdam",
      "country": "NL",
      "latitude": 52.3702,
      "longitude": 4.8952
    },
    "sender": {
      "name": "My Warehouse",
      "street": "Havenstraat 10",
      "city": "Rotterdam",
      "country": "NL"
    },
    "logistics": {
      "totalWeight": 3.5,
      "totalVolume": 0.02,
      "pieceCount": 1,
      "priority": "Medium"
    },
    "financial": {
      "totalAmount": 49.9,
      "currency": "Eur"
    },
    "timeline": {
      "createdAt": "2026-09-18T09:00:00Z",
      "deliveryStartDate": "2026-09-19T08:00:00Z",
      "deliveryDate": "2026-09-19T18:00:00Z"
    }
  },
  "message": "Success"
}