Stocks Import
The task reads a stock file and writes the quantities onto your products, and nothing else. It is separate from Products Import, because stock changes far more often than an article does: an hourly stock list from the supplier runs on it without touching the whole catalogue.
What gets transferred
Per row read the stock quantity of one product, one per store. On top of that come the product's number fields, where you assign them.
Descriptions, prices, categories and images are left untouched by this task, even where the file carries them. The plan has no section for them, and that is exactly the point of the separation.
How the transfer plan is built
Four sections.
| Section | What sits in it |
|---|---|
| Layout | The record sets: which level of the file is read, what the product is recognized by, and which rows are passed over |
| Selection | Whether an unknown product is created, and which further channels it is marked for |
| Numbers | Product Number, Manufacturer Product Number and EAN |
| Stocks | One record set per store, with Quantity and the remaining fields of the stock |
TRADElube finds the product belonging to a row through the Mapping assignment on the record set. It carries the same value as in the product import, which is why the two tasks fit together without further ado: whoever takes the supplier's identifier as the mapping in the product import takes it here too. Where the stock file does not carry that identifier but only the article number, the Existing Item row in the Selection section helps, which looks the product up through a script.
New Item is unticked out of the box, and that belongs to this task: a row with no product behind it is skipped instead of being created as an article carrying nothing but a quantity. Tick the row only where the stock file also holds your range.
Each store gets a record set of its own in the Stocks section. Whoever keeps one store has exactly one and picks the quantity column there. Whoever keeps two has two and needs either a column per store or a selection that tells the rows apart.
Special features and limits
A product missing from the stock file keeps the stock of the last execution. The import writes what the file says and sets nothing to zero that it does not name. To bring discontinued articles down to zero, carry them in the file with quantity 0.
In the other direction this task does not exist. To write your stock out as a file, take Products Export, where stock goes along as a section.
Further reading
- Custom: data formats, endpoints and the other six tasks
- Products Import (Custom): the full article instead of its quantity alone
- Stock (concepts): where stock comes from and what it says
- Stores (reference): the stores appearing as record sets in the Stocks section
- Transfer plan (concepts): layout, record set, grouping and replication