Add bag movements
This endpoint allows to record bag movements.
POST /api/v1/businesses/{businessId}/bagsMovements
Below is a detailed explanation of each of the fields that can form part of the request body, with some being mandatory for a successful request.
Mandatory fields are marked with an asterisk (*). |
Request body
JSON Analysis |
---|
Details
|
Request example
After analyzing the different fields, here’s an example of the request body:
[
{
"employeeId": "1006349",
"destinationBagId": "OT",
"destinationDate": "2024-09-23",
"value": 60,
"reason": "Overtime adjustment"
},
{
"employeeId": "1006357",
"destinationBagId": "SW",
"destinationDate": "2024-09-23",
"value": 2,
"reason": "Add sundays worked"
}
]
As shown in the example, movements can be registered for different employees in the same request. Movements for different bags can also be registered, and there is no requirement for an origin bag.
If the request is successful (201 Created
), the movements will be reflected in Scheduling > Bag report.
Considerations
If a bag does not have an external identifier defined in the system, no movements can be sent for that bag.
The origin bag (originBagId
) can be any existing bag within the business, including the destination bag (destinationBagId
).
The value
field depends on the bag’s configuration in the system.
If the data type is Numeric value ("dataType": "NUMERIC"
), the whole number will be added to the bag.
However, if the data type is Hours and minutes ("dataType": "TIME"
), the value will be recorded in minutes ("value": 60
= 1 hour).
If the employee identifier does not match any employee within the business, the request will return a 404 Not Found
error, indicating Person X does not exist.
Useful links
What is a bag?