lxknvlk
lxknvlk

Reputation: 2850

How to get Google Play purchase info by order ID

I know that I can get purchase info on users device like this

https://developers.google.com/android-publisher/api-ref/purchases/products/get

But here I need the purchase token, that is only available on the device.

Is there a way to get order info using only the orderID (GPA.1234-1234-124)?

Upvotes: 1

Views: 9717

Answers (4)

Artur Khrabrov
Artur Khrabrov

Reputation: 761

you can find order information by GPA-id in the order management UI - https://play.google.com/console/u/0/developers/NNN/orders/

then you can copy purchase token and use it for fetch the order using API https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get

Upvotes: 0

chitgoks
chitgoks

Reputation: 310

the api seems to be available only for in app purchases, not paid apps.

Upvotes: 0

yw07
yw07

Reputation: 77

You can't get the purchase information by GP order-id directly, but you can get the info by purchase-token.
There's a place to find the purchase-token, open google play console - order management - order detail by order-id, on top of the page, you can find the button to get the purchase-token.
Using web-api https://developers.google.com/android-publisher/api-ref/purchases/products/get, you can get the details.

Upvotes: 1

Nick Fortescue
Nick Fortescue

Reputation: 13836

No, because this is a terrible idea. This API is designed to supply server side tools that you use to verify purchases in your own secure infrastructure. If you put this into the app it would be vulnerable to attackers and fraud.

If you want to check a users purchases in app, use the normal Billing API.

Upvotes: -3

Related Questions