Questions, troubleshooting, and feedback on Subscription APIs
We want to create selling plans with the same options but with different billing cycles in a single contract for e.g let's check the below query with deliver every month but billing should be 4 months, and 6 months.
mutation {
sellingPlanGroupCreate(
input: {
appId: "WS-Subscription"
name: "Yearly Subscript prepaid"
merchantCode: "Yearly Prepaid"
options: ["Delivery every"]
position: 1
sellingPlansToCreate: [{
name: "Deliver every month Bill 4 moth",
options: "1 MONTH",
position: 1,
billingPolicy: { recurring: { interval: MONTH, intervalCount: 4 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PERCENTAGE
adjustmentValue: { percentage :30 }
}
}
]
},{
name: "Deliver Every month Bill 6 month",
options: "1 MONTH",
position: 2,
billingPolicy: { recurring: { interval: MONTH, intervalCount: 6 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PERCENTAGE
adjustmentValue: { percentage :20 }
}
}
]
}]
},
resources: { productIds: ["gid://shopify/Product/6569815703721"], productVariantIds: [] }
) {
sellingPlanGroup {
id
sellingPlans(first:10) {
edges {
node {
id
}
}
}
}
userErrors {
field
message
}
}
}
and we get following errors
[ { field: [ 'input', 'sellingPlansToCreate', '0', 'options' ],
message:
'Options Cannot have multiple selling plans with the same options.' },
{ field: [ 'input', 'sellingPlansToCreate', '1', 'options' ],
message:
'Options Cannot have multiple selling plans with the same options.' } ]
So my question is Shopify should allow users to create plans like this, Why do they have to create different contracts to achieve this. It should be achieve in one contract with selling plan group.
Hope you understand the question and gave the appropriate solution.
Thanks in advance.
Solved! Go to the solution
This is an accepted solution.
Hi,
Options are usually used by theme to display the purchase options, that's why we do not allow it to be the same.
You should be able to get around it by having 2 options:
sellingPlanGroup.options: ["Deliver every", "Bill every"]
sellingPlan1.options: ["1 month", "4 month"]
sellingPlan2.options: ["1 month", "6 month"]
Hope this helps.
This is an accepted solution.
Hi,
Options are usually used by theme to display the purchase options, that's why we do not allow it to be the same.
You should be able to get around it by having 2 options:
sellingPlanGroup.options: ["Deliver every", "Bill every"]
sellingPlan1.options: ["1 month", "4 month"]
sellingPlan2.options: ["1 month", "6 month"]
Hope this helps.
Okay, Understood,
But my question is still the same how do I achieve to create plans like https://prnt.sc/1sizmfi. So, customers can bill at different times.
Can you suggest to me how do I pass the query to create plans like that because as I mentioned in my query sends me an error.
The mutation would look something like this:
mutation {
sellingPlanGroupCreate(
input: {
appId: "WS-Subscription"
name: "Yearly Subscript prepaid"
merchantCode: "Yearly Prepaid"
options: ["Delivery every", "Bill every"]
position: 1
sellingPlansToCreate: [{
name: "Deliver every month Bill 4 moth",
options: ["1 MONTH", "4 MONTH"],
position: 1,
billingPolicy: { recurring: { interval: MONTH, intervalCount: 4 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PERCENTAGE
adjustmentValue: { percentage :30 }
}
}
]
},{
name: "Deliver Every month Bill 6 month",
options: ["1 MONTH", "6 MONTH"],
position: 2,
billingPolicy: { recurring: { interval: MONTH, intervalCount: 6 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PERCENTAGE
adjustmentValue: { percentage :20 }
}
}
]
}]
},
resources: { productIds: ["gid://shopify/Product/6569815703721"], productVariantIds: [] }
) {
sellingPlanGroup {
id
sellingPlans(first:10) {
edges {
node {
id
}
}
}
}
userErrors {
field
message
}
}
}
User | RANK |
---|---|
3 | |
3 | |
1 | |
1 | |
1 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023