NetSuite Upserts

I’ve built a pipeline that create NetSuite customers from a source system and includes a company code as an external id. Now I’m trying to insert invoices that link to those customers. I tried populating the account external id and the entity external id but I’m receiving the message ‘FIELD_PARAM_REQD: Please enter a value for entity’. Any ideas how I can upsert the invoice with only the external id for the customer?

I have thought about using the search to get the internal id to see if that would work.

This error occurred because there was no NetSuite customer for the external key being referenced in the upsert.

The customer must exist before the invoice can be created.