Skip to main content

Get user

This API route will let you get a user by its id.

GET

Authentication

Authentication is required by using your Api Key in the Authorization header.

Authorization: ApiKey [SERVER_API_KEY]
note

You should only use this API call from your server.
For security reasons, each API endpoint has a rate limit of 5 requests per second.

Url parameters

appId
StringApp id
userId
StringUser id

Query parameters

environment(Optional)Values
StringApp environment (production by default)
platformValues
StringUser platform, required in order to return the correct product sku (does not filter the products by platform)
upsert(Optional)
BooleanOption to create user if it doesn't exist (disabled by default)

Response properties

tags
ObjectUser tags
productsForSale
ArrayUser's products available for sale
Array element
id
StringProduct id
type
StringProduct type
sku
StringProduct sku (of the specified platform)
Only if the product has a group
group
StringGroup id
groupName
StringGroup name
Only for a subscription
subscriptionPeriodTypeValues
StringSubscription period type (Do not rely on this property for Android, eligibility can only be detected properly on the client side)
activeProducts
ArrayUser active subscriptions or non-consumables
Array element
id
StringProduct id
type
StringProduct type
sku
StringProduct sku (of the specified platform)
platformValues
StringPlatform of the purchase
purchase
StringPurchase id
purchaseDate
StringDate of the purchase
Only if the product has a group
group
StringGroup id
groupName
StringGroup name
Only for a subscription
originalPurchase
StringOriginal purchase id
expirationDate
StringDate of the subscription expiration
autoResumeDate
StringThe subscription renewal has been paused, date the subscription will be automatically resumed (Android only)
androidToken
StringAndroid purchase token
isSubscriptionRenewable
BooleanTrue if the subscription is renewable
isFamilyShare
BooleanTrue if it is shared by a family member (iOS only)
isSubscriptionRetryPeriod
BooleanTrue if the subscription is currently trying to be renewed
subscriptionStateValues
StringCurrent state of the subscription
subscriptionPeriodTypeValues
StringCurrent period type of the subscription
isPromo
BooleanTrue if it has been purchased from a promo code
Only if isPromo is true
promoCode
StringPromo code (Android: only available for subscriptions vanity codes, not available for one time codes) (iOS: the value is the offer reference name)

Example

Url

https://api.iaphub.com/v1/app/acc317e366ce2d1f18fcb743/user/5cc317e366ce2d1f18fcb743?platform=ios&environment=staging

Response

{
productsForSale: [
{
id: '5cc317e366ce2d1f18fcb7d5',
type: 'consumable',
sku: 'pack30_tier20'
},
{
id: '5cc3186a807ee31f30d7598b',
type: 'consumable',
sku: 'pack60_tier30'
},
{
id: '5c967b2a550898361bffbebe',
type: 'renewable_subscription',
sku: 'subscription1_tier5',
subscriptionPeriodType: 'normal',
group: '1cc3186a807ee31f30d75982',
groupName: 'premium'
}
],
activeProducts: [
{
id: '5c967b2a550898361bffber3',
type: 'renewable_subscription',
sku: 'subscription2_tier10',
purchase: 'c967b2a550898361bffber1',
purchaseDate: '2020-05-21T18:59:18.548Z',
expirationDate: '2021-06-20T18:59:31.763Z',
isSubscriptionRenewable: true,
isSubscriptionRetryPeriod: false,
subscriptionPeriodType: 'intro',
groupName: 'premium',
},
{
id: '5c967b2a550898361bffber3',
type: 'non_consumable',
sku: 'vipmode_tier50',
purchaseDate: "2019-04-16T11:24:17.716Z"
}
]
}