Skip to main content
Solved

Better understanding for "unsubscribeDetectedAtMillis" and "isActive" values


Forum|alt.badge.img

We have implemented the simple subscription process and as a part of that process. The following is the process:
User gets passed PayWall ==> receives the “premium” entitlement AND 10 points within the app.

But the issue is, that we would like to deduct those 10 points in cases where user has subscribed and then fully canceled the subscription i.e. requested a refund within the first week. As if we won’t implement that logic, you can imagine that this process can be abused.

So we are a bit baffled with the customerInfo data, specifically what field is responsible for cancelation/refund ? As we assume “unsubscribeDetectedAtMillis” filed is only linked to the renewals.

Best answer by wes_clark

Hi! I apologize, but there is not currently a field that holds the data regarding a refund in the SDK, but I have raised it internally and we are looking into getting it added.

A few current options for ways you can access that data:

  1. you can use webhooks, which send an event when a refund is detected
  2. you can make a call to the Get Customer endpoint with a public API key (so you can use it in your app itself and not a backend) and check the field, refunded_at, for the subscription to see if it was refunded
  3. With StoreKit 1, add a listener to the SKPaymentQueue and watch for didRevoke
  4. With StoreKit 2, you could check the Transaction revocationDate
View original
Did this post help you find an answer to your question?
This post has been closed for comments

4 replies

wes_clark
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 220 replies
  • Answer
  • March 8, 2024

Hi! I apologize, but there is not currently a field that holds the data regarding a refund in the SDK, but I have raised it internally and we are looking into getting it added.

A few current options for ways you can access that data:

  1. you can use webhooks, which send an event when a refund is detected
  2. you can make a call to the Get Customer endpoint with a public API key (so you can use it in your app itself and not a backend) and check the field, refunded_at, for the subscription to see if it was refunded
  3. With StoreKit 1, add a listener to the SKPaymentQueue and watch for didRevoke
  4. With StoreKit 2, you could check the Transaction revocationDate

Forum|alt.badge.img
  • Author
  • New Member
  • 2 replies
  • March 11, 2024

Thanks for you reply and stating the alternative options. Much appreciated!


Forum|alt.badge.img
  • Author
  • New Member
  • 2 replies
  • March 12, 2024

@wes_clark - sorry for raising this again, but I am struggling to see where could i get access the “refunded_at” filed from in “Customer_Info”. It doesn’t seem to exist in “entitlement” object :( 

And is there a way to test the “refunding” in sandBox?


wes_clark
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 220 replies
  • March 12, 2024

Sorry about that! I should have been more clear. The “refunded_at” field is under the “subscriptions” object for that call. In terms of testing refunds in sandbox, you can test refunding Google play purchases from the RevenueCat Dashboard. Unfortunately, Apple does not allow for the same functionality, but it appears that, based on this documentation, they allow you to test refunds from their end in sandbox.


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