Add to cart API with custom attribute (Globo Product Option)

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.