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

# Inventory aging

> Inventory aging

### Request body

`InventoryAgingRequest`

<ParamField body="as_of" type="string,null">
  As-of date (`YYYY-MM-DD`); defaults to today when omitted.
</ParamField>

<ParamField body="layers" type="AgingLayerRequest[]" required />

### Responses

<ResponseField name="200" type="InventoryAgingResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/reports/inventory-aging' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "as_of": null,
    "layers": [
      {
        "product_id": null,
        "quantity": "string",
        "received_at": "string",
        "sku": "string",
        "unit_cost": "string"
      }
    ]
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "as_of": "string",
    "buckets": [
      {
        "label": "string",
        "max_days": null,
        "min_days": 1,
        "quantity": "string",
        "value": "string"
      }
    ],
    "total_quantity": "string",
    "total_value": "string"
  }
  ```
</ResponseExample>
