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
[
  {
    "employeeId": "string",
    "originBagId": "string",
    "originDate": "string",
    "destinationBagId": "string",
    "destinationDate": "string",
    "value": 0,
    "reason": "string"
  }
]
Details
  • employeeId*: the identifier of the employee associated with the movement.

  • originBagId: the identifier of the origin bag.

  • originDate: the date of the origin bag in yyyy-MM-dd format.

  • destinationBagId*: the identifier of the destination bag.

  • destinationDate*: the date of the destination bag in yyyy-MM-dd format.

  • value*: the value to be transferred to the destination bag.

  • reason: the reason for the movement.

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.

What is a bag?