When trying to place an order in the OrderCloud Headstart after the initial setup, it fails with the following message at the Shipping Selection step,
“We apologize for the inconvenience, we are currently unable to display your shipping estimates for this cart. Please try a different address or contact the supplier with further questions.”
The below error message can be found in the browser console,
“TypeError: Cannot read properties of null (reading ‘every’)”
Root Cause: This error is just an outcome of a missing Order Checkout Integration Event configuration.
1. Log in to portal.ordercloud.io account and navigate to Console -> Integration Events
2. Expose your Middleware to the public using ngrok, so that it can be reached by OrderCloud. You can run the below command in ngrok and use the public endpoint generated by ngrok,
ngrok http -host-header=rewrite https://localhost:5001/
When running the project using Docker, you could use the below command,
ngrok http -host-header=rewrite http://api.headstart.localhost/
3. Run a PATCH query in OrderCloud portal to update the ‘CustomImplementationUrl’ property of ‘HeadStartCheckoutLOCAL’ and/or ‘HeadStartCheckout’ Integration Event with the ngrok public endpoint url retrieved in the above step,
The checkout should be working now!