ZCRM from invoice in books

ZCRM from invoice in books

I am trying to create a function that writes to the crm after an invoice is created in Books. It is important to link it to the correct contact id. I am trying to find the CRM contact id from with books. I thought it would be ZCM_contact_id but it returns null. I think I am missing a step. Can I ask for some advice please.