The following endpoint should be used when creating or submitting an order:
REST API: POST /api/order/post
No specific fields or values are required within the submission request. All fields are optional and can be added or removed from the request as desired. However, there are some behaviors to consider:
- Orders that are submitted without a tracking number field value will be given an automatically generated tracking number on creation.
- Orders that are submitted without a status level field value will be set as submitted on creation.
- Any other fields that are not present within the request at the time of submission will have their values nullified by default (refer to the Updating Data knowledge base article for more information).
A sample order returned by the OnTime API is shown below in JSON format:
{
"Dispatcher": "44bc0a1d-ef24-49b5-a0cb-54181ce5dbcf",
"DriverCurrentlyAssigned": "44bc0a1d-ef24-48b5-a0cb-54181ce2dbaf",
"Customer": "bf49c3d8-b3dc-48a0-8f58-60562e60d692",
"Items": [
{
"ID": "ded4d92a-6fde-4c85-8865-8e5116b068cf",
"OrderID": "71052e79-2bab-46d4-8442-e2dfb0a08f60",
"TrackingNumber": "1000346-001",
"Description": "Sample Item",
"Comments": "Partial Pickup",
"Weight": 1.0,
"Height": 1.0,
"Width": 2.0,
"Length": 3.0
}
],
"Department": {
"ID": "5d069519-723b-4676-8a9a-01a6311d2462",
"CustomerID": "bc49c3d8-b36c-48a0-8f58-60762f50e692",
"Name": "Development"
},
"CustomerContact": {
"ID": "907a0bd6-fff8-4636-9449-f8fb167ea637",
"CustomerID": "bf49c3d8-b3dc-48a0-8f58-60562e50d692",
"Name": "John Doe",
"Email": "jdoe@example.com",
"Phone": "5554883849"
},
"PriceSet": "5c9a9f70-5bc4-4593-b516-cbd9344bf536",
"CollectionAssignedDriver": "44bc0a1d-ef24-48b5-a0cb-54181ce2dbaf",
"DeliveryAssignedDriver": "44bc0a1d-ef24-48b5-a0cb-54181ce2dbaf",
"CollectionArrivalWindow": {
"EarliestTime": "2019-04-08T15:00:00",
"LatestTime": "2019-04-09T00:00:00",
"Length": "09:00:00"
},
"DeliveryArrivalWindow": {
"EarliestTime": "2019-04-09T15:00:00",
"LatestTime": "2019-04-10T00:00:00",
"Length": "09:00:00"
},
"CollectionLocation": {
"Zone": {
"ID": "b723a724-d753-43b4-b8f0-4ffad0ed1c56",
"Name": "Sample Zone",
"PostalCodes": "11522, 11523, 11524"
},
"ID": "720bc7bf-35fa-458c-92a6-28b34c1a3c99",
"ContactName": "Cecilia Chapman",
"CompanyName": "Sample Inc.",
"AddressLine1": "711-2880 Nulla St.",
"AddressLine2": "Suite 201",
"City": "Roseville",
"State": "CA",
"PostalCode": "11523",
"Country": "United States of America",
"Comments": "A sample location",
"Email": "cchapman@example.com",
"Phone": "5558905487",
"Category": "Samples",
"LatitudeLongitude": "38.752125,-121.288010"
},
"DeliveryLocation": {
"Zone": {
"ID": "f62c0d7f-bd7c-4704-bab3-aafb41062bb1",
"Name": "Example Zone",
"PostalCodes": "48580, 48581"
},
"ID": "91d6c0fd-b129-4c14-a685-b710390b69f5",
"ContactName": "Tamara Howe",
"CompanyName": "Example Works LLC",
"AddressLine1": "3415 Main St",
"AddressLine2": "",
"City": "Sacramento",
"State": "CA",
"PostalCode": "94203",
"Country": "United States of America",
"Comments": "An example location",
"Email": "thowe@example.com",
"Phone": "5553264200",
"Category": "Samples",
"LatitudeLongitude": "38.5816,-121.4944"
},
"Status": {
"ID": "843f3634-906e-4d55-b053-0f866396cfc2",
"Name": null,
"Description": "Stuck in traffic",
"Timestamp": "2019-01-02T12:07:28",
"Level": 2
},
"UserDefinedFields": {
"Special Instructions": {
"Label": "Special Instructions",
"OrderID": "71052e79-2bab-46d4-8442-e2dfb0a08f60",
"ValueAsString": "",
"ValueAsDecimal": 0.0,
"ValueAsBoolean": false,
"ValueAsDate": "0001-01-01T00:00:00"
}
},
"UserMiscCompensations": [
{
"User": "44bc0a1d-ef24-48b5-a0cb-54181ce2dbaf",
"ID": "11946a29-85e5-449a-9e20-5f3a99c575a6",
"OrderID": "71052e79-2bab-46d4-8442-e2dfb0a08f60",
"Role": 2,
"Description": "Sample Money Compensation",
"Value": 10.0,
"Type": 1
},
{
"User": "44bc0a1d-ef24-48b5-a0cb-54181ce2dbaf",
"ID": "a1fe3b6e-9d65-497b-bc8e-df6a8fbfde2a",
"OrderID": "71052e79-2bab-46d4-8442-e2dfb0a08f60",
"Role": 2,
"Description": "Sample Time Compensation",
"Value": 60.0,
"Type": 2
}
],
"VehicleRequired": {
"ID": "00939a4b-7fe8-436e-9eb9-50a7f0359390",
"Name": "Standard Truck"
},
"PriceModifiers": [
{
"ID": "62ab4981-c0f7-4ca3-9231-4bdd41fc18d0",
"Name": "Sample Signature",
"CustomValue": 0.0,
"PercentCommissionable": 100.0,
"Price": 3.0,
"Type": 1,
"Input": -1
},
{
"ID": "ac852d2d-d6c5-4506-ad82-6a186611746a",
"Name": "Sample Tax",
"CustomValue": 0.0,
"PercentCommissionable": 100.0,
"Price": 19.95,
"Type": 5,
"Input": -1
}
],
"TaxTotal": 19.95,
"Subtotal": 21.8,
"ID": "71052e79-2bab-46d4-8442-e2dfb0a08f60",
"TrackingNumber": "1000346",
"RequestedBy": "John Doe",
"BasePrice": 18.8,
"CODAmount": 50.0,
"BasePriceType": 2,
"PriceAdjustment": 0.0,
"PriceModifierTotalCost": 22.95,
"Description": "Sample order for development purposes",
"Comments": "Sample order",
"DateSubmitted": "2019-01-01T20:00:00",
"RouteName": "Sample Route",
"StatusLevel": 2,
"CollectionArrivalDate": "2019-01-02T09:00:00",
"CollectionContactName": "Cecilia Chapman",
"CollectionCODRequired": false,
"CollectionSignatureRequired": false,
"DeliveryArrivalDate": "2019-01-04T19:00:00",
"DeliveryContactName": "Tamara Howe",
"DeliveryCODRequired": true,
"DeliverySignatureRequired": true,
"Distance": 18.8,
"Height": 1.6,
"Width": 1.17,
"Length": 0.85,
"Weight": 8.0,
"Quantity": 1,
"DeclaredValue": 100.0,
"ReferenceNumber": "50000256",
"PurchaseOrderNumber": "R9902365",
"IncomingTrackingNumber": "1000235",
"OutgoingTrackingNumber": "1000718",
"TotalCost": 41.75,
"SubmissionSource": "8"
}