Solved

Check purchase status of package

  • 14 July 2022
  • 3 replies
  • 152 views

Badge +3

Hi there,

is there a way to check if a user has currently subscribed to a specific package?

 

The use case is that I want to have a monthly and a yearly subscription for pro access. If a user has subscribed to one of both, I want to mark it accordingly in the UI and disable the buy button.

I can’t just check if the pro-access-entitlement is active because both the monthly and the annual subscription refer to the same entitlement.

 

Any ideas?

Best, Tobias

icon

Best answer by Dan Pannasch 14 July 2022, 20:59

View original

3 replies

Userlevel 1
Badge +2

Hi Tobias, thanks for reaching out! We don’t have a method for checking if a customer is subscribed to a specific package right now, but I think you may be able to still accomplish this with the Subscribers endpoint.

When you hit Get Subscribers to check if they’ve subscribed to any of the options available on your paywall, within the Entitlement object you’ll get back the product_identifier values that the customer is subscribed to. If they match any of the platform_product_identifier values you got back in the Get Offerings request that you are using on the paywall, then you’ll know to disable the buy button on those products.

Let me know if that all makes sense. If I’ve misunderstood your use case, or if that method won’t work, feel free to reply back here and we’ll see if there’s another approach that might work. Thanks!

Badge +3

Hi Dan, thanks for your answer. 

That sounds good. Can you please confirm that the “Get Subscribers” method you’re talking about is the equivalent to PurchaserInfo.activeSubscriptions in Flutter?

And the second question I have:

Which method can I use to check which non-subscription products have been purchased?

Best regards,

Tobias 

Userlevel 1
Badge +2

Ah I apologize, I was referring to the “Get Subscribers” API endpoint. If you’re looking to access this information from the SDK directly, the EntitlementInfo object is likely going to be the easiest way to do that, since you can use it to determine which product identifier unlocked that entitlement -- more details here.

Regarding your second question, are you looking for a method that only returns non-subscription products that have been purchased? Or all products that have been purchased, including those that are not subscriptions? If the latter, then the CustomerInfo object can return all purchased product identifiers -- more details here. If the former, I’m not sure if we have a method that does exactly that, but if you can describe your use case a bit more I’ll see if there’s something we can propose instead. Thanks!

Reply