1

Dolibarr has a module for restful APIs.

The API explorer seems to show all the CRUD tasks for each module like orders, stock and customer.

api explorer

But to CREATE a record, the sample VALUE for the POST method shows as:

{ "request_data": [ "string" ] }

What are the specific field attributes that should go in here? Where can I look up the field requirements?

piranhas
  • 11
  • 3

2 Answers2

1

You should take a look at the attributes of the Commande class: https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/commande/class/commande.class.php

The object should be something like this :

{
  "date_commande" : "0000-00-00 00:00:00",
  "date_livraison" : "0000-00-00 00:00:00",
  "attribute3": "and so on"
}
Antoine
  • 81
  • 5
1

When you need a parameter like { "request_data": [ "string" ] } for a POST API, all you have to do is to call the similar API to get a record (so the same API with the GET method). The result can be cut and paste to be used to create a new record (just change the id and ref in the answer retreived by the GET).

eldy
  • 498
  • 4
  • 7