AI-generated Key Takeaways
-
This API endpoint allows you to check the purchase and consumption status of an in-app item.
-
The HTTP request uses a GET method and requires the package name, product ID, and purchase token as path parameters.
-
The request body should be empty, and the response body contains a ProductPurchase object if successful.
-
Authorization is required using the
https://www.googleapis.com/auth/androidpublisherOAuth scope.
Checks the purchase and consumption status of an inapp item.
HTTP request
GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
packageName
|
The package name of the application the inapp product was sold in (for example, 'com.some.thing'). |
productId
|
The inapp product SKU (for example, 'com.some.thing.inapp1'). |
token
|
The token provided to the user's device when the inapp product was purchased. |
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of ProductPurchase
.
Sample
The following is a sample request:
curl \ - X GET \ 'h tt ps : //androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/products/exampleSKU/tokens/exampleToken' \ - H 'Accep t : applica t io n /jso n '
The following is a sample response:
{ "kind" : "androidpublisher#productPurchase" , "purchaseTimeMillis" : "1678886400000" , "purchaseState" : 0 , "consumptionState" : 0 , "developerPayload" : "sample developer payload" , "orderId" : "GPA.1234-5678-9012-34567" , "purchaseType" : 0 , "acknowledgementState" : 0 , "productId" : "com.example.app.productId" , "purchaseToken" : "purchase token" , "quantity" : 1 , "refundableQuantity" : 1 , "regionCode" : "US" , "obfuscatedExternalAccountId" : "obfuscated external account id" , "obfuscatedExternalProfileId" : "obfuscated external profile id" }
Authorization scopes
Requires the following OAuth scope:
-
https://www.googleapis.com/auth/androidpublisher

