Get all shipments linked to a specific order with the API

Hello,

I am currently working on a project to automatically manage some shipments tasks on Dolibarr, and I was wondering if it is possible to get all shipments attached to an order from one of the endpoint of the API.

I can see on our Dolibarr that shipments are displayed on an order and that the order reference is displayed in the shipment informations too, but I can’t find the shipment/order references in the API responses. What am I missing ?

Thank you in advance if anyone can help on this subject,

Hi,
I don’t know how the API works, but, if it helps you:

  • the links between the various objects are in the llx_element_element table
  • the fetchObjectLinked function fetches the links of an object

Marcello

Hi,

Thank you very much for your help. Unfortunately, this does not solve the problem in my case, because my goal would really be to use one of the endpoint available in the API.

I see some property called “linkedObjectIds” in the objects returned by the API, but most of them are null or containing only the “invoice” reference linked to the order. The shipments are created via the API, so maybe it is at this step that we have to do something specific in order to correclty link the shipment to the order ?

For now, the shipment is created with this endpoint : POST request to /api/index.php/shipments/
And we send an object containing the following properties : {
“socid”: XX,
“origin_id”: XX,
“origin_type”: XX,
“lines”: […]
}

Does anyone know if this a correct process to link a shipment to an order ?

Thank you in advance,