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
}
}
]
}
]
}
}
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.
Have you solved this problem?
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023