Skip to main content
Answer

When INITIAL_PURCHASE webhook on offer code redemption

  • October 6, 2024
  • 3 replies
  • 159 views

Forum|alt.badge.img

If a user redeems an offer code (iOS) without the app installed, when does the INITIAL_PURCHASE webhook fire?

 

I’m having an issue where the INITIAL_PURCHASE webhook is firing without the user id being set. I set the user id when the user signs in/up so I’m trying to understand when the webhook is firing. This is only a problem for trials (offer code redemptions).

It would be nice if the webhook would re-fired when the user id was updated. 

Best answer by sharif

Hi @1vmgm,

You're likely getting an initial purchase webhook when the customer makes a purchase outside of the app. That can include changing subscriptions in settings, purchasing directly from the App Store, or redeeming a coupon code in the App Store.

If you want to prevent that, I recommend not calling configure on the SDK until the customer logs in. That way, right when they log in the SDK processes the offer code purchase on the device.

This post has been closed for comments

3 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • October 9, 2024

Hey @1vmgm,

I’m checking on some things with the team and will get back to you soon!


sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Answer
  • October 16, 2024

Hi @1vmgm,

You're likely getting an initial purchase webhook when the customer makes a purchase outside of the app. That can include changing subscriptions in settings, purchasing directly from the App Store, or redeeming a coupon code in the App Store.

If you want to prevent that, I recommend not calling configure on the SDK until the customer logs in. That way, right when they log in the SDK processes the offer code purchase on the device.


Forum|alt.badge.img
  • Author
  • New Member
  • October 16, 2024

That makes sense, thanks!