In an Order Item, what is the product_id?

Creating an Order through the API requires that I send several data elements including a list of Items on the Order. One field in an Order Item is “product_id”. Does this have to match the ID field of that product in my Keap products list? What happens if that product isn’t in the Keap products list?

As you said, it relates to the Products in your Keap account.

I would recommend that you match the Product ID to the Product which is useful for reporting and querying purposes. I know in the interface you can add Order Items with just the Name, and not selecting any product.

I always map it to the Product ID via the API, but have not tried without it before. You can try to see what happens if you use an empty or “0” ID number. Make sure the Order Name is specified so that it appears on the Invoice.

What does Keap do if the incoming line item has no product ID? Does it just create a new Product, or does it first try to match to an existing Product using the Description?

No, it does not have any intelligence. No Products will be added, you would have to do that via the API, or via the application.

Try experimenting to see what happens, then load up the Order in your account to see what it shows.