Add EventID query to Finances.PaymentAllocations
Unlike Finances.Payments and Finances.Invoices that will return all payments/invoices, or all payments/invoices for an Event (or Contact), PaymentAllocations only returns results for a single invoice or payment. This can slow down scripts by several orders of magnitude.
Would be great if the PaymentAllocations GET call was expanded to add an EventID query (like Finances.Payments), or even to return all payment allocations, rather than only one at a time.
Use case: I want to generate a list of all the payments made to an event, showing the actual $$ that each payment was TO THE EVENT. Calling GET on the Finances.Payments API using the EventID query generates a list of all the payments for an event but the total $$ is NOT what was paid for that event. Payments, even when filtered by EventID, can include payments to other events, membership, etc. because a single payment can be allocated to multiple invoices. To limit the $$ to only what was paid to the event, it is necessary to call the PaymentsAllocation API for each payment, match each element to the event-specific invoices, and extract the Value. Since API calls are slow (c. 0.5sec using Apps Script), it is possible to return a list of 100 payments in 0.5 sec, 200 invoices in 0.5 sec, but to figure out the actual payments for the event it takes 100 *0.5 sec or nearly a minute. Using async doesn't seem to help.
So, the simple request "generate the list of each registrants payments for this event" takes at least (1 + # of registrants) API calls, rather than 2 or 3.