I want to link membership contributions to the invoice that included the membership payment. I do not use the Dolibarr GUI system for creating neither member, thirdparty, membership, or the invoice. I use the API.
If I use the Dolibarr GUI and create an invoice then I get a link and in the invoice it is reported like this:
"linkedObjectsIds": {
"subscription": {
"509": "49"
}
}
(there is no link in the subscription json, but the GUI does have it.).
Checking the previous invoice who is totally unrelated I see a decremented number 508
"linkedObjectsIds": {
"commande": {
"508": "542"
}
}
and for another invoice decrement I get a different number 505.
"linkedObjectsIds": {
"commande": {
"505": "498"
}
}
These linked object numbers, 509, 508, 505 does look like they are unique and they do look like they are just a simple autoincrement in a database table, but is that so?
What happens if I use the same number several places?
How can I find the next available number using the API?