Hi there,
There's actually two ways - one is to see all of the invoices for a Company, and the other is to see just one Invoice (which was your question).
Because the interface for payments doesn't have any authentication (you want someone in an accounts payable role to pay you with a minimum of friction), it is important that a bad actor can't just iterate through numeric IDs to see all your outstanding invoices. However, if you know the specific values on the object (including in the case of a company record, the to the second created date), you can (and should) be able to recreate the "key".
For the Company:
This is an MD5 of a prefix string, the Company ID and the invoice created timestamp in UNIXTIME/Epoch seconds. Here's the calc in MySQL format:
MD5(CONCAT('AL',
company.id,UNIX_TIMESTAMP(company.created)))
For the Invoice:
The construct of the Key value (in MySQL in this case) you need to know the Invoice ID and the affiliation_id the invoice is against, using:
Obviously you will want to use whatever function calls and variable names you want in your own code (since you'll be pulling them back from the API, you don't be using MySQL I imagine). Note also the prefixed string of AL which helps to reduce key-collision (slightly) and increases obscurity (which isn't a big issue given the need to know these distinct IDs exactly).
Hope this helps,
Geoff