post https://api.tilby.com/v2/stock_movements
Returns a Json with the data of the new Stock Movements.
Stock movements type
Each Stock Movement must be address to a stock location. If non is set, default will be 1 (STOCK_SALES)
Each Stock Movement can be one of these three types:
- load (increase quantity)
- unload (decrease quantity)
- setup (set quantity)
and can be referred to:
- Item (item_id is not null and raw_material is null)
- Raw Material (raw_material_id is not null and item_id is null)
Stock movements causes
Load causes:
- buy
- refund
- gift
- replacement
- production
- bom_production
- transfer
- positive_adjustment
- stock_transfer
- supplier_order
ATTENTION load_cause can not be set by api on stock_transfer
Unload causes:
- sale
- gift
- internal_use
- move
- damage
- theft
- waste
- supplier_return
- transfer
- replacement
- negative_adjustment
- production
- stock_transfer
NOTE:
If unload_cause is set to stock_transfer, you need to set the target stock location in the field target_location_id. In this case 2 movements will be generated:
- 1 movement of unload on the stock_location_id with unload_cause set to stock_transfer
- 1 movement of load on target_location_id with load_cause set to stock_transfer