The subscription returns as active, but the currentPeriodEnd is a past date. Is this normal?

this is my graphql query for fetching user active sub:

query sub {
    appInstallation {
        activeSubscriptions {
            id
            status
            name
            currentPeriodEnd
            createdAt
            test
            trialDays
            lineItems {
                id
                plan {
                    pricingDetails {
                        __typename
                        ... on AppRecurringPricing {
                            interval
                            planHandle
                            price {
                                amount
                                currencyCode
                            }
                        }
                        ... on AppUsagePricing {
                            balanceUsed {
                                amount
                                currencyCode
                            }
                            cappedAmount {
                                amount
                                currencyCode
                            }
                            interval
                            terms
                        }
                    }
                }
            }
        }
    }
}

But for the test store, I found that it returned some very strange results.

{
  "createdAt": "2025-03-28T05:08:51Z",
  "currentPeriodEnd": "2025-04-27T05:08:57Z",
  "id": "gid://shopify/AppSubscription/xxx",
  "lineItems": [
    {
      "id": "gid://shopify/AppSubscriptionLineItem/xxx?v=1&index=0",
      "plan": {
        "pricingDetails": {
          "__typename": "AppRecurringPricing",
          "discount": null,
          "interval": "EVERY_30_DAYS",
          "planHandle": null,
          "price": { "amount": 129.0, "currencyCode": "USD" }
        }
      },
      "usageRecords": null
    }
  ],
  "name": "xxx",
  "returnUrl": null,
  "status": "ACTIVE",
  "test": true,
  "trialDays": 0
}

I found that it returned a plan with an active status, and the subscription status is also active, but the currentPeriodEnd is a past date.
It looks like it only took effect for one period. I’m not sure if this is the case for official merchants as well.

Is this normal?

I guess that this date might require a real order to trigger an update, but since the test store does not have any subsequent transactions, this causes the date in the test store to not work properly?

I’ve never seen a currentPeriodEnd be that late to renew. I’ve found in the past it can be a few hours late, but not that drastic.

Could you share the GID for the AppSubscription?

That detail would help any Shopifolk reading this message to at least perform a look up to save some time debugging this issue.

I checked the test subscriptions in other test stores and found that this issue seems to be quite common.
I suspect it may be because test orders do not trigger the real renewal process.
Currently, I prioritize using the status to determine whether a subscription is valid, and only when the subscription cannot be retrieved (such as after the user unsubscribes or reinstalls after uninstalling) I then check the currentPeriodEnd.
This approach seems to be more reliable.

here is another one(test store with sub test=true):

{
  "createdAt": "2025-03-31T03:06:01Z",
  "currentPeriodEnd": "2025-05-03T03:06:08Z",
  "id": "gid://shopify/AppSubscription/24848334903",
  "lineItems": [
    {
      "id": "gid://shopify/AppSubscriptionLineItem/24848334903?v=1&index=0",
      "plan": {
        "pricingDetails": {
          "__typename": "AppRecurringPricing",
          "discount": null,
          "interval": "EVERY_30_DAYS",
          "planHandle": null,
          "price": { "amount": 69.9, "currencyCode": "USD" }
        }
      },
      "usageRecords": null
    }
  ],
  "name": "xxx",
  "returnUrl": null,
  "status": "ACTIVE",
  "test": true,
  "trialDays": 3
}

So just to confirm - you’re asking that the currentPeriodEnd is only inaccurate for active **test*** subscriptions and not live ones?

Yes, I have recently been migrating the old REST API logic to GraphQL. The previous REST API did not consider the “billing on” field. During the migration, I added “currentPeriodEnd” to make the judgment. During testing, I found that the membership status of all test stores (except for those that just subscribed) became invalid.
For real merchants, I checked the active merchants and their earliest currentPeriodEnd is tomorrow. There is no such issue for real merchants.

So it sounds like only test subscriptions don’t have a valid currentPeriodEnd, probably just a small oversight from how charges are processed.

If there’s no real charges processing, then there’s no mechanism to update the currentPeriodEnd.

It wouldn’t expect this bug to happen for live real subscriptions. What you’ve found is most likely only applying to test subscriptions.

1 Like