Skip to main content
Solved

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

  • September 3, 2021
  • 2 replies
  • 487 views

Forum|alt.badge.img+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

Best answer by sharif

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.

View original
Did this post help you find an answer to your question?

2 replies

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 513 replies
  • Answer
  • September 3, 2021

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.


Forum|alt.badge.img+3
  • Author
  • New Member
  • 1 reply
  • September 6, 2021

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!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings