How to add products in cart?

Hey Brilliant Minds,

I want to add some products in cart based on some conditions using shopify function APIs, also that products should be remove as well.

Any one have solution that which shopify function API working to add/remove products?

I know, to add / remove products, I should use theme level JS, but i am curious to find this in function API.
Thanks :slight_smile:

Hey Harsh! You can see the currently available cart transform operations here: Cart Transform Function API

There is no add operation; you can only expand or merge existing lines. As you mentioned, you’d need to add + remove items using the storefront API or Ajax cart API.