Is SubscriptionContract's nextBillingDate value incorrect ?

Solved

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

0 Likes
ewalker
Shopify Staff
Shopify Staff
9 0 4

Hi 

0 Likes

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

 

0 Likes

Hey, @ewalker. How is this?

0 Likes

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!

0 Likes

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.