Working with a Retainer Invoice in a custom function

Working with a Retainer Invoice in a custom function

I cannot find any documentation on fetching fields from retainer invoices with deluge. I have the retainer ID, I just need to use that to fetch two fields from the retainer: date of creation and the paid amount remaining on the retainer.