Skip to main content
Solved

Check purchase status of package


Forum|alt.badge.img+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

Best answer by Dan Pannasch

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!

View original
Did this post help you find an answer to your question?

3 replies

Dan Pannasch
RevenueCat Staff
Forum|alt.badge.img+2
  • RevenueCat Staff
  • 43 replies
  • Answer
  • July 14, 2022

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!


Forum|alt.badge.img+3
  • Author
  • New Member
  • 4 replies
  • July 16, 2022

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 


Dan Pannasch
RevenueCat Staff
Forum|alt.badge.img+2
  • RevenueCat Staff
  • 43 replies
  • July 19, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings