Line item selling plan with Storefront API

Solved
brian-at-hoa
New Member
2 0 0

Hi.

The documentation for the cart Ajax API documents how to add a line item with a selling plan. I'm not seeing a way to set a selling plan when using the Storefront API. For example, the checkoutLineItemsAdd mutation doesn't include a sellingPlan field. The roadmap (https://shopify.dev/apps/subscriptions#product-roadmap) says that the "Storefront API" feature was launched in July 2021.

How can I add a selling plan to a line item using the Storefront API?

Thanks you.

0 Likes
LarryReid
Shopify Staff
Shopify Staff
16 4 6

This is an accepted solution.

Thanks for the question. The cartCreateMutation should let you build a cart with a subscription line item. The cartLinesAdd and cartLinesUpdate may also be what you're looking for. If those links aren't what you're looking for, let me know. Good luck!

brian-at-hoa
New Member
2 0 0

Thank you, that's perfect!

0 Likes
Fuz-Tech
New Member
3 0 0

Hi, so the cartLinesAdd and cartCreate mutation does allow for adding a line item with selling plan, but then the only way to checkout is via a web URL. Is there any way to utilize the cartCreate and then get the checkout ID and checkout using the completeCheckout mutations?

0 Likes