Since products are defined directly in the HTML markup, it could be pretty easy for a malicious customer to use their developer tools to manipulate product data and process fraudulent orders. To prevent that, we implemented an order validation mechanism.
It’s important to consider this when developing a project with Snipcart. If you get this error:
You get this error because order validation fails. You will find more information on the product causing the error in de developer logs and in the developer console of your browser.
Make sure the data-item-url points to the page with the Snipcart button if you are using the HTML crawler or to the product definition if you are using the JSON crawler.
If you are using a relative URL, make sure you set up the default domain. This URL needs to be publicly accessible. If you want to test in local development, you can use a tool like ngrok.
If you are creating the buttons dynamically, the crawler will not work since it doesn’t execute javascript. In this case, you will probably need to use the JSON crawler.