List stock movements
Returns the stock ledger, newest first. Every row says what happened to
stock (kind) and carries a direct reference to what caused it, so a
merchant can answer “why is this number what it is?” from the data.
Kinds are received (goods arrived), allocated (stock promised to a
placed order), shipped (promised stock left), released (a promise
withdrawn) and adjusted (a manual correction, which always carries a
reason).
Movements are immutable — reversing one means writing its counterpart through the resource that caused it, which is why there is no create, update or delete here.
Filter with Ransack predicates such as q[kind_eq],
q[stock_level_id_eq], q[order_id_eq], q[fulfillment_id_eq] or
q[created_at_gteq].
kind is null on rows written before Spree 6.0 until
spree:migrate_stock_movements_to_typed_rows has run.
Required scope: read_stock (for API-key authentication).
Filters
Filter withq[<attribute>_<predicate>]=value, for example q[reason_cont]=…. Send a list as q[<attribute>_in][]=a&q[<attribute>_in][]=b. How filters work.
Filters through associations
Filters through associations
q[stock_level_id_eq]. The same predicates apply.created_at, exchange_id, fulfillment_id, id, kind, order_id, purchase_order_id, quantity, reason, return_id, stock_level_id, stock_receipt_id, stock_transfer_id, unit_cost, updated_at. Prefix a field with - to sort descending.
