Skip to main content
Question

How to get a purchase for specific store_purchase_identifier avoiding extracting all purchases


Forum|alt.badge.img+2

Hi there,

 

I’m currently calling https://api.revenuecat.com/v2/projects/{project_id}/customers/{customer_id}/purchases for extracting all purchases and then check for a specific one using store_purchase_identifier.
Is there a way to avoid extracting all purchases from the server every time I need to find a specific store_purchase_identifier? 

Thank you,

Yury

2 replies

hussain
RevenueCat Staff
Forum|alt.badge.img
  • RevenueCat Staff
  • 8 replies
  • April 16, 2025

Hi Yury,

Thanks for reaching out. Happy to help.

Currently, to find a specific purchase by its store_purchase_identifier, you need to extract all purchases for a customer and then search for the identifier. Unfortunately, there isn't a direct way to query for a specific store_purchase_identifier without fetching all purchases first.

If you're looking for a more efficient way to handle transactions and updates, you might consider setting up webhooks to receive real-time notifications for purchase events. This way, you can maintain a local database of relevant purchases without querying the entire history each time. You can learn more about webhooks on our docs here: https://www.revenuecat.com/docs/integrations/webhooks

Hope this helps, let me know if you have questions about anything else.

Best,

Hussain


Forum|alt.badge.img+2
  • Author
  • New Member
  • 1 reply
  • April 16, 2025

Thanks Hussain. 
One more question please, any chance I can have the very last purchases on the first page? I can’t see any β€œsort” parameters available in the API.

 


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