Raw schema
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"CREATE",
"UPDATE",
"MERGE",
"SYNC"
],
"description": "How to apply the order (see description)."
},
"orderNo": {
"description": "Your order number, shown in the web app. Used to match existing orders.",
"type": "string"
},
"id": {
"description": "OptimoRoute's order id. Takes priority over orderNo when matching.",
"type": "string"
},
"date": {
"description": "Order date, YYYY-MM-DD.",
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"type": {
"description": "D = delivery, P = pickup, T = task.",
"type": "string",
"enum": [
"D",
"P",
"T"
]
},
"duration": {
"description": "Service time at the location, in minutes.",
"type": "number",
"minimum": 0
},
"priority": {
"description": "L low, M medium (default), H high, C critical.",
"type": "string",
"enum": [
"L",
"M",
"H",
"C"
]
},
"timeWindows": {
"description": "When the order can be serviced, e.g. [{\"twFrom\": \"10:00\", \"twTo\": \"14:00\"}].",
"type": "array",
"items": {
"type": "object",
"properties": {
"twFrom": {
"type": "string",
"pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
},
"twTo": {
"type": "string",
"pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
}
},
"required": [
"twFrom",
"twTo"
]
}
},
"allowedWeekdays": {
"description": "Weekdays the order may be scheduled on. Default: all.",
"type": "array",
"items": {
"type": "string",
"enum": [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
]
}
},
"allowedDates": {
"description": "Restrict the dates the order may be scheduled, e.g. {\"from\": \"2026-10-01\", \"to\": \"2026-10-07\"}.",
"type": "object",
"properties": {
"from": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "Date in YYYY-MM-DD format, e.g. 2026-09-30."
},
"to": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "Date in YYYY-MM-DD format, e.g. 2026-09-30."
}
}
},
"allowedDateTimes": {
"description": "Datetime windows in which the service may begin.",
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {
"description": "Earliest start, YYYY-MM-DDTHH:MM:SS.",
"type": [
"string",
"null"
]
},
"to": {
"description": "Latest start, YYYY-MM-DDTHH:MM:SS.",
"type": [
"string",
"null"
]
}
}
}
},
"assignedTo": {
"description": "Force the order onto one driver, e.g. {\"serial\": \"102\"} or {\"externalId\": \"444\"}. null clears it.",
"anyOf": [
{
"type": "object",
"properties": {
"serial": {
"type": "string"
},
"externalId": {
"type": "string"
}
}
},
{
"type": "null"
}
]
},
"load1": {
"description": "Load units #1 (boxes, kg, ...) per your capacity setup.",
"type": "number"
},
"load2": {
"description": "Load units #2.",
"type": "number"
},
"load3": {
"description": "Load units #3.",
"type": "number"
},
"load4": {
"description": "Load units #4.",
"type": "number"
},
"vehicleFeatures": {
"description": "Required vehicle feature codes.",
"type": "array",
"items": {
"type": "string"
}
},
"skills": {
"description": "Required driver skill codes.",
"type": "array",
"items": {
"type": "string"
}
},
"notes": {
"description": "Notes for the driver's instructions.",
"type": "string"
},
"email": {
"description": "Customer email for notifications.",
"type": "string"
},
"phone": {
"description": "Customer phone number.",
"type": "string"
},
"notificationPreference": {
"description": "How order-tracking notifications are delivered for this order.",
"type": "string",
"enum": [
"dont_notify",
"email",
"sms",
"both"
]
},
"relatedOrderNo": {
"description": "orderNo of a related pickup/delivery (set on the second order of the pair).",
"type": [
"string",
"null"
]
},
"relatedId": {
"description": "id of a related pickup/delivery.",
"type": [
"string",
"null"
]
},
"customField1": {
"description": "Legacy custom field #1.",
"type": "string"
},
"customField2": {
"description": "Legacy custom field #2.",
"type": "string"
},
"customField3": {
"description": "Legacy custom field #3.",
"type": "string"
},
"customField4": {
"description": "Legacy custom field #4.",
"type": "string"
},
"customField5": {
"description": "Legacy custom field #5.",
"type": "string"
},
"customFields": {
"description": "New-style custom fields keyed by the field key configured in OptimoRoute.",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": [
"string",
"number",
"boolean"
]
}
},
"acceptDuplicateOrderNo": {
"description": "Allow CREATE of an order whose orderNo already exists.",
"type": "boolean"
},
"location": {
"description": "Where the order is serviced.",
"type": "object",
"properties": {
"locationNo": {
"description": "Number of an existing location. To reuse one, send ONLY locationNo (adding address or coordinates makes OptimoRoute geocode or create a new one).",
"type": "string"
},
"locationName": {
"description": "Location name.",
"type": "string"
},
"address": {
"description": "Full address including the country, e.g. 393 Hanover St, Boston, MA 02113, USA.",
"type": "string"
},
"latitude": {
"description": "Latitude.",
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"description": "Longitude.",
"type": "number",
"minimum": -180,
"maximum": 180
},
"checkInTime": {
"description": "Minimum waiting time at the location, in minutes.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"notes": {
"description": "Notes about the location, e.g. a gate code.",
"type": "string"
},
"acceptPartialMatch": {
"description": "Accept a lower-confidence geocoding match instead of erroring.",
"type": "boolean"
},
"acceptMultipleResults": {
"description": "Accept an address that geocodes to several results instead of erroring.",
"type": "boolean"
},
"storeInvalid": {
"description": "Store the order even if the address cannot be geocoded (it cannot be planned until fixed).",
"type": "boolean"
}
}
}
},
"required": [
"operation"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}