Most Efficient way to add a table referenced record?

Hello all,

I'm trying to find the most efficient way to setup my database.

I have two tables, one called Contacts and the other called Invoices

Contacts Fields
Contact ID:
Name:

Invoices Fields
Status
Amount
Contact ID (table reference)

I'm getting the data for these two tables from an external API.

My first GET call is to get ALL contacts from this other system and record to the DB. That part is fine

The second part is I want to create the invoices, but what is the best way to pass the Contact ID through during the creation request? Do I have to query each invoice received via the API (the data contains the external Contact ID) against the Contacts table to find the relevant ID? It just seems largely inefficient. 

I know since I did the GET all contacts call, that my contact 100% exists in the Contacts database, so is there an easier way to fill out the Contact ID field in the invoice table?
Other
3 replies