Which is the correct way of checking if the user paid for my app?

Hi there! Im new here!

This is my first post!

For the admin UI you guys use the Shopify billing check or check manually via a middleware?

Like im chekcing directly with:

const { hasActivePayment } = await billing.check();

Or should I check in my DB where I store the paymant webhook data.

You don’t need to check directly every time when the app initially loads.
Instead, you can subscribe APP_SUBSCRIPTIONS/UPDATE and APP_UNINSTALLED webhooks to update subscription status in database.
And you can check with the subscription status in DB.

2 Likes

If your subscription is monthly/yearly, you should probably setup a cron/scheduled function to fetch the subscription details on a daily basis and update your db.

The webhooks are not very good to rely on, since you’re not notified when the payment for your app is successful, only when it’s not.