For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
(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?
To learn more visit the Shopify Help Center or the Community Blog.
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.