Skip to main content

SDK Reference - getProducts

React native
Flutter
Swift
Kotlin

The getProducts method retrieves both the products available for sale and the active products for the user with just one call.
This saves you from having to make separate calls to the getProductsForSale and getActiveProducts methods.

Example

var products = await Iaphub.getProducts();
React Native
Flutter
Swift
Kotlin

Parameters

ObjectOptions
String[]Include filtered subscription states

Response

Object
ArrayProducts for sale
Array
Object
StringIAPHUB product ID
StringProduct type
StringProduct sku
NumberPrice amount
StringPrice currency
StringLocalized price (Ex: '$12.99')
StringProduct title (Ex: 'Membership')
StringProduct description (Ex: 'Join the community with a membership')
Only available if the product belongs to a group
StringIAPHUB group ID
StringName of the product group created on IAPHUB
Only available for a subscription
StringDuration of the subscription cycle specified in the ISO 8601 format
ArrayOrdered list of the subscription intro phases
Array element
typeValues
StringIntro phase type
NumberIntro phase price
StringIntro phase currency code (Ex: 'USD')
StringIntro phase localized price (Ex: '$2.99')
NumberNumber of cycles of the intro phase
StringDuration of a cycle specified in the ISO 8601 format
ArrayActive products
Array
Object
StringIAPHUB product ID
StringProduct type
StringProduct sku
NumberPrice amount
StringPrice currency
StringLocalized price (Ex: '$12.99')
StringProduct title (Ex: 'Membership')
StringProduct description (Ex: 'Join the community with a membership')
Only available if the product belongs to a group
StringIAPHUB group ID
StringName of the product group created on IAPHUB
StringIAPHUB purchase ID
StringPurchase date
platformValues
StringPlatform
BooleanIndicates if the purchase was made in the sandbox environment (testing)
BooleanIndicates if the purchase was made using a promo code
StringPromo code (Android: only available for subscriptions vanity codes, not available for one time codes) (iOS: the value is the offer reference name)
StringAndroid purchase token
Only available for a subscription
StringDuration of the subscription cycle specified in the ISO 8601 format
ArrayOrdered list of the subscription intro phases
Array element
typeValues
StringIntro phase type
NumberIntro phase price
StringIntro phase currency code (Ex: 'USD')
StringIntro phase localized price (Ex: '$2.99')
NumberNumber of cycles of the intro phase
StringDuration of a cycle specified in the ISO 8601 format
StringSubscription expiration date
StringSubscription original purchase id
StringIndicates if the subscription will renew automatically
BooleanIndicates if the subscription is shared by a family member (iOS subscriptions only).
StringSubscription product id of the next renewal (only defined if different than the current product)
StringSubscription product sku of the next renewal (only defined if different than the current product)
StringCurrent state of the subscription
StringPeriod type of the subscription
StringDate when the subscription will automatically resume after being paused (Android subscriptions only).