Questions, troubleshooting, and feedback on Subscription APIs
Return management just got easier! We’ve launched Customer Self-Serve Returns to all Shopify merchants. Click here to learn more!
(Moved question from here)
We tested to buy a daily subscription product at 2021-02-03T02:00:00Z. Then, We called SubscriptionContract GraphQL. Like below.
subscriptionContract(id: $id) {
id
nextBillingDate
}
It returns this.
{
id: 'gid://shopify/SubscriptionContract/35127445',
nextBillingDate: '2021-02-03T21:00:00Z',
}
The "nextBillingDate" value should be 2021-02-04T02:00:00Z or 2021-02-03T21:00-05:00.
Solved! Go to the solution
This is an accepted solution.
@colinloretz Thanks for replying. But, my question's meaning was not that.
@ewalker I think I understood the specification of nextBillingDate. The SubscriptionContract object's nextBilligDate is AFFECTED BY STORE'S TIMEZONE. BUT, The SubscriptionContract object's createdAt is not AFFECTED BY STORE'S TIMEZONE.
I thought that looks bug. We decided to ignore nextBillingDate value for now.
Hi camelmasa, would you mind posting the graphql input for the Selling Plan that generated this subscription contract?
Hi @ewalker.
The graphql is this.
mutation sellingPlanGroupCreate($input: SellingPlanGroupInput!) {
sellingPlanGroupCreate(input: $input) {
sellingPlanGroup {
id
sellingPlans(first: 20) {
edges {
node {
id
name
}
}
}
}
userErrors {
field
message
}
}
}
Also, The $input is like this.
{
"name": "test",
"merchantCode": "test",
"options": [
"test"
],
"position": 0,
"sellingPlansToCreate": [
{
"name": "test",
"description": "test",
"options": [
"test"
],
"position": 0,
"billingPolicy": {
"recurring": {
"interval": "DAY",
"intervalCount": 1
}
},
"deliveryPolicy": {
"recurring": {
"interval": "DAY",
"intervalCount": 1
}
},
"pricingPolicies": []
}
]
}
Doing my own research and found your question. Are you expecting the nextBillingDate to be updated on its own each day for a daily product?
If so, unfortunately it does not appear to automatically update. Our apps are required to handle the billingAttempt and then move the nextBillingDate ourselves. It is references in this other question: https://community.shopify.com/c/Subscription-APIs/Calculation-of-nextBillingDate-on-Subscription-Con...
Apologies if you are asking a different question but hopefully the above helps!
This is an accepted solution.
@colinloretz Thanks for replying. But, my question's meaning was not that.
@ewalker I think I understood the specification of nextBillingDate. The SubscriptionContract object's nextBilligDate is AFFECTED BY STORE'S TIMEZONE. BUT, The SubscriptionContract object's createdAt is not AFFECTED BY STORE'S TIMEZONE.
I thought that looks bug. We decided to ignore nextBillingDate value for now.
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022