How can ı. get order id in flutter for android
How can I get the transaction or order ID in Flutter?
![Why Not Both? Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ccbc4ad2-bff5-4fe9-b65f-83bbced7a8ac_thumb.png)
Hey
We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.
If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.
I review your code in the library purchases-hybrid-common you can add the order Id, but you filter that in this line
Hey
We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.
If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.
![Why Not Both? Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ccbc4ad2-bff5-4fe9-b65f-83bbced7a8ac_thumb.png)
It is ridiculous not to share this ID, it is very difficult to find it from the user database in case of refunds or problematic payments. Isn't this identity still shared in flutter? If it is not shared, why is it not shared yet?
![Why Not Both? Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ccbc4ad2-bff5-4fe9-b65f-83bbced7a8ac_thumb.png)
HI, there is some way to identify the purchase?
I understand that I can validate the purchase with a webhook, but if i dont have any ID (like order ID o transaction ID) How i can verify if the purchase is the same that the webhook send to my server?
please, can you helpme?
![Why Not Both? Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ccbc4ad2-bff5-4fe9-b65f-83bbced7a8ac_thumb.png)
Hey
We don’t currently send the transaction or order ID in the purchase response from the Flutter SDK.
If you need access to the transaction ID, I’d recommend setting up webhooks as we include transaction identifiers in webhooks for purchases. You can consume webhooks from your server and save the transaction identifier server-side.
Please add the order ID to the response, setting up webhook to save server side and then reading from there complicates what should be a pretty simple transaction. (Make an order -> get your order id in the success response)
![Shipped It Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/00177be5-17f2-4400-bea7-87c75adea50f_thumb.png)
So, there’s currently no way of getting the order-id from the Flutter SDK when a purchase is made?
This is a problem for my use case where I need to correlate a consumable purchase to the item that’s purchased in my app
I was looking for a similar solution to this. On the flutter side after calling purchaseProduct() you can get the last transaction from the returned CustomerInfo object and then send this details to your backend.
CustomerInfo? customerInfo = await Purchases.purchaseProduct(
“myProduct”,type: PurchaseType.inapp).then((value) {
if (value.nonSubscriptionTransactions.length > 0) {
int lastItem = value.nonSubscriptionTransactions.length - 1;
StoreTransaction item = value.nonSubscriptionTransactions[lastItem];
// send item to your backend
In the backend implement the webhook and when you receive the webhook, call the subscriber endpoint:
https://api.revenuecat.com/v1/subscribers/{app_user_id}
to get a list of the transactions, then you should be able to match up the 2 on the transaction_id
![Strength In Numbers Badge](https://uploads-us-west-2.insided.com/revenuecat-en/attachment/ad9785ad-84a4-4bde-98db-d0de530785fc_thumb.png)
Thank you so much for letting me know this
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.