Check Options
Given a set of service variants and a location, returns which variants have no coverage there and the different ways of grouping the covered ones into bundles: groups of variants that a single provid…
/api/integration/bundle/optionsRequest
curl -X POST "https://uat.integration.cl.sodtrack-shared.sodtrack.com/api/integration/bundle/options" \
-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
{
"serviceVariantsWithoutCoverage": [
{
"type": "variantId",
"value": "52"
}
],
"groupingOptions": [
[
[
{
"type": "variantSku",
"value": "SKU-INSTALLATION"
},
{
"type": "variantSku",
"value": "SKU-MAINTENANCE"
}
],
[
{
"type": "variantId",
"value": "63"
}
]
],
[
[
{
"type": "variantSku",
"value": "SKU-INSTALLATION"
},
{
"type": "variantId",
"value": "63"
}
],
[
{
"type": "variantSku",
"value": "SKU-MAINTENANCE"
}
]
]
]
}Error responses for this endpoint follow the shared error reference.
Purpose
Given a set of service variants and a location, returns which variants have no coverage there and the different ways of grouping the covered ones into bundles: groups of variants that a single provider can execute together, in the same visit.
Use it as the first step of a bundled booking: pick one grouping option, then use POST /api/integration/bundle/dates and POST /api/integration/bundle/times with the variants of each group to find when that group can be scheduled.
Each variant can carry its quantity and its addons. They extend the duration of the visit exactly as they do when the booking is created, so the grouping that checks providers' agendas accounts for the real duration of each group.
Variants are returned identified the same way they were requested (by id or by SKU), so the response can be matched directly against the request.
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 | ✅ | Service variants to 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 and grouping
| Field | Type | Required | Description |
|---|---|---|---|
startDate | string | ❌ | First day considered when checking agendas (YYYY-MM-DD). Defaults to today. |
quantityOfDays | number | ❌ | Number of days after startDate considered when checking agendas. Between 1 and 31. Defaults to 30. |
groupingMode | string | ❌ | How groups are built. One of: "all_maximal_by_coverage", "all_maximal_by_agenda", "fewest_visits". Defaults to "all_maximal_by_coverage". See Grouping modes. |
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": "52" },
{ "type": "variantId", "value": "63", "quantity": 2 }
],
"addressId": 17,
"startDate": "2026-10-05",
"quantityOfDays": 14,
"groupingMode": "all_maximal_by_agenda"
}
Minimal request, by coordinates and with the default grouping mode:
{
"variants": [
{ "type": "variantId", "value": "32" },
{ "type": "variantId", "value": "33" }
],
"coordinates": { "lat": -33.42, "lng": -70.6 }
}
Response Example
201 Created
{
"serviceVariantsWithoutCoverage": [],
"groupingOptions": [
[
[
{ "type": "variantSku", "value": "SKU-INSTALLATION" },
{ "type": "variantSku", "value": "SKU-MAINTENANCE" },
{ "type": "variantId", "value": "63" }
],
[
{ "type": "variantId", "value": "52" }
]
]
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
serviceVariantsWithoutCoverage | array | Requested variants that no provider executes at the location. They are not part of any group. |
serviceVariantsWithoutCoverage[].type | string | Identification type, as sent in the request. |
serviceVariantsWithoutCoverage[].value | string | Identification value, as sent in the request. |
groupingOptions | array | Alternative ways of grouping the covered variants. Each option is an array of groups; each group is an array of variants. Empty when no variant has coverage. |
groupingOptions[][] | array | One group: variants that one provider can execute together in a single visit. A group with a single variant is a visit for that variant alone. |
groupingOptions[][][].type | string | Identification type, as sent in the request. |
groupingOptions[][][].value | string | Identification value, as sent in the request. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | Validation message, e.g. variants should not be empty, quantityOfDays must not be greater than 31 | 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
Coverage
A variant has coverage at the location when at least one provider executes it there. Variants without coverage are listed in serviceVariantsWithoutCoverage and never appear in groupingOptions. Every covered variant appears exactly once in every option.
Grouping modes
| Mode | Behavior |
|---|---|
all_maximal_by_coverage (default) | Returns every option in which no group can be merged with another. A group only needs one provider that executes all of its variants at the location; agendas are not checked, so startDate and quantityOfDays are not used. |
all_maximal_by_agenda | Same as above, but a group of two or more variants also needs one provider with free time to execute all of them back to back on the same day, within the search range and the variants' operating hours. |
fewest_visits | Returns a single option: the one with the fewest groups, checking agendas as all_maximal_by_agenda. Ties go to the option with the biggest groups first. |
Each group is checked on its own: two groups of the same option may rely on the same provider on the same day.
Duration of a group
Each variant counts as one visit of variant duration × quantity, plus addon duration × addon quantity for each of its addons, the same duration the booking gets when it is created. A group needs the sum of the durations of its variants. Higher quantities or more addons can therefore split variants that would otherwise be grouped together.
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 evaluated once.
-
Variants and addons are always returned with the same
typeandvaluesent in the request.
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 travel time from the origin, the delivery date of the products or the chosen provider may change which groups are actually feasible.