Questions, troubleshooting, and feedback on Subscription APIs
Hi.
I would like to create a subscription group that will discount 5% on the initial purchase and 10% from the second billing.
I've set the selling plan group's fixed pricing policy to 5% and set the recurring pricing policy to 10% with afterCycle = 1.
But the subscription is kept billing 5% off the price.
Appreciate it if someone could tell me what I'm doing wrong here.
Thanks.
Solved! Go to the solution
This is an accepted solution.
Hi,
I think there might be some misunderstanding in terms of using the price.
Shopify doesn't automatically transition the contract after a cycle. You might still need to update the price of the contract line after the first cycle.
We store the `computedPrice` on the pricing policy where you could fetch and then apply it:
More info please see here:
Hi,
The way you setup the fixed and recurring billing policy sounds all good to me.
Would you be able to offer more details in terms of how it's not working:
Is it when you trying to charge your second order or the pricing policy you fetched doesn't match?
Hi. Thank you for the reply.
Below is the code that I used to create a selling plan group. The fetched pricing policies are correct, but when I try to charge a second order, the discount percentage of the order doesn't match.
mutation sellingPlanGroupCreate($input: SellingPlanGroupInput!, $resources: SellingPlanGroupResourceInput) {
sellingPlanGroupCreate(input: $input, resources: $resources) {
sellingPlanGroup {
id
}
userErrors {
code
field
message
}
}
}
{
"resources": {
"productIds": [
"gid://shopify/Product/6132261257366"
]
},
"input": {
"name": "test",
"options": [
"test-option-1"
],
"sellingPlansToCreate": [
{
"options": [
"test-option-1"
],
"billingPolicy": {
"recurring": {
"interval": "MONTH",
"intervalCount": 1
}
},
"deliveryPolicy": {
"recurring": {
"interval": "MONTH",
"intervalCount": 1
}
},
"name": "selling-plan-test",
"pricingPolicies": [
{
"fixed": {
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"percentage": 5
}
}
},
{
"recurring": {
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"percentage": 10
},
"afterCycle": 1
}
}
]
}
]
}
}
Have you solved this problem?
Hi,
Just want to make sure: did you try to charge the second order by using `subscriptionBillingAttemptCreate`?
Yes.
Please tell me if there is any other information you need.
This is an accepted solution.
Hi,
I think there might be some misunderstanding in terms of using the price.
Shopify doesn't automatically transition the contract after a cycle. You might still need to update the price of the contract line after the first cycle.
We store the `computedPrice` on the pricing policy where you could fetch and then apply it:
More info please see here:
Hi.
That makes sense.
Just want to make sure, should I update the currentPrice of a subscriptionLine, or the discountAllocation using subscriptionDraftDiscountAdd, after the first cycle?
Hi,
`SubscriptionCyclePriceAdjustment.computedPrice` should reflect the final price after applying pricing policy. So updating currentPrice with computedPrice would achieve the goal here.
`discountAllocation` works for the cases that any other discount applied on top of the pricing policy price.
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