How to manage product balances or inventory lines with CSV
Export, import, and delete inventory lines and manage variant values using CSV files in the Products › Stock view. Speed up mass updates securely.
Import product balances in the Data Transfer view
Before converting to CSV, decide which balance or structure you are updating. Regular inventory lines, inventory-specific balances, and variant values use different profiles and file structures. The amount of a regular inventory import is always the new absolute balance, not an addition or subtraction to the current value.
- Product inventory import: adds or updates a regular inventory line and its absolute quantity.
- Warehouse-specific export and import: handles the balance of a named warehouse without changing the regular product balance of the online store.
- Export and import of variant values: handles variant alternative values, not balance.
- Delete import of product inventory lines: deletes a line in its own separate profile.
Export the current data first, change only the necessary columns, preview the file and fix any errors before executing. Finally, check both the import report and the remaining balances for the product.
The CSV for import uses a comma as a separator. The file must contain products_stock_quantity and at least one targeting column: products_stock_id , products_stock_model , or products_model . Use a sample of 1-5 rows first and preview the rows to be created, updated, and invalidated before performing a large bulk update.
Allowed columns for inventory import
AI Commerce 's Product stock import accepts the columns products_stock_id , products_model and products_stock_variants for targeting. The editable columns are products_stock_quantity , products_dropshipping_stock , products_restock , products_stock_center , products_stock_model , products_stock_barcode , products_stock_shelf , products_api_id , products_stock_api_id , products_stock_price , and products_stock_price_original .
Headers must be unique, and the file must not contain any unknown columns. Integer fields accept an integer; Unicode minus is normalized to a regular minus. In price fields, the comma is converted to a period before numeric processing. Imported prices are rounded to six decimal places based on the product's package size when the package size is greater than 1, and to two decimal places otherwise.
Warehouse line allocation and adding a new line
AI Commerce 's inventory import first matches the row with a positive products_stock_id value and then with products_stock_model value. If neither matches the current inventory row, the import resolves the product products_model value and uses products_stock_variants variant combination with it. The existing combination is updated; otherwise, a new inventory row is added for the product.
The new inventory line's products_stock_quantity is set to the CSV value. If the quantity changes, the change is recorded in the inventory history with the reason CSV stock import . After execution, the total product quantity is synchronized from the sum of the inventory lines. The preview and execution summaries are reviewed for created, updated, skipped, and failed lines, as well as the reasons for each line.
Delete inventory lines with a separate CSV profile
AI Commerce bulk deletion of inventory lines is done using the Product Inventory Deletion profile in the Data Transfer view. The only header in the deletion file is products_stock_model , and each data line specifies the inventory SKU of the inventory line to be deleted. Empty values, unknown SKUs, and duplicates of the same SKU are displayed as errors or skips in the preview.
The deletion profile does not use a row-specific delete column or CONFIRM value. The destructive operation is confirmed in a separate execution step. A successful deletion deletes the matched inventory line, posts the deleted quantity as a negative inventory history entry with the reason Destroyed stock via CSV , and resynchronizes the product total quantity.
Export and import warehouse-specific balances
Warehouse-specific balances are managed for named warehouses and supplier warehouses using the Warehouse-specific export and Warehouse-specific import profiles in the Data transfer view . The export includes all warehouse-specific balances, including, for example, the TME warehouse. The TME balance is checked in this export, as it is separate from the online store product balance and does not appear in the product's regular inventory lines or their CSV export.
The columns in the warehouse-specific CSV file are products_id , products_model , warehouse_id , warehouse_code , and products_stock_quantity . The identifiers products_id and warehouse_id identify the row. The product code and warehouse code must match the identifiers to prevent a change to the wrong product or warehouse.
The import sets the balance of the product and inventory combination to the absolute amount in the CSV file. It adds the missing inventory-specific balance or updates the current one, but does not change the product balance in the online store. Missing combinations in the file are left as is. The preview shows errors before confirmation, and the import is not limited to 100 rows.
If the inventory balance is maintained by a vendor integration, such as TME, the next update of the integration may overwrite the value imported via CSV. Use export to check balances and import only when you intend to maintain the balance for that inventory manually.
Export and import regular inventory lines
Regular inventory lines are exported and imported using profiles in the Data Transfer view. Always download a fresh template file for the profile you are using and fill it in as is: the allowed headers in the profile determine which columns are read. Run the import on a small sample first and check the result on the product inventory lines before running the entire dataset.
Mass deletion of inventory lines has its own profile and file format. Its header is products_stock_model , and each inventory SKU to be deleted is written to its own line. The deletion cannot be undone, so keep the original export as unchanged return material.
Export and import variant values
Variant values are handled in their own profile in the Data Transfer view. Use the profile template file and keep the product option code and value code exactly the same as in the catalog; any unknown code is ignored. Do not mix file formats from different profiles. Inventory-specific balances are not part of the variant value profile, but are handled in separate inventory-specific export and import profiles. Importing variant values does not change the balance of the product, regular inventory line, or named inventory.
Secure CSV workflow for inventory lines
AI Commerce 's secure CSV workflow for inventory lines always uses a fresh template from the same profile or the allowed headers from the profile. Keep the original export as a rollback point, change only the necessary columns, and keep tags and headers unchanged.
Test the import with 1-5 rows, check the preview and execution summary, and finally verify the inventory line quantity, inventory SKU, prices, shelf location, and total product balance. Depreciation is done with its own depreciation profile, not with the empty quantities of a regular inventory import. CSV stock import and Destroyed stock via CSV entries in the inventory history are expected when the quantity is changed or the row is deleted.