Obtain Dates
Returns the days on which a group of service variants can be executed together, in a single visit, at a location.
/api/integration/bundle/datesRequest
curl -X POST "https://uat.integration.cl.sodtrack-shared.sodtrack.com/api/integration/bundle/dates" \
-H "Authorization: Bearer $SODTRACK_TOKEN" \
-H "origin: <your-origin>"Base URL: https://uat.integration.cl.sodtrack-shared.sodtrack.com · other environments
Headers
| Name | Type | Description |
|---|---|---|
origin | string | — |
Responses
{
"dates": [
"2026-10-05",
"2026-10-06",
"2026-10-08",
"2026-10-09",
"2026-10-12",
"2026-10-13",
"2026-10-15",
"2026-10-16"
]
}Error responses for this endpoint follow the shared error reference.
Purpose
Returns the days on which a group of service variants can be executed together, in a single visit, at a location.
Use it after POST /api/integration/bundle/options: send the variants of one group, with the same quantities and addons, and then use POST /api/integration/bundle/times to get the start times of one of the returned days.
A group with a single variant returns the days available for that variant alone. Quantity and addons extend the duration of the visit exactly as they do when the booking is created.
Field Definitions
🔐 Authentication
| Field | Type | Required | Description |
|---|---|---|---|
x-api-key (header) | string | ✅ | External integration API key provided by Sodtrack. |
🧩 Service variants
| Field | Type | Required | Description |
|---|---|---|---|
variants | array | ✅ | Variants of the group. Between 1 and 10 items. The same type + value cannot be repeated. |
variants[].type | string | ✅ | How the variant is identified. One of: "variantId", "variantSku". |
variants[].value | string | ✅ | Sodtrack variant id (positive integer as a string) when type is "variantId", or the variant SKU (exact match) when type is "variantSku". |
variants[].quantity | number | ❌ | Quantity of the variant. Minimum 1. Defaults to 1. |
variants[].addons | array | ❌ | Addons of the variant. The same type + value cannot be repeated within a variant. |
variants[].addons[].type | string | ✅ when addon sent | How the addon is identified. One of: "addonId", "addonReference". |
variants[].addons[].value | string | ✅ when addon sent | Sodtrack addon id (positive integer as a string) when type is "addonId", or the addon reference when type is "addonReference". |
variants[].addons[].quantity | number | ✅ when addon sent | Quantity of the addon. Minimum 1. |
🏠 Location
| Field | Type | Required | Description |
|---|---|---|---|
addressId | number | ✅ when coordinates not sent | Id of an existing Sodtrack address. |
coordinates | object | ✅ when addressId not sent | Location of the visit. |
coordinates.lat | number | ✅ when coordinates sent | Latitude. |
coordinates.lng | number | ✅ when coordinates sent | Longitude. |
When both are sent,
addressIdis used.
📅 Search range
| Field | Type | Required | Description |
|---|---|---|---|
startDate | string | ❌ | First day of the search (YYYY-MM-DD). Defaults to today. |
quantityOfDays | number | ❌ | Number of days after startDate included in the search. Between 1 and 31. Defaults to 30. |
Example Request
{
"variants": [
{
"type": "variantSku",
"value": "SKU-INSTALLATION",
"quantity": 2,
"addons": [
{ "type": "addonReference", "value": "ADDON-EXTRA-HOSE", "quantity": 1 }
]
},
{ "type": "variantSku", "value": "SKU-MAINTENANCE" },
{ "type": "variantId", "value": "63", "quantity": 2 }
],
"addressId": 17,
"startDate": "2026-10-05",
"quantityOfDays": 14
}Single variant, by coordinates, from today:
{
"variants": [
{ "type": "variantId", "value": "52" }
],
"coordinates": { "lat": -33.42, "lng": -70.6 }
}Response Example
201 Created
{
"dates": [
"2026-10-05",
"2026-10-06",
"2026-10-07",
"2026-10-08",
"2026-10-09",
"2026-10-12"
]
}Response Fields
| Field | Type | Description |
|---|---|---|
dates | string[] | Days (YYYY-MM-DD) on which the group can be executed in a single visit. Empty when there is no availability. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | Validation message, e.g. variants should not be empty, startDate must be a valid ISO 8601 date string | A field is missing, has an invalid value, or a variant or addon is repeated. |
400 Bad Request | NO_VARIANT_FOUND_FOR_ID / NO_VARIANT_FOUND_FOR_SKU | A variant could not be found by its id or SKU. |
400 Bad Request | VARIANT_ID_IS_NOT_A_VALID_POSITIVE_INTEGER | A "variantId" value is not a positive integer. |
400 Bad Request | ADDON_ID_IS_NOT_A_VALID_POSITIVE_INTEGER | An "addonId" value is not a positive integer. |
400 Bad Request | `NO_ACTIVE_ADDON_OPERATION_FOUND_FOR: ADDON_{ID | SKU}: {value} VARIANT_ID: {variantId}` |
400 Bad Request | NO_COVERAGE_FOR_ADDON: {addonId} (Reference: {reference}) | The addon is not offered at the location. |
401 Unauthorized | — | The API key is missing or invalid. |
404 Not Found | ADDRESS_NOT_FOUND | addressId does not match an existing address. |
500 Internal Server Error | — | Unexpected server error. Contact Sodtrack support. |
Business Rules & Constraints
When a day is available
A day is returned when at least one provider that executes every variant of the group at the location has enough free time to execute all of them back to back, within the operating hours of the variants and respecting the booking anticipation, capacity and holidays that apply to a booking.
When several variants have different booking anticipation, the longest one applies to the whole group.
Duration of the visit
Each variant counts as variant duration × quantity, plus addon duration × addon quantity for each of its addons, the same duration the booking gets when it is created. The visit needs the sum of the durations of all the variants of the group in consecutive time. Very long visits that do not fit in one working day are searched as multi-day visits, as with any booking.
Variants without coverage
If any variant of the group is not offered at the location, the group cannot be executed there and dates is empty.
Search range
The search starts on startDate (today by default) and covers the following quantityOfDays days.
Identification
- A variant can be identified by id or by SKU, and both can be mixed in the same request.
- If two entries identify the same variant (for example its id and its SKU), the first one is used and the variant is counted once.
Addons
Each addon must be offered for its variant and must be offered at the location. Otherwise the request is rejected (see Error Responses); addons are never silently ignored.
Scope
Availability is computed for bookings without origin address, without products with a promised delivery date and with automatic provider assignment. When the booking is created with any of them, the offered days are indicative: the travel time from the origin, the delivery date of the products or the chosen provider may leave no availability for the group.