how can I set or remove a selling plan using update.js

New Member
1 0 0

I am creating a custom theme using the Ajax Cart API

I have a product and the customer can chose the option to get a subscription or buy once. when the cart is empty I am using this code:



product = {
id: productVariant,
quantity: productQty,
selling_plan: sellingPlanId


The sellingPlanId could be a number or empty

if the customer return to change the options, he can remove or set the subscription and I am using the update cart option (POST /cart/update.js)'/cart/update.js',



 is it possible to set the new value to selling plan?