Is SubscriptionContract's nextBillingDate value incorrect ?

Solved
camelmasa
Shopify Partner
83 10 27

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.

Accepted Solution (1)
Replies 6 (6)
camelmasa
Shopify Partner
83 10 27

For now, We add 5 hours to the nextBilligDate value for this issue.

BStubbs
Shopify Partner
136 16 61

After the successful BillingAttempt, are you setting the new nextBillingDate with a local or UTC datetime? It should be a UTC datetime.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
camelmasa
Shopify Partner
83 10 27

Thanks for replying.

After the successful BillingAttempt, are you setting the new nextBillingDate with a local or UTC datetime? It should be a UTC datetime.

No, We just do to buy a daily subscription product.  Then, We called SubscriptionContract GraphQL.

BStubbs
Shopify Partner
136 16 61

Sounds like someone is confusing a UTC and a local timezone when the SubscriptionContract is created. Maybe take this to the Subscriptions API forum section?

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
camelmasa
Shopify Partner
83 10 27

Oh, nice idea! I didn't know that section 😄 Thanks. I'll post the same question.