Drowning in 404 Errors with Shopify AJAX API: A Lifeline, Anyone?

Alright, folks!! I have good news. I got it to work!!

And, as promised, I return to tell the tale.

TLDR: ButtonID was off and needs a product variant in order to add the product; won’t work without variantID.

Firstly, thanks to those who chimed in.
Your help, helped me find the problem after many hours of going back and forth with this thing.
Knowing that someone else knew exactly how it worked helped me feel grounded in knowing it had to be some other issue if it was not that part of the script.
This is my first go with Shopify 2.0 and I was freaking out over this for over a week until I figured it out.

The issue was multifaceted.

For one, I had the wrong add-to-cart button id.
I am using the Symmetry theme, and the button ID was tucked away in the theme’s customizer.
I went to the product page template for the item I was working on, clicked on the Product Pages Section Block, and noticed all the settings to the right of the screen.
Scrolled down to the Theme Settings portion and found the Shopify Shop ID and the Order Button ID along with some other interesting settings.
Finding that Button ID was crucial and led to finding the other errors that helped solve the problem.

Next, I found out that you can’t add a regular Shopify product with AJAX API. Good to know… Yeesh!
I kept looking for endpoints without realizing that it required a variant ID, not a product ID.

These posts helped me figure it out:
https://community.shopify.com/post/1012114

https://community.shopify.com/topic/2103399.
https://community.shopify.com/topic/1848012

Turns out if you read the documentation a little more carefully, it says ID is variantID.
Guess I glossed over that part when I read it the first 50 times.
https://shopify.dev/docs/api/ajax/reference/cart

I also embedded the HTML/Liquid FORM code directly in my product template instead of the custom Liquid block in the Customizer.
I also moved my JavaScript/AJAX to the bottom of my theme.js file.
And of course, my CSS went into my site’s CSS file.
(The custom CSS file didn’t work so good, so I use the main one even if it is not best practice)

Thanks again for all the help!
I certainly appreciate it!