Inconsistent identifiers for non-subscription transaction between purchaser info and webhooks

  • 7 October 2021
  • 1 reply

Badge +6

Hey there, I was wondering what the best way to keep track of (have a unique id) non-subscription purchases is, that is usable both in frontends, and in webhooks.


When accessing purchaser info after making a transaction in javascript, it gives a `revenueCatId` for each transaction, and no transaction id. However the webhooks only return `id` and `transaction_id`, with the former seeming to be related to the webhook event, and none of these ids matching each other.


Because of this we have no way of knowing if an event from a webhook is the same transaction as is in someone’s app. Is there any way of getting a unique id for a transaction everywhere?


Best answer by sharif 8 October 2021, 23:34

View original

1 reply

Userlevel 5
Badge +9

I can understand how that’s a confusing experience! The revenueCatId in the SDK corresponds to the id property of the Non-Subscription object of the GET /subscribers endpoint. So when you receive a webhook, just make a request to the endpoint using the app user ID in the body of the webhook to get the id of the purchase, which you can save and later compare to the revenueCatId in the SDK.