Validate Google Play Purchase
NOTE: This is a Legacy Economy API, and is in bugfix-only mode. All new Economy features are being developed only for version 2. Validates a Google Play purchase and gives the corresponding item to the player.
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| GoogleAPIServiceUnavailable | 1534 |
| GoogleAPIServiceUnknownError | 1535 |
| GoogleServiceAccountFailedAuth | 1533 |
| GoogleServiceAccountInvalid | 1332 |
| InvalidBundleID | 1098 |
| InvalidProductForSubscription | 1338 |
| InvalidPurchaseTransactionStatus | 1081 |
| InvalidReceipt | 1021 |
| MissingTitleGoogleProperties | 1090 |
| NoMatchingCatalogItemForReceipt | 1178 |
| NoRealMoneyPriceForCatalogItem | 1180 |
| ProductDisabledForTitle | 1609 |
| ReceiptAlreadyUsed | 1022 |
| ReceiptCancelled | 1023 |
| SubscriptionAlreadyTaken | 1340 |
Authorizations
This API requires a client session ticket, available from any Client Login function.
Body
The packageName and productId are defined in the GooglePlay store. The productId must match the ItemId of the inventory item in the PlayFab catalog for the title. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). Each receipt may be validated only once to avoid granting the same item over and over from a single purchase.
The packageName and productId are defined in the GooglePlay store. The productId must match the ItemId of the inventory item in the PlayFab catalog for the title. This enables the PlayFab service to securely validate that the purchase is for the correct item, in order to prevent uses from passing valid receipts as being for more expensive items (passing a receipt for a 99-cent purchase as being for a $19.99 purchase, for example). Each receipt may be validated only once to avoid granting the same item over and over from a single purchase.
Original JSON string returned by the Google Play IAB API.
Signature returned by the Google Play IAB API.
Catalog version of the fulfilled items. If null, defaults to the primary catalog.
Currency used to pay for the purchase (ISO 4217 currency code).
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
Amount of the stated currency paid, in centesimal units.
Response
Once verified, the catalog item (ItemId) matching the GooglePlay store item (productId) will be added to the user's inventory. This result should be used for immediate updates to the local client game state as opposed to the GetUserInventory API which can have an up to half second delay.
The Http status code. If X-ReportErrorAsSuccess header is set to true, this will report the actual http error code.
The Http status code as a string.
Once verified, the catalog item (ItemId) matching the GooglePlay store item (productId) will be added to the user's inventory. This result should be used for immediate updates to the local client game state as opposed to the GetUserInventory API which can have an up to half second delay.
