# REST POST to /products - can I create supplier prices?

**URL:** <https://www.dolibarr.org/forum/t/rest-post-to-products-can-i-create-supplier-prices/19320>\
**Category:** Developing for Dolibarr\
**Created:** [July 16, 2020, 3:46pm UTC](https://www.dolibarr.org/forum/t/rest-post-to-products-can-i-create-supplier-prices/19320 "2020-07-16T15:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![egils](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@egils](https://www.dolibarr.org/forum/u/egils)\
**Post date:** [July 16, 2020, 3:46pm UTC](https://www.dolibarr.org/forum/t/rest-post-to-products-can-i-create-supplier-prices/19320/1 "2020-07-16T15:46:31Z")

</div>

I looked att the output in 9.0.1 and could not find anything corresponding to supplier prices lines.  
{  
“label”: “Hartsbromsklossar för Shimano, Promax, Tektro skivbroms”,  
“description”: “suitable for brakes of following brand(s) Promax\r\nsuitable for brakes of following brand(s) Shimano (no original spare part)\r\nsuitable for brakes of following brand(s) Tektro (no original spare part)\r\nDessa skivbromsbelägg är tillverkade av harts och metall, de skyddar effektivt bromsskivan. Tyst under bromsning, hartsplatta med lågt brus och utmärkt effektmodulering.”,  
“type”: “0”,  
“price”: “0.00000000”,  
“price\_ttc”: “0.00000000”,  
“price\_min”: “0.00000000”,  
“price\_min\_ttc”: “0.00000000”,  
“price\_base\_type”: “HT”,  
“multiprices”: {  
“1”: “13.00000000”,  
“2”: “0.00000000”,  
“3”: “0.00000000”,  
“4”: “0.00000000”,  
“5”: “0.00000000”  
},  
“multiprices\_ttc”: {  
“1”: “10.00000000”,  
“2”: “0.00000000”,  
“3”: “0.00000000”,  
“4”: “0.00000000”,  
“5”: “0.00000000”  
},  
“multiprices\_base\_type”: {  
“1”: “TTC”,  
“2”: “HT”,  
“3”: “HT”,  
“4”: “HT”,  
“5”: “HT”  
},  
“multiprices\_min”: {  
“1”: “0.00000000”,  
“2”: “0.00000000”,  
“3”: “0.00000000”,  
“4”: “0.00000000”,  
“5”: “0.00000000”  
},  
“multiprices\_min\_ttc”: {  
“1”: “0.00000000”,  
“2”: “0.00000000”,  
“3”: “0.00000000”,  
“4”: “0.00000000”,  
“5”: “0.00000000”  
},  
“multiprices\_tva\_tx”: {  
“1”: “25.000”,  
“2”: “25.000”,  
“3”: “25.000”,  
“4”: “25.000”,  
“5”: “25.000”  
},  
“multiprices\_recuperableonly”: {  
“1”: “0”,  
“2”: “0”,  
“3”: “0”,  
“4”: “0”,  
“5”: “0”  
},  
“prices\_by\_qty”: [],  
“prices\_by\_qty\_list”: [],  
“default\_vat\_code”: null,  
“tva\_tx”: “25.000”,  
“tva\_npr”: “0”,  
“localtax1\_tx”: “0.000”,  
“localtax2\_tx”: “0.000”,  
“localtax1\_type”: “0”,  
“localtax2\_type”: “0”,  
“stock\_reel”: “0”,  
“stock\_theorique”: null,  
“cost\_price”: “20.00000000”,  
“pmp”: “30.00000000”,  
“seuil\_stock\_alerte”: null,  
“desiredstock”: null,  
“duration\_value”: false,  
“duration\_unit”: “”,  
“status”: “1”,  
“status\_buy”: “1”,  
“finished”: null,  
“status\_batch”: “0”,  
“customcode”: “”,  
“url”: null,  
“weight”: “0”,  
“weight\_units”: “0”,  
“length”: null,  
“length\_units”: “0”,  
“surface”: null,  
“surface\_units”: “0”,  
“volume”: null,  
“volume\_units”: “0”,  
“accountancy\_code\_sell”: “3000”,  
“accountancy\_code\_sell\_intra”: “”,  
“accountancy\_code\_sell\_export”: “”,  
“accountancy\_code\_buy”: “4000”,  
“barcode”: null,  
“barcodes\_extra”: [],  
“stats\_propale”: [],  
“stats\_commande”: [],  
“stats\_contrat”: [],  
“stats\_facture”: [],  
“stats\_commande\_fournisseur”: [],  
“multilangs”: [],  
“imgWidth”: null,  
“imgHeight”: null,  
“date\_creation”: null,  
“date\_modification”: “2020-07-12 13:48:41.309637”,  
“product\_fourn\_id”: null,  
“nbphoto”: 0,  
“stock\_warehouse”: [],  
“fk\_price\_expression”: null,  
“fourn\_pu”: null,  
“fourn\_price\_base\_type”: null,  
“fourn\_socid”: null,  
“ref\_fourn”: null,  
“ref\_supplier”: null,  
“fk\_unit”: null,  
“price\_autogen”: “0”,  
“id”: “590”,  
“import\_key”: “20190326123107”,  
“array\_options”: [],  
“linkedObjectsIds”: null,  
“canvas”: null,  
“fk\_project”: null,  
“contact”: null,  
“contact\_id”: null,  
“thirdparty”: null,  
“user”: null,  
“origin”: null,  
“origin\_id”: null,  
“ref”: “MS-360746”,  
“ref\_ext”: null,  
“statut”: null,  
“country”: null,  
“country\_id”: null,  
“country\_code”: “”,  
“state”: null,  
“state\_id”: null,  
“state\_code”: null,  
“region”: null,  
“region\_code”: null,  
“barcode\_type”: null,  
“barcode\_type\_code”: null,  
“barcode\_type\_label”: null,  
“barcode\_type\_coder”: null,  
“mode\_reglement\_id”: null,  
“cond\_reglement\_id”: null,  
“cond\_reglement”: null,  
“fk\_delivery\_address”: null,  
“shipping\_method\_id”: null,  
“modelpdf”: null,  
“last\_main\_doc”: null,  
“fk\_account”: null,  
“note\_public”: null,  
“note\_private”: “Imported from Odoo 190326”,  
“note”: “Imported from Odoo 190326”,  
“total\_ht”: null,  
“total\_tva”: null,  
“total\_localtax1”: null,  
“total\_localtax2”: null,  
“total\_ttc”: null,  
“lines”: null,  
“fk\_incoterms”: null,  
“libelle\_incoterms”: null,  
“location\_incoterms”: null,  
“date\_validation”: null,  
“duration”: “”,  
“width”: null,  
“width\_units”: null,  
“height”: null,  
“height\_units”: null,  
“fk\_default\_warehouse”: null,  
“entity”: “1”  
}

---

<div class="post-metadata">

**Author:** ![egils](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@egils](https://www.dolibarr.org/forum/u/egils)\
**Post date:** [July 17, 2020, 3:59pm UTC](https://www.dolibarr.org/forum/t/rest-post-to-products-can-i-create-supplier-prices/19320/2 "2020-07-17T15:59:15Z")

</div>

I found out it was only added later and available from 2019, so maybe v11 or v12. I will simply copy the most current code and modify my installation because upgrading is more work than I’m prepared to do right now (carries risk of things not working as I’m used, not working at all, etc.)  
Thanks c3do for adding this!

> <https://github.com/Dolibarr/dolibarr/commit/565a17dc47c6a032f21a42584c4ebda48fcec785#diff-dd1a10d9df7930fd8083b7edfed5ce70>

---

<div class="post-metadata">

**Author:** ![egils](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@egils](https://www.dolibarr.org/forum/u/egils)\
**Post date:** [July 19, 2020, 11:53am UTC](https://www.dolibarr.org/forum/t/rest-post-to-products-can-i-create-supplier-prices/19320/3 "2020-07-19T11:53:25Z")

</div>

I decided to upgrade because I got an error. I later found out the error was also present in v12, see [https://github.com/Dolibarr/dolibarr/issues/14259](https://github.com/Dolibarr/dolibarr/issues/14259). 🙃  
The error was fixed within 10 hours by eldy. Very nice!  
The new versions are very similar (no big rewrite yet) but with a bit nicer UI so I’m happy I don’t have to learn a lot to continue using it.
