Platform Specific Methods - Validate IOS Receipt

Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item

POST https://titleId.playfabapi.com/Client/ValidateIOSReceipt

Request Body

Name Required Type Description
CurrencyCode True
  • string

Currency used for the purchase.

PurchasePrice True
  • number

Amount of the stated currency paid for the object.

ReceiptData True
  • string

Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase.

Responses

Name Type Description
200 OK

Once verified, the catalog item matching the iTunes item name will be added to the user's inventory.

400 Bad Request

This is the outer-wrapper for all responses with errors

Security

SessionTicket

This API requires a client session ticket, available from any Client Login function.

Type: apiKey
In: header

Definitions

ApiErrorWrapper

The basic wrapper around every failed API response

ValidateIOSReceiptRequest

The CurrencyCode and PurchasePrice must match the price which was set up for the item in the Apple store. In addition, The ItemId of the inventory in the PlayFab Catalog must match the Product ID as it was set up in the Apple store. 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).

ValidateIOSReceiptResult

Once verified, the catalog item matching the iTunes item name will be added to the user's inventory.

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code
  • number

Numerical HTTP code

error
  • string

Playfab error code

errorCode
  • number

Numerical Playfab error code

errorDetails
  • object

Detailed description of individual issues with the request object

errorMessage
  • string

Description for the Playfab errorCode

status
  • string

String HTTP code

ValidateIOSReceiptRequest

The CurrencyCode and PurchasePrice must match the price which was set up for the item in the Apple store. In addition, The ItemId of the inventory in the PlayFab Catalog must match the Product ID as it was set up in the Apple store. 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).

Name Type Description
CurrencyCode
  • string

Currency used for the purchase.

PurchasePrice
  • number

Amount of the stated currency paid for the object.

ReceiptData
  • string

Base64 encoded receipt data, passed back by the App Store as a result of a successful purchase.

ValidateIOSReceiptResult

Once verified, the catalog item matching the iTunes item name will be added to the user's inventory.

Error Codes

Name Code
DownstreamServiceUnavailable 1127
InvalidBundleID 1098
InvalidCurrencyCode 1179
InvalidEnvironmentForReceipt 1300
InvalidProductForSubscription 1338
InvalidReceipt 1021
InvalidVirtualCurrency 1051
NoMatchingCatalogItemForReceipt 1178
ReceiptAlreadyUsed 1022
ReceiptContainsMultipleInAppItems 1097
ReceiptDoesNotContainInAppItems 1096
SubscriptionAlreadyTaken 1340