Solved

RENEWAL webhooks sent every 5 minutes and automatically cancel

  • 27 July 2021
  • 3 replies
  • 80 views

Badge

Hello and thanks for providing any insight.

 

I am trying to setup a webhooks to my AWS dynamodb to store all events so I can keep them as a backup.

 

I noticed that after resubscribing, multiple of the same webhook is being sent.  The only thing that changes is the transaction_id.

 

So in this case, I keep getting the same type “RENEWAL” webhooks every 5 or so minutes.  Most recently I counted 7 webhooks including the last one which was type “CANCELLATION” before they stopped.  Is there anything I missed?  Is it because it is in a Sandbox environment that I get multiple renewal actions from Apple?

 

All webhooks are getting the correct response code 200 and there is a green check mark next to them.

icon

Best answer by sundeep 29 July 2021, 01:30

Hi Adam!
 

multiple of the same webhook is being sent.  The only thing that changes is the transaction_id. 

They aren’t the same if the transaction_id is changing. The expiration and purchase time stamps should also be different from each other. The events shouldn’t be the exact same event, but some will be of the same type (e.g. RENEWAL type - see our docs here for other possible types).

 

 Is it because it is in a Sandbox environment that I get multiple renewal actions from Apple?

Correct! To make it easier to test auto-renewing subscriptions, you get renewals every few minutes. We have a guide that shows this breakdown (and also gives other great pointers on iOS testing), but you can also see it here on the Apple docs (expand “Testing auto-renewable subscriptions”):

Actual Duration

Test Duration

1 week

3 minutes

1 month

5 minutes

2 months

10 minutes

3 months

15 minutes

6 months

30 minutes

1 year

1 hour

 

These durations are controlled by Apple, so you can’t change them yourself.

 

I counted 7 webhooks including the last one which was type “CANCELLATION” before they stopped. 

After several renewals, the subscription will stop renewing, so this is normal.

The renewals happen automatically, whether the app is open or not, so it shouldn’t have anything to do with calling `getPurchaserInfo`.

View original

3 replies

Badge

After looking into this a bit further, it seems like every time I call getPurchaserInfo(), if it has been more than 5 minutes, it will actually update the subscription and will send another webhook event.

Userlevel 1
Badge +5

Hi Adam!
 

multiple of the same webhook is being sent.  The only thing that changes is the transaction_id. 

They aren’t the same if the transaction_id is changing. The expiration and purchase time stamps should also be different from each other. The events shouldn’t be the exact same event, but some will be of the same type (e.g. RENEWAL type - see our docs here for other possible types).

 

 Is it because it is in a Sandbox environment that I get multiple renewal actions from Apple?

Correct! To make it easier to test auto-renewing subscriptions, you get renewals every few minutes. We have a guide that shows this breakdown (and also gives other great pointers on iOS testing), but you can also see it here on the Apple docs (expand “Testing auto-renewable subscriptions”):

Actual Duration

Test Duration

1 week

3 minutes

1 month

5 minutes

2 months

10 minutes

3 months

15 minutes

6 months

30 minutes

1 year

1 hour

 

These durations are controlled by Apple, so you can’t change them yourself.

 

I counted 7 webhooks including the last one which was type “CANCELLATION” before they stopped. 

After several renewals, the subscription will stop renewing, so this is normal.

The renewals happen automatically, whether the app is open or not, so it shouldn’t have anything to do with calling `getPurchaserInfo`.

Badge

Thank you so much for the info!  It is much appreciated and solves my last step before going live!  Thanks again!!

Reply