How to fetch the information about canceled subscription?

Billing API only returns Active Subscription.

const billingCheck = await billing.check({
plans: [MONTHLY_PLAN, ANNUAL_PLAN],
isTest: true,
});

Returns


{
  "hasActivePayment": true,
  "oneTimePurchases": [],
  "appSubscriptions": [
    {
      "id": "gid://shopify/AppSubscription/xxxxx",
      "name": "Annual subscription",
      "test": true,
      "lineItems": [
        {
          "id": "gid://shopify/AppSubscriptionLineItem/xxxxx?v=1&index=0",
          "plan": {
            "pricingDetails": {
              "price": {
                "amount": "19.0",
                "currencyCode": "USD"
              },
              "interval": "ANNUAL",
              "discount": null
            }
          }
        }
      ]
    }
  ]
}

So what if my customer cancel there subscription before the month/year ends but I still want to give them pro features till the month/year ends.

and this **check Billing API** returns no information about canceled Subscription

how I get that info and update my UI

do I have to save information in my OWN database and write logics?

Hi @attaboiaj ,

If I was right, you are using the Billing API of Shopify App Remix. You should try Admin REST API to get ALL recurring charges.

Here are the docs:

  1. Shopify App Remix doc https://shopify.dev/docs/api/shopify-app-remix/v3/apis/admin-api#example-rest

  2. REST API doc https://shopify.dev/docs/api/admin-rest/2024-04/resources/recurringapplicationcharge

Hope you solve the issue soon!

Thanks a lot I am looking for this. you saved my a..

1 Like

Glad to hear that :grin: It’s my pleasure.

1 Like