Crawling error on checkout

I’ve been trying to submit test orders, and almost all of my attempts are giving me an error:

## Price of products in the cart may have changed.
Try removing and adding them to your cart. 
Please contact the store owner for details.

## Product crawling error

Defined product prices don’t match prices in cart, 
or products couldn’t be found at crawled endpoint. 
Review product IDs, prices, and URLs. 
[This entry](https://docs.snipcart.com/v3/setup/order-validation) 
on Order validation might help. See developer console for more details.

**You’re seeing this notice because you’re 
using your account’s Test API key.*

I’m not sure what I have to do on the backend to correct this problem. I found 2 of my products that don’t generate the error, and I don’t know what’s special about those two items that causes them to work but none of the others. All of the products have sufficient quantity for the order.

Could this be contributing to the problem?

I created most of my product codes – but then I had to re-import the pages, and I was worried about making duplicate entries, and I deleted all of the codes that were already set up.

Is it possible that the shopping cart query doesn’t have a filter to only search for unarchived codes, which means perhaps that two copies of the codes are being retrieved, which confuses the cart?

Chuck

I suggest you take a look at this entry to help troubleshoot this issue.

I feel stuck. I’m looking at the developer log, and I don’t know what it’s telling me:

An attempt to create an order with invalid products has been made. Don’t forget you can’t add/update items attributes in the cart dynamically with javascript as it will cause crawling issues. You can read more about this here: Security – Snipcart Documentation

Using JSON crawler Order validation – Snipcart Documentation to validate item ‘SO-3-092721’ located at https://www.fortbendchessclub.com/products.json’.

Validating item with id ‘SO-3-092721’ located at https://www.fortbendchessclub.com/products.json’ on domain ‘fortbendchessclub.com’.

I see the warning about changing the cart dynamically, but I didn’t do that. Here are the steps I’ve followed.

  1. I imported all of the pages to load product information.
  2. I gave all of the products an initial inventory.
  3. I opened a browser window to navigate to my site, and I added an item to the cart.
  4. I submitted the test information and submitted the order.
  5. I get the error.

I’m looking at the json file that the log refers to, and it only lists two of my 30 products. But those are the two products that I can actually order successfully in the test. And I’m looking at the steps in your security flowchart that I don’t understand.

Here are the questions I have:

  • What is the request that is sent to the data item URL?
  • Is the data item URL referring to the product page that contains the Add to Cart button?
  • What’s the difference between a JSON and an HTML validator?
  • is the data item URL’s content-type a property of the button?
  • How is the json file created? Is it created by Snipcart, or do I need to file a problem log with the web software? Is it supposed to be a master product list that I manually create for all of the products on my site?

Hey @fbcc ,

The JSON file must be generated by your system. On our end, we don’t generate this file.

I think this infographic is the best way to understand how our validation works:

order validation

The Content-Type is actually set by your server, when validating the order, our server will send a HTTP request to your application, the request will be sent to the URL specified in data-item-url.

If your server returns a response with the header Content-Type set to application/json, we’ll automatically use our JSON crawler, otherwise we use the HTML crawler.

Let me know if that makes things more clear.

Thank you. This is a very helpful reply!

I had found the flowchart and had figured out some of my questions from it. I had assumed that the front end must be creating the json file — because how would you be able to create a file on my site — but I wasn’t sure. I posted a question to Sparkle support team this morning asking for information on how the json file is created but haven’t had a reply from them yet. Since I have about 30 pages with products, I’m concerned that it seems to be only including products from the first page and ignoring the other pages. But I’ll get them to explain that for me.

Chuck

1 Like