Create Batch
The "Create Batch" API endpoint requires a unique batchExternalId, dispatch details specifying scheduling and reference times, sorting parameters to prioritize order dispatch by fields like deliveryDistance, and optionally order details, with example usage shown via a POST request including headers and JSON body, returning status codes such as 201 for success or 400 for errors.
Parameters
batchExternalId (string, required)
Unique ID of the batch. This is usually the ID generated in your system. Use this for easier identification of the batch of orders.
dispatch (object, required)
Batch dispatch details.
sortBy (object, required)
Parameters to set the priority of dispatch for orders in a batch.
orders (array of objects)
Order details.
Example Request
curl --request POST \
--url https://sandbox.api.deliverysolutions.co/api/v2/batches \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'tenantId: YOUR_TENANT_ID' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-compression: true' \
--data '
{
"dispatch": {
"type": "scheduled",
"scheduledBy": "absolute",
"basedOn": "pickupTimeStartsAt",
"referTo": "firstPickupTime"
},
"sortBy": {
"type": "asc",
"sortField": "deliveryDistance"
}
}
'
Example Responses
201- Create Batch Response400- Invalid values Error400- Required Fields Missing Error
Related
Check Delivery Assurance
The Delivery Assurance service offers five key checks—Store Boundary, DSP, Store Boundary + DSP, Confidence Score, and Return Confidence Score—to verify delivery coverage and reliability based on store boundaries, provider availability, and confidence metrics, with specific requirements such as providing pickup and dropoff times for time-window checks, restrictions on provider configurations, caching options to reduce latency, and current availability of confidence scores only in the U.S., while excluding business rules and orchestration engine usage.
Delivery Solutions API Doc - Premium
The Delivery Solutions API documentation provides sandbox and production base URLs and portals, instructions for importing and running a Postman collection including a pre-script request, and specifies that authentication requires passing a generated API key and tenantId in request headers while keeping the key secure.
Delete Boundary
The "Delete Boundary" API endpoint requires a unique integer boundaryId to delete a specific boundary, responds with a 200 status on success or 400 on bad request, and includes example cURL request headers such as tenantId, x-api-key, and x-compression.
Get Order by External ID
The "Get Order by External ID" API allows retrieval of an order using a unique external ID, optionally forcing an update to fetch the latest order details from the provider (if supported), returning the order data with possible error information, and uses HTTP status codes 200, 400, or 404 to indicate success or failure.
Create Order
The "Create Order" API request requires parameters such as order type (delivery, in-store pickup, curbside, or shipping), a required unique storeExternalId and orderExternalId, orderValue, deliveryContact, and deliveryAddress (except for pickup types), with optional fields like groupId, tips, pickupTime, dropoffTime, and package details to facilitate accurate delivery estimates and provider selection.
Edit Boundary
The "Edit Boundary" API requires a unique integer boundaryId and an array of boundary objects with a mandatory status field set to either "active" or "inactive" to modify a specified boundary, returning a 200 status code on success or 400 on error.