> ## 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.

# Save dirty inventory

> Saves a specific inventory to the database if it has been modified.

Saves a specific inventory to the database if it has been modified.

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

  ```lua Example theme={null}
  -- Save specific inventory
  exports['jaksam_inventory']:saveDirtyInventory('police_stash_1')

  -- Save player inventory after important changes
  local success = exports['jaksam_inventory']:saveDirtyInventory(1)
  if not success then
      print('Failed to save inventory')
  end
  ```
</CodeGroup>

### Parameters

| Name          | Data Type        | Description                     |
| ------------- | ---------------- | ------------------------------- |
| `inventoryId` | string \| number | The ID of the inventory to save |

### Return value

| Name      | Data Type | Description                              |
| --------- | --------- | ---------------------------------------- |
| `success` | boolean   | True if inventory was saved successfully |


## Related topics

- [Save dirty inventories](/jaksam-inventory/functions/server/save-dirty-inventories.md)
- [Server](/jaksam-inventory/functions/server/index.md)
- [Commands](/jaksam-inventory/guides/commands.md)
- [Weapon Attachments](/jaksam-inventory/guides/weapon-attachments.md)
- [Customize Default Theme](/jaksam-inventory/guides/customize-theme.md)
