Solved

Is it possible to get the exact purchase price the user paid in revenuecat api?

  • 3 September 2021
  • 2 replies
  • 244 views

Badge +3

Hi there, I am using the Revenuecat REST API to confirm a user paid. For context, we send our users a special confirmation based on the amount they paid, so they can get their payment reimbursed.

I would like to get also the exact amount (ideally in €) from revenuecat REST API, but I haven’t found a proper endpoint. Does it exist? And if not, will it? I think it should be possible, since I can see it in the revenuecat dashboard if I click on a customer

 

br

icon

Best answer by sharif 3 September 2021, 22:58

View original

2 replies

Badge +3

Got it, thank you. Yeah keeping track of that information myself is certainly possible, However, we will need to manually backfill this info now for our users.

 

anyways, thank you!

 

Userlevel 5
Badge +9

I think webhooks would work well for you here. Webhooks are server-to-server notifications that RevenueCat sends to your backend any time an event happens in your app. Check out this link for a sample webhook event of a purchase: https://docs.revenuecat.com/docs/webhooks#events-format

Webhooks contain three revenue-related properties:

  • currency
  • price_in_purchased_currency
  • price

It sounds like price_in_purchased_currency and currency are the two properties you need to accomplish this. For completeness the price property is the price of the product converted to USD.

Just note that the price_in_purchased_currency is the sticker price of the subscription, which isn’t necessarily the same as the amount the user paid (although it’s pretty close.) For example, in the US, taxes are added on to the price when purchasing a subscription, so for a $10 product a user may actually pay $11 or some similar amount, with the $1 being the added tax.

Other than that, price information isn’t really available via our API. We do plan on improving our API in that respect but it’s not scheduled for the near future, so webhooks are probably your best option here.

Reply