Skip to main content

Get subscriptions

This API route will return the app subscriptions.
For auto-renewable subscriptions, the latest transaction will be returned.

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

Query parameters

environment(Optional)Values
StringApp environment (production by default)
page(Optional)
NumberPage number (Page 1 by default)
limit(Optional)
NumberNumber of results per page (20 by default, 100 maximum)
user(Optional)
StringFilter by the user (IAPHUB internal user id)
userId(Optional)
StringFilter by the user id (custom user id)
filterExpired(Optional)
BooleanFilter expired subscriptions (will return subscriptions in 'active', 'grace_period', 'retry_period', 'paused' states).

Response properties

id
StringId of the purchase
purchaseDate
StringDate of purchase
quantity
NumberQuantity
platformValues
StringPlatform
country
StringCountry of the user on purchase
tags
ObjectTags of the user on purchase
orderId
StringIOS/Android order id of the purchase
app
StringApp id
user
StringUser id (from IAPHUB)
userId
StringUser id (you provided at login) of the user that purchased the product
receipt
StringReceipt id
androidToken
StringAndroid purchase token
product
StringProduct id
productSku
StringProduct sku
productTypeValues
StringProduct type of the purchase
Only if the product has a group
productGroupName
StringProduct group name
listing
StringListing id
store
StringStore id
storeSegmentIndex
NumberStore segment index (when a store is used for testing, 0 by default)
currency
StringPrice currency
price
NumberPrice amount
convertedCurrency
StringCurrency configured on your app settings
convertedPrice
NumberPrice amount converted to the currency of your app
isSandbox
BooleanTrue if it is a sandbox purchase
isPromo
BooleanTrue if it has been purchased from a promo code (only available on the initial transaction of a auto-renewable subscription)
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) (only available on the initial transaction of a auto-renewable subscription)
isRefunded
BooleanTrue if the purchase has been refunded
Only if isRefunded is true
refundDate
StringDate of the refund
refundReasonValues
StringReason of the refund
refundAmount
NumberRefund amount (using the currency of purchase)
convertedRefundAmount
NumberRefund amount (using the converted currency)
isSubscription
BooleanTrue if it is a subscription
Only if isSubscription is true
isSubscriptionActive
BooleanTrue if the subscription is currently active
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
isSubscriptionGracePeriod
BooleanTrue if the subscription is currently in a grace period
isTrialConversion
BooleanTrue if the purchase is the conversion of a trial
subscriptionStateValues
StringCurrent state of the subscription
subscriptionPeriodTypeValues
StringPeriod type of the subscription
subscriptionCancelReasonValues
StringReason for the cancellation of the auto-renewable subscription.
subscriptionCancelDate
DateDate of auto-renewable subscription cancellation detected by IAPHUB.
Only when the transaction has been created because of a subscription replace
subscriptionProrationModeValues
StringProration mode
subscriptionRenewalProduct
StringProduct id of next renewal
subscriptionRenewalProductSku
StringProduct sku of next renewal
expirationDate
StringDate of the subscription expiration
autoResumeDate
StringThe subscription renewal has been paused, date the subscription will be automatically resumed (Android only)
nextPurchase
StringNext purchase id of a renewable subscription
linkedPurchase
StringPrevious purchase id of a renewable subscription
originalPurchase
StringOriginal purchase id of a renewable subscription

Example

Url

https://api.iaphub.com/v1/app/5d86507259e828b8fe321f7e/subscriptions

Response

{
hasNextPage: false,
list: [
{
id: '5da20ea9fbd92641ae8d0c03',
purchaseDate: '2019-10-12T17:34:33.256Z',
quantity: 1,
platform: 'ios',
country: 'US',
tags: {},
orderId: '9873637705964380',
app: '5d86507259e828b8fe321f7e',
user: '5d865c10c41280ba7f0ce9c2',
userId: '4',
product: '5d86507259e828b8fe321f8a',
listing: '5d86507259e828b8fe321f32',
store: '5d86507259e828b8fe321f85',
currency: 'USD',
price: 19.99,
convertedCurrency: 'USD',
convertedPrice: 19.99,
isSandbox: false,
isRefunded: false,
isSubscription: true,
isSubscriptionActive: true,
isSubscriptionRenewable: true,
isSubscriptionRetryPeriod: false,
isTrialConversion: false,
subscriptionState: 'active',
subscriptionPeriodType: 'normal',
expirationDate: '2019-11-12T17:34:33.256Z',
linkedPurchase: '2d865c10c41280ba7f0ce9c4',
originalPurchase: '2d865c10c41280ba7f0ce9c4',
productSku: 'membership_pricing1',
productType: 'renewable_subscription'
}
]
}