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.

FieldTypeRequiredDescription
distCodetextYesDistributor code
metaCodetextYesProduct code
batchtextNoBatch; if filled, the product code becomes metaCode-batch
name, shortNametextNoProduct name and short name
idMetaShapenumberNo1 normal, 2 promotional, 3 consignment, 4 competitor
idMinUnit, idDefUnitnumberNoSmallest and default unit: 0 piece, 1 box, 2 case
kdvRatio, kdvRatio2numberNoVAT rate, as a fraction (0.20 = 20%)
weight, volume, palette, unitCase, subUnit, fullCase, alcoholRate, epointnumberNoPhysical and logistics information
barcodetextNoBarcode
noStock, isFinancial, dontSell, fractional, dayMetaControlnumberNo1 = yes, 0 = no
dayMetaLifenumberNoShelf life, in days
disabledtrue/falseNoUpdate only: true = inactive
units[]listNoUnits: idUnit, amount (quantity in the smallest unit), name, shortName
dic[]listNoName 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.