Get locations by product

This endpoint returns all the enabled tasks within a product.

GET /api/v1/businesses/{businessId}/product/{productId}/locations

If the data provided in the request is correct —both businessId and productId—, the response will include the enabled tasks for each zone within the product.

Here is a sample response:

[
    {
        "color": "#c7d0e9",
        "description": "Opening tasks",
        "name": "OPENING",
        "shortName": "OP",
        "requiredLevel": 2,
        "priority": 4,
        "maxResources": 1,
        "type": "FIXED",
        "shouldAvoidOvercover": true,
        "system": false,
        "category": "Fixed tasks",
        "product": "0001-GENERAL",
        "id": "01",
        "active": true,
        "zone": "General"
    },
    {
        "color": "#c7d0e9",
        "description": "Opening tasks",
        "name": "OPENING",
        "shortName": "OP",
        "requiredLevel": 2,
        "priority": 4,
        "maxResources": 1,
        "type": "FIXED",
        "shouldAvoidOvercover": true,
        "system": false,
        "category": "Fixed tasks",
        "product": "0001-GENERAL",
        "id": "01",
        "active": true,
        "zone": "Z1"
    },
    {
        "color": "#425ea9",
        "description": "Replenishment of merchandise",
        "name": "REPLACEMENT",
        "shortName": "REP",
        "requiredLevel": 2,
        "priority": 3,
        "type": "FIXED",
        "shouldAvoidOvercover": false,
        "system": false,
        "category": "Operational",
        "product": "0001-GENERAL",
        "id": "05",
        "active": true,
        "zone": "General"
    }
]

As seen in the example, if a task is enabled in multiple zones of the product, the response will include one entry for each zone. In this case, the OPENING task is enabled in both the General and Z1 zones, while the REPLACEMENT task is only enabled in the General zone.

The level of detail in the response will depend on the information previously defined for the task. For example, if no description (description) was provided, that field will not be included.

Considerations

If there are no active tasks in the specified product, the response will be an empty array [].

If the product provided in the URL does not exist in the business, the request will return a 404 Not Found error, with the message not exits.

What is a task?

How is the structure of a task?