Solved

Retrieving Transaction ID from the REST API

  • 4 December 2021
  • 3 replies
  • 1276 views

Userlevel 1
Badge +5

We would like to receive App Store Transaction IDs when calling the REST API https://api.revenuecat.com/v1/subscribers/app_user_id

I have seen other posts where developers request this, and the response from ReveneCat has been to use the Webhook.

I am aware that the ID is provided in the Webhook and we are using this, however, this is not a completely satisfactory solution.

Issue 1: Missed Webhook Callbacks

If for whatever reason our server does not receive/process the webhook callback then we will never know the transaction/order ID. We have logic in our app and on our backend servers that calls the RevenueCat API’s to refresh/sync user’s subscriptions. Without a transaction ID we cannot guarantee the uniqueness of a subscription.

Issue 2: Legacy Migration

We are migrating from native implementations of our app to Flutter. In that effort we identified RevenueCat as a great solution. However, we still have legacy customers and our backed depends on using the transaction Id’s from the App Stores. Our product has a consumable component and when we track the usage in the consumable model we use the id’s to associate with usage credits. Therefore, it’s important for us to uniquely identify each purchase/subscription. It is not adequate just to know that a subscription has not expired.

If RC had an alternative way to uniquely track each subscription (other than renewal date) we could probably convert over, but we prefer to use the app stores id.

Regards,
TKeithB

 

icon

Best answer by tina 13 December 2021, 22:22

View original

3 replies

Userlevel 5
Badge +10

Hey @tkeithblack 

I can add this as a feature request. There are also other ways to retrieve the transaction ID.

If you are using the native iOS SDK, you can save the transaction ID from the SKPaymentTransaction that is returned in the completion block and send this to your servers https://sdk.revenuecat.com/ios/Type%20Definitions.html#/c:RCPurchases.h@T@RCPurchaseCompletedBlock

We also include the store_transaction_id and original_store_transaction_id fields in ETL exports. For your legacy customers, after the client or sever side migration, their transactions will be included in these daily exports. 

 

Since you mentioned consumables, our GET /subscribers endpoint includes a RevenueCat unique id for the non-subscription object that you can utilize to track consumption of the consumable product. 

Userlevel 1
Badge +5

Thank you for the reply. We are not using the Native iOS SDK, we’re using the Flutter interface package.

I’ll take a look at the ETL Exports.

Thanks,

KeithB

Badge

Hi,
is there any plan for adding “store_transaction_id” into rest api response?

Reply