Is there a API endpoint to gather the payments allocated to purchase invoices?

I am hoping to see if there is a endpoint where I can supply the UUID of the purchase invoice and it returns the payments allocated to that invoice. For example on the details of a purchase invoice you can see it shows the payments allocated.

When using GET on the payments API it returns the general payment but I am unable to determine from there what purchase invoices it has paid or been allocated to.

Does anyone know an endpoint to use to fill in that information? its fine if it supplies all records, I can filter on my end.

Thanks

There is no such an endpoint. However the program is being refactored to be API-first so that every single screen in Manager.io will have the exact API equivalent.

1 Like

After executing a GET request to the /payments endpoint, if you want to find which purchase invoice paid by each payment, you must check each payment data and extract its key. Subsequently, perform another GET request to the endpoint /payment-form/key, substituting key with the one you previously obtained. The full API URL endpoint example will be as illustrated below:

http://localhost:8080/api2/payment-form/113e63af-7ce5-4289-bd14-722d89756984

113e63af-7ce5-4289-bd14-722d89756984 is an example of the key value from one the /payments data. Your key will be different of course.

Afterwards, you will receive data like this:

See the PurchaseInvoice in the Lines? Use the UUID value, as a key to perform GET again the /purchase-invoice-form/key endpoint (change the key with the UUID value) to get the purchase invoice data.

Unfortunately you have to do it one by one for each payment to know the purchase invoice paid by each payment. Like Lubos said, there is no endpoint that can retrieve all the purchase invoice information for each payment when you directly perform GET to the /payments endpoint.

1 Like