[preview] Upsert orders
Atomically creates or updates up to 250 canonical orders.
<b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
To use this endpoint, select Write Routes under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should NOT rely on these APIs to build business critical applications
-
Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
-
When an endpoint becomes generally available, it will be announced in the API changelog.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
Request
- Base URLhttps://api.samsara.com
- AuthHTTP bearer
Request body
Example request
{
"data": [
{
"customerProperties": [
{
"key": "purchaseOrderNumber",
"value": "PO-12345"
}
],
"externalIds": {
"tmsOrder": "12345"
},
"id": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"samsaraCustomerOrderName": "Order 12345",
"taskIdsToRemove": [
"Nulla id dolorum molestiae officiis.",
"Tenetur vel neque aut ad.",
"Quia officiis facilis labore eius.",
"Non qui aut autem."
],
"tasks": [
{
"customerProperties": [
{
"key": "purchaseOrderNumber",
"value": "PO-12345"
}
],
"dispatcherNotes": "Customer requires lift gate",
"driverNotes": "Use loading dock 4",
"hubId": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"id": "12345678",
"positionConstraintType": "none",
"quantities": [
{
"capacityId": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"label": "pallets",
"value": 12
}
],
"serviceDurationSeconds": 900,
"serviceLocation": {
"addressId": "12345678",
"customAddress": {
"addressLine1": "123 Main St",
"addressLine2": "Dock 4",
"city": "Oakland",
"country": "US",
"formattedAddress": "123 Main St, Oakland, CA 94607",
"latitude": 37.8044,
"longitude": -122.2712,
"postalCode": "94607",
"state": "CA"
},
"serviceLocationType": "savedAddress"
},
"serviceWindowIdsToRemove": [
"Ullam molestiae qui culpa.",
"Odit reiciendis harum ea rerum."
],
"serviceWindows": [
{
"endTime": "2026-07-01T11:00:00Z",
"id": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"startTime": "2026-07-01T09:00:00Z"
}
],
"taskType": "delivery"
}
]
}
]
}Response
OK response.
Example response
{
"requestId": "1f7f5081-9f8e-4b68-8b85-97dbe4b46d7e",
"responses": [
{
"data": {
"createdAtTime": "1990-08-31T23:49:19Z",
"customerProperties": [
{
"key": "purchaseOrderNumber",
"value": "PO-12345"
}
],
"externalIds": {
"Atque error at mollitia.": "Non sed sed sed quam et delectus.",
"Et ea.": "Enim aspernatur sit soluta provident et sit.",
"Eum expedita omnis quos repellendus.": "Aut sed est quisquam ut voluptas."
},
"id": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"samsaraCustomerOrderName": "Order 12345",
"tasks": [
{
"createdAtTime": "1977-01-10T23:36:08Z",
"customerProperties": [
{
"key": "purchaseOrderNumber",
"value": "PO-12345"
}
],
"dispatcherNotes": "Customer requires lift gate",
"driverNotes": "Use loading dock 4",
"hubId": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"id": "12345678",
"positionConstraintType": "unknown",
"quantities": [
{
"capacityId": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"id": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"label": "pallets",
"value": 0.23962707185822993
}
],
"routeId": "12345678",
"serviceDurationSeconds": 1920015009061035500,
"serviceLocation": {
"addressId": "12345678",
"customAddress": {
"addressLine1": "123 Main St",
"addressLine2": "Dock 4",
"city": "Oakland",
"country": "US",
"formattedAddress": "123 Main St, Oakland, CA 94607",
"latitude": 0.8920050879069387,
"longitude": 0.8199449418715566,
"postalCode": "94607",
"state": "CA"
},
"serviceLocationType": "unknown"
},
"serviceWindows": [
{
"endTime": "1975-07-07T21:36:20Z",
"id": "018f7b62-7d55-7b9e-a92f-2a6b7ff10392",
"startTime": "1975-02-20T04:43:33Z"
}
],
"taskType": "unknown",
"updatedAtTime": "2014-02-20T05:13:14Z"
}
],
"updatedAtTime": "2003-10-18T15:58:15Z"
},
"message": "data[0].tasks[0].taskType is invalid",
"status": 7796043317718989000
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.