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.
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.
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:
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.