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

# Get inventory

> Gets complete data about an inventory including its items, weight limits, and metadata.

Gets complete data about an inventory including its items, weight limits, and metadata.

<CodeGroup>
  ```lua Export theme={null}
  exports['jaksam_inventory']:getInventory(inventoryId)
  ```

  ```lua Example theme={null}
  -- Get a player's inventory
  local inventory = exports['jaksam_inventory']:getInventory(1) -- player with server ID 1

  -- Get a stash inventory
  local stashInv = exports['jaksam_inventory']:getInventory('police_stash_1')

  if inventory then
      print(inventory.totalWeight) -- prints current weight
      print(inventory.limits.maxWeight) -- prints max weight allowed
      print(json.encode(inventory.items, {indent = true})) -- {["SLOT-4"] = {name = "itemName", amount = 1, metadata = {}}}
  end
  ```
</CodeGroup>

### Parameters

| Name          | Data Type        | Description                                                                                   |
| ------------- | ---------------- | --------------------------------------------------------------------------------------------- |
| `inventoryId` | string \| number | The inventory ID to get data for. Can be a player server ID (number) or inventory ID (string) |

### Return value

| Name        | Data Type    | Description                                                                               |
| ----------- | ------------ | ----------------------------------------------------------------------------------------- |
| `inventory` | table \| nil | `{id, label, type, options, items, totalWeight, limits: {maxSlots, maxWeight}, metadata}` |


## Related topics

- [Get inventory](/jaksam-inventory/functions/client/get-inventory.md)
- [Get inventory ID from plate](/jaksam-inventory/functions/server/get-inventory-id-from-plate.md)
- [Client](/jaksam-inventory/functions/client/index.md)
- [Server](/jaksam-inventory/functions/server/index.md)
- [Get vehicle inventory limits](/jaksam-inventory/functions/client/get-vehicle-inventory-limits.md)
