Get bag movements by service

This endpoint returns all bag movements for a service over a period not exceeding 60 days.

GET /api/v1/business/{businessId}/service/{serviceId}/bag-movements/from/{yyyy-MM-dd}/to/{yyyy-MM-dd}

If the data included in the request is correct —both businessId and serviceId— the response will contain a list of bag movements within the specified interval in the URL.

Below is an example of the response:

[
    {
        "employeeId": "152017",
        "destinationBagId": "OT",
        "destinationDate": "2024-09-24",
        "value": 60.0,
        "reason": "Overtime adjustment"
    },
    {
        "employeeId": "152017",
        "destinationBagId": "OT",
        "destinationDate": "2024-09-25",
        "value": 120.0,
        "reason": "Overtime adjustment"
    },
    {
        "employeeId": "1006349",
        "destinationBagId": "OT",
        "destinationDate": "2024-09-24",
        "value": 60.0,
        "reason": "Overtime adjustment"
    },
    {
        "employeeId": "1006357",
        "destinationBagId": "DT",
        "destinationDate": "2024-09-23",
        "value": 2.0,
        "reason": "Add sundays worked"
    },
    {
        "employeeId": "152017",
        "originDate": "2024-09-23",
        "destinationDate": "2024-09-23",
        "value": 120.0,
        "reason": "Regularization"
    }
]

The response will contain the data defined for each movement. If the external identifier of the origin or destination bag is not set in the system and the movement was made from the interface, that information will not be returned (as seen in the last movement of the example).

Considerations

If the service specified in the URL does not exist within the business, the request will return a 404 Not Found error, specifying not exists in the message.

If no movements are found for the specified period, the request will return an empty array [].

If the interval specified in the URL exceeds 60 days, the request will return a 406 Not Acceptable error, specifying The request exceeded the maximum number of days allowed (60 days max).

What is a bag?