Method: purchases.products.get

  • This operation checks the purchase and consumption status of an in-app product.

  • It requires an HTTP GET request to a specific URL with the package name, product ID, and purchase token.

  • The request body must be empty, and the response provides details about the product purchase.

  • This functionality requires authorization with the https://www.googleapis.com/auth/androidpublisher 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

string

The package name of the application the inapp product was sold in (for example, 'com.some.thing').

productId

string

The inapp product SKU (for example, 'com.some.thing.inapp1').

token

string

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 \
  'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/products/exampleSKU/tokens/exampleToken' \
  -H 'Accept: application/json'

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