Trying get the cart by AJAX API + nodejs

Highlighted
New Member
3 0 0

I'm working to get the status of the cart through AJAX API, but the issue the cart is not persistent, always the cart is different in each request, I'm working in other site develop in nodejs and try connect with AJAX API to store of shopify of my store social-studies-qa.myshopify.com. Are cookies important here? for keep the same cart for ever?

Thanks.

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @gmoreno ,

 

I am curious as to what you are trying to accomplish here? The Ajax Cart API is meant for making front-end requests on the Shopify online store webpage from the browser in order to adjust the cart or get shipping rates, whereas NodeJS is a runtime environment for running Javascript server-side on the backend. You cannot access the Ajax API from a back-end server, the request must come from a browser running the Shopify online store.

 

To answer your questions: Yes cookies are very important for the Ajax API. If you clear your cookies, your entire cart will be erased. 

 

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes