10.2 Saving products
The body is a list. The product is looked up in the distributor by metaCode (and batch, if any); if not found, it is added, and if found, it is updated. Fields not sent in an update are reset, so send all fields of the product.
| Field | Type | Required | Description |
|---|---|---|---|
distCode | text | Yes | Distributor code |
metaCode | text | Yes | Product code |
batch | text | No | Batch; if filled, the product code becomes metaCode-batch |
name, shortName | text | No | Product name and short name |
idMetaShape | number | No | 1 normal, 2 promotional, 3 consignment, 4 competitor |
idMinUnit, idDefUnit | number | No | Smallest and default unit: 0 piece, 1 box, 2 case |
kdvRatio, kdvRatio2 | number | No | VAT rate, as a fraction (0.20 = 20%) |
weight, volume, palette, unitCase, subUnit, fullCase, alcoholRate, epoint | number | No | Physical and logistics information |
barcode | text | No | Barcode |
noStock, isFinancial, dontSell, fractional, dayMetaControl | number | No | 1 = yes, 0 = no |
dayMetaLife | number | No | Shelf life, in days |
disabled | true/false | No | Update only: true = inactive |
units[] | list | No | Units: idUnit, amount (quantity in the smallest unit), name, shortName |
dic[] | list | No | Name translations: lang, value |
Price fields are not written by this method; use /prices for prices.
[{ "distCode": "TEST", "metaCode": "P0001", "idMetaShape": 1, "idMinUnit": 0, "idDefUnit": 2, "name": "Ürün A", "shortName": "ÜrnA", "kdvRatio": 0.2, "barcode": "869000000001", "dic": [{ "lang": "en", "value": "Product A" }], "units": [{ "idUnit": 0, "amount": 1, "name": "Adet", "shortName": "AD" }, { "idUnit": 2, "amount": 12, "name": "Koli", "shortName": "KL" }] }]
The response contains a separate result for each product; an error in one product does not block the others. If at least one product fails, the response is 400 and the failed product is marked with success: false.