Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi there!
I have an issue, where I cannot add a product to a cart through an API.
I am building a chatbot that provides a personalised recommendation for a product detail. To order such product I use Globo Product Option to get clients wishes (text area attribute). I've tried multiple options how to get the client's customised product to the cart, but I am yet to find a working solution.
The closest I got was to get or create a cart and populate it with a product through API from chatbot's side, but there is a problem - the cart created/found by the API is not matching the user's session on the website.
Then I tried to get the cart token from the websites' side and managed to do it, but failed to pass the token to the chatbot.
Any ideas or suggestions how I should proceed?
Thanks!
It's probably because you're creating the cart before the customer adds anything to the cart.
Have you tried using cart transform functions instead?
https://shopify.dev/docs/api/functions/reference/cart-transform
Hey! I think those are only available for Shopify Plus users, which I don't have.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025