FROM CACHE - en_header

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.

Accepted Solution (1)

Accepted Solutions
LarryReid
Shopify Staff
Shopify Staff
40 6 11

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!

View solution in original post

Replies 6 (6)
LarryReid
Shopify Staff
Shopify Staff
40 6 11

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!

Fuz-Tech
Shopify Partner
3 0 3

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?

isoftoo
Shopify Partner
2 0 1

hi , I want to use it in chekout. Is there this method

LarryReid
Shopify Staff
Shopify Staff
40 6 11

Could you please describe in a bit more detail exactly what you want to do?

isoftoo
Shopify Partner
2 0 1

我们使用 storefront mobile-buy-sdk-android 想在结账的时候 可以购买 订阅商品和 到店自取

We use storefront mobile buy SDK Android. We want to buy subscription goods and pick them up at the store when we check out