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

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

MikeGuo
Shopify Partner
10 0 0

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

```ts
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?

Replies 0 (0)