I'm trying to find a way to construct a URL that returns me a list, or even a count, of invoices, one for AR and one for AP when I provide a document number. As the invoice is a sub entity of the invoice batch, short of returning them all and looping through them, I cannot find a way to do it. the Odata protocol seems to support searching sub entities, but I have tried loads of different ways but cannot get one that works.