How can I determine if a merchant's shop is currently in the trial period of my app?

Topic summary

Determining access during a 7-day trial after a merchant cancels a monthly subscription. The app currently checks billing status via billing.check (isTest set by NODE_ENV), using hasActivePayment, oneTimePurchases, and appSubscriptions.

Key issue: When a merchant cancels within the 7-day trial, hasActivePayment returns false, removing access, even though the merchant should retain trial access.

Technical context: hasActivePayment indicates an active subscription/payment. The developer needs a way to detect ongoing trial eligibility post-cancellation (e.g., whether the original subscription’s trial window has not yet expired) rather than active payment status.

Open question: How to determine that a canceled subscription is still within its trial period using Shopify’s billing APIs (from authenticate.admin / billing.check), or alternative data (e.g., appSubscriptions fields like trial start/end dates) so access can be granted until the trial ends.

Central artifact: The provided TypeScript loader and billing.check usage are key to understanding the current logic and limitation.

Status: No resolution or proposed solution yet; guidance requested.

Summarized with AI on December 21. AI used: gpt-5.

Currently, my app uses the following code to check if a user is subscribed:

export const loader = async ({ params, request }: LoaderFunctionArgs) => {
const { admin, session, billing } = await authenticate.admin(request);
const { hasActivePayment, oneTimePurchases, appSubscriptions } =
await billing.check({
isTest: process.env.NODE_ENV !== "production",
});

If the user is subscribed, hasActivePayment will be true.

My monthly subscription has a 7-day trial period, and if the user cancels after subscribing but is still within the 7 days, they should still have subscription access.

However, in this case, hasActivePayment is already false.

How can I determine if a shop who has canceled their subscription is still within the trial period?