Skip to main content

API - 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

StringApp id
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)
returnNew(Optional)(Default: false)
BooleanWhen enabled, this property ensures that user data is returned even if the specified user ID is not found on IAPHUB.

Response properties

ObjectUser tags
ArrayUser's products available for sale
Array element
StringProduct id
StringProduct type
StringProduct sku (of the specified platform)
Only if the product has a group
StringGroup id
StringGroup name
Only for a subscription
StringSubscription period type (only returns if the product includes an introductory offer or free trial; does not indicate eligibility)
ArrayUser active subscriptions or non-consumables
Array element
StringProduct id
StringProduct type
StringProduct sku (of the specified platform)
platformValues
StringPlatform of the purchase
StringPurchase id
StringDate of the purchase
Only if the product has a group
StringGroup id
StringGroup name
Only for a subscription
StringOriginal purchase id
StringDate of the subscription expiration
StringThe subscription renewal has been paused, date the subscription will be automatically resumed (Android only)
StringAndroid purchase token
BooleanTrue if the subscription is renewable
BooleanTrue if it is shared by a family member (iOS only)
BooleanTrue if the subscription is currently trying to be renewed
StringCurrent state of the subscription
StringCurrent period type of the subscription
BooleanTrue if it has been purchased from a promo code
Only if isPromo is true
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"
}
]
}