> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Stock Movements

Stock Movements record every change to inventory items such as when an order is received and allocated to a warehouse or a shipment is picked from the shelf.

## Methods

* [stock\_movement.list](#stock-movement-list)

***

## Entity Properties

* [Stock Movement](#stock-movement-properties)

***

## `stock_movement.list`

`stock_movement.list (null|object $filters, null|object $options)`

Retrieve list of stock movements.

### Parameters

<ParamField path="filters" type="object | null">
  [Filters](/merchant-api/search-filters) to apply to the request. Allowed properties for filtering: "id", "entity\_type", "entity\_action", "entity\_id", "product\_id", "sku", "created\_at", "warehouse\_id", "location", "adjustment\_reason\_code"
</ParamField>

<ParamField path="options" type="object | null">
  [Options](/merchant-api/search-options) to apply to the request.
</ParamField>

### Return Value

An array of [Stock Movements](#stock-movement-properties) or an empty array.

### Example Request

Get all stock movements:

```json title="Request" theme={null}
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "stock_movement.list"
    ]
}
```

Get all stock movements for warehouse "2":

```json title="Request" theme={null}
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "stock_movement.list",
        [
            {
                "warehouse_id": {
                    "eq": "2"
                }
            }
        ]
    ]
}
```

### Example Response

```json title="Response" theme={null}
{
    "result": {
        "results": [
            {
                "id": "12",
                "entity_type": "order",
                "entity_action": "create",
                "product_id": "4",
                "qty_expected": null,
                "qty_processed": null,
                "qty_putaway": null,
                "qty_available": "-1.0000",
                "qty_allocated": "1.0000",
                "qty_reserved": null,
                "qty_picked": null,
                "qty_backordered": null,
                "created_at": "2022-09-12T19:47:50+00:00",
                "sku": "12-345-6789",
                "comment": null,
                "warehouse_id": "2",
                "entity_id": "100000001",
                "location": "",
                "adjustment_reason_code": null
            }
        ],
        "totalCount": 1,
        "numPages": 1
    },
    "id": "1",
    "jsonrpc": "2.0"
}
```

### Error Codes

| code | message                                          |
| ---- | ------------------------------------------------ |
| 101  | Invalid filters given. Details in error message. |

## Entity Properties

### Stock Movement Properties

<Expandable title="Stock Movement Properties">
  <ParamField path="id" type="string">
    The internal stock movement ID.
  </ParamField>

  <ParamField path="entity_type" type="string">
    The "Type" property. Allowed values: "delivery", "order", "work\_order", "stock", "relocation".
  </ParamField>

  <ParamField path="entity_action" type="string">
    The "Action" property. Allowed values: "create", "edit", "cancel", "void", "adjust", "process", "unprocess", "putaway", "commit", "transfer", "ship", "unship", "pick", "unpick", "relocate", "pull", "push", "convert", "allocate", "deallocate", "correction", "assemble".
  </ParamField>

  <ParamField path="entity_id" type="string">
    The "Entity ID" property.
  </ParamField>

  <ParamField path="product_id" type="string">
    The internal product ID.
  </ParamField>

  <ParamField path="sku" type="string">
    The "Product SKU" property.
  </ParamField>

  <ParamField path="warehouse_id" type="string">
    The internal warehouse ID.
  </ParamField>

  <ParamField path="qty_expected" type="string">
    The "Expected" qty.
  </ParamField>

  <ParamField path="qty_processed" type="string">
    The "Processed" qty.
  </ParamField>

  <ParamField path="qty_putaway" type="string">
    The "Put-Away" qty.
  </ParamField>

  <ParamField path="qty_available" type="string">
    The "Available" qty.
  </ParamField>

  <ParamField path="qty_allocated" type="string">
    The "Allocated" qty.
  </ParamField>

  <ParamField path="qty_reserved" type="string">
    The "Reserved" qty.
  </ParamField>

  <ParamField path="qty_picked" type="string">
    The expected qty.
  </ParamField>

  <ParamField path="qty_backordered" type="string">
    The "Backordered" qty.
  </ParamField>

  <ParamField path="created_at" type="string">
    The "Timestamp" property.
  </ParamField>

  <ParamField path="comment" type="string">
    The "Comment" property.
  </ParamField>

  <ParamField path="location" type="string">
    The "Location" property.
  </ParamField>

  <ParamField path="adjustment_reason_code" type="string | null">
    The code of the structured Adjustment Reason recorded when an inventory adjustment was made (for example, a cycle count or manual correction). Allowed values: "cycle\_count", "found", "shrinkage", "damaged", "defective", "expired", "destroyed", "receiving\_error", "shipping\_error", "customer\_return", "sample", "other".
  </ParamField>
</Expandable>
