Getting Error in Zapier when using Create Invoice Event (Cannot read properties of undefined (reading '0'))

It seems something may be wrong with the Zap, or I’m missing something, but I’ve tried setting this up multiple times. It used to work in the past.

Error is “Cannot read properties of undefined (reading ‘0’)”

Looking at that, the date in your test data is missing, so it’s trying to put a blank value into a required field.

Hope that helps

Thank you for your input. I have tried inputting a date and still get the same error.

Any other fields missing data?

This was the original error, which caused me to think maybe it is because the address is missing.

I have run tests with the address, but still get the error.

This is what Zapier AI says "The error message “Cannot read properties of undefined (reading ‘0’)” typically indicates that the Zap is trying to access an element in an array or object that does not exist. In the context of your “create_invoice” step, it seems that the Zap is expecting an array or object at a certain point but is not receiving it.

To resolve this issue, you should check the input data for the “create_invoice” step, particularly the product and product_quantity fields, which are expected to be arrays. The error might be occurring because the Zap expects these fields to contain arrays with at least one element, but the provided input does not meet this expectation. Make sure that the data passed to these fields is correctly formatted as arrays and contains the necessary elements.

Additionally, since the shipping_address field is also an array but contains an empty object, ensure that if a shipping address is required, it is provided with all the necessary details. If a shipping address is not required, you might need to adjust the Zap to handle an empty array or object correctly.

If the issue persists, you may need to use a Formatter step before the “create_invoice” action to properly format the data or to include a fallback value for any fields that might be causing the issue."

I opened ticket with Zapier.

What I would do is try it with no data from the previous steps in the zap, manually fill the fields in. Once you have it working you know what data you need.