Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Cannot apply selling plan to variant

Solved

Cannot apply selling plan to variant

Tiber
Shopify Partner
31 4 6

I have created a subscription Group on a products variant, but when I try adding the item to the cart I am getting

 

 

status: 422, message: "Cart Error", description: "Cannot apply selling plan to variant"
mutation {
  sellingPlanGroupCreate(
    input: {
      name: "Monthly"
      merchantCode: "Monthly"
      options: ["Monthly"]
      position: 1
      sellingPlansToCreate: [
        {
          name: "Monthly"
          description: "Payments the first of the month"
          options: "Monthly Payments"
          position: 1
          billingPolicy: { recurring: { interval: MONTH, intervalCount: 1 ,maxCycles:8, anchors:{type:MONTHDAY,day:1}} }
          deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 , anchors:{type:MONTHDAY,day:1}} }
				   
        }
      ]
    }
    resources: { productIds: [""], productVariantIds["gid://shopify/ProductVariant/4127279"] }
  ) {
    sellingPlanGroup {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

 

 

 

Accepted Solution (1)

Tiber
Shopify Partner
31 4 6

This is an accepted solution.

I was using SellingPlanGroup id not SellingPlan id

View solution in original post

Replies 3 (3)

Tiber
Shopify Partner
31 4 6

This is an accepted solution.

I was using SellingPlanGroup id not SellingPlan id

Lokesh_Saini
Shopify Partner
5 1 0

@Tiber  Can you explain where are you using the SellingPlanGroup id instead of the SellingPlan id?

Tiber
Shopify Partner
31 4 6

Hey @Lokesh_Saini 

 It was for adding an item with a subscription through JavaScript