Requirements
Request body
The /v1/validate
request returns a JSON object containing…
Property name | Type | Description |
---|---|---|
id | string | Identifier of the product you want to validate. On iOS, can be set to your application identifier. |
type | string | Type of product being validated. Possible values:
|
additionalData.applicationUsername | string | Attach the purchases to the given application user. |
Apple validation request
Fields specific to Apple receipt validation.
Property name | Type | Description |
---|---|---|
transaction.type | string | “ios-appstore” |
transaction.id | string | Identifier of the transaction to evaluate, or set it to your application identifier if id has been set so. |
transaction.appStoreReceipt | string | Base64 encoded appStoreReceipt. |
Google validation request
Fields specific to Google receipt validation.
Property name | Type | Description |
---|---|---|
transaction.type | string | “android-playstore” |
transaction.id | string | Identifier of the transaction to evaluate, corresponds to the orderId in the receipt from Google |
transaction.purchaseToken | string | The purchase token. |
transaction.receipt | string | JSON-encoded receipt. |
transaction.signature | string | Signature for the attached receipt. |
Microsoft validation request
Fields specific to Microsoft Store receipt validation.
Notice: validation for microsoft can respond with specific fields set:
- data.serviceTicketType – “purchase” or “collections”
- data.serviceTicket – an authentication ticket
The value of this ticket is used to retrieve the storeId required in the validation request. Contact us if you need assistance with that.
Property name | Type | Description |
---|---|---|
transaction.type | string | “windows-store-transaction” |
transaction.storeId | string | (Microsoft only) Identifier of the product to validate. |
license.storeIdKey_collections | string | Microsoft b2bKey for collections |
license.storeIdKey_purchases | string | Microsoft b2bKey for purchases |
Success response body
The /v1/validate
request data should be a JSON object containing…
Property name | Type | Description |
---|---|---|
ok | boolean | True if the validation request was successful. |
data.collection | array | An array of Purchase object. See below. |
data.ineligible_for_intro_price | array | An array of product IDs for which the user cannot use introductory prices |
Purchase
A purchase object.
Property name | Type | Description |
---|---|---|
id | string | The unique identifier of the product. |
purchaseDate | number | Time at which the product was granted, in milliseconds since epoch |
expiryDate | number | Time at which the current (or last active) subscription is set to expire, in milliseconds since epoch |
isExpired | boolean | Whether a subscription has expired. Check the cancelationReason field to know the reason why the subscription has expired. |
renewalIntent | string | Whether the customer intents to let a subscription be renewed when it reaches its current expiry time. Possible values:
|
renewalIntentChangeDate | number | Last time the customer or system changed the renewalIntent status. |
cancelationReason | string | The reason why a transaction was canceled, a subscription is not auto-renewing or expired. Possible values are:
You can use this value to display an alternative subscription product in your app, to win back the customer, such as a lower-level subscription plan to which the user can downgrade from their current plan. Consider presenting an attractive upgrade or downgrade offer. |
isBillingRetryPeriod | boolean | Whether an auto-renewable subscription is in the billing retry period.
This field indicates whether the platform is attempting to renew an expired subscription automatically. If the customer’s subscription failed to renew because the platform was unable to complete the transaction, this value reflects whether the platform is still trying to renew the subscription. You can use this field to:
|
isTrialPeriod | boolean | Whether a subscription is in the free trial period. Possible values are:
|
isIntroPeriod | boolean | Whether an auto-renewable subscription is in the introductory price period. |
discountId | string | Identifier of the subscription offer redeemed by the user. (iOS only) You provide this value in the Promotional Offer Product Code field when you create the subscription offer in App Store Connect. You can use this value to:
|
priceConsentStatus | string | Price consent status for a subscription price increase. Possible values:
|
Error response
When the validation was not successful or the validated product is not owned, /v1/validate
request returns a JSON object containing…
Property name | Type | Description |
---|---|---|
ok | boolean | False if the validation request was unsuccessful or the requested product is not owned. |
code | number | The error code. Possible values:
|
message | string | Plain english description of the error. |