Solved

Is SubscriptionContract's nextBillingDate value incorrect ?

camelmasa
Shopify Partner
83 10 27

(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.

Accepted Solution (1)
camelmasa
Shopify Partner
83 10 27

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. 

View solution in original post

Replies 5 (5)

ewalker
Shopify Staff
30 4 7

Hi 

To learn more visit the Shopify Help Center or the Community Blog.

camelmasa
Shopify Partner
83 10 27

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": []
      }
    ]
}

 

camelmasa
Shopify Partner
83 10 27

Hey, @ewalker. How is this?

colinloretz
Excursionist
16 2 7

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!

camelmasa
Shopify Partner
83 10 27

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.