OptimoCMSDocs

Delivery

Orders, zones, drivers, and KPIs

GET
/v1/sites/{siteId}/delivery/orders

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

status?string
Value in"received" | "preparing" | "ready" | "picked_up" | "in_transit" | "delivered" | "cancelled"
driverId?string
dateFrom?string
Formatdate
dateTo?string
Formatdate
limit?integer
Default25
Rangevalue <= 100
cursor?string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/delivery/orders"
{
  "data": [
    {
      "id": "string",
      "orderId": "string",
      "status": "received",
      "customerName": "string",
      "customerPhone": "string",
      "customerAddress": {
        "line1": "string",
        "city": "string",
        "postalCode": "string"
      },
      "driverId": "string",
      "deliveryCost": 0,
      "currency": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "deliveredAt": "2019-08-24T14:15:22Z"
    }
  ],
  "hasMore": true,
  "nextCursor": "string",
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/delivery/orders/{orderId}

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
orderId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/delivery/orders/string"
{
  "data": {
    "id": "string",
    "orderId": "string",
    "status": "received",
    "customerName": "string",
    "customerPhone": "string",
    "customerAddress": {
      "line1": "string",
      "city": "string",
      "postalCode": "string"
    },
    "driverId": "string",
    "deliveryCost": 0,
    "currency": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "deliveredAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PATCH
/v1/sites/{siteId}/delivery/orders/{orderId}/status

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
orderId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/v1/sites/string/delivery/orders/string/status" \  -H "Content-Type: application/json" \  -d '{    "status": "received"  }'
{
  "data": {
    "id": "string",
    "status": "string"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/delivery/zones

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/delivery/zones"
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "active": true
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/delivery/drivers

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/delivery/drivers"
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "phone": "string",
      "vehicle": "string"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/delivery/kpis

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Response Body

application/json

curl -X GET "https://example.com/v1/sites/string/delivery/kpis"
{
  "data": {
    "totalOrders": 0,
    "todayOrders": 0,
    "avgDeliveryMinutes": 0,
    "activeDrivers": 0
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}