Get purchases

This API route will let you to get a list of purchases (multiple filters available).

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)
order(Optional)Values
StringOrder by purchase date (desc by default)
fromDate(Optional)
StringQuery from the specified date
toDate(Optional)
StringQuery to the specified date
user(Optional)
StringFilter by the user (IAPHUB internal user id)
userId(Optional)
StringFilter by the user id (custom user id)
originalPurchase(Optional)
StringFilter by the original purchase (to get all the transactions of a same subscription)

Response properties

hasNextPage
BooleanTrue if another page of results is available
list
ArrayPurchases list
Array element
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
Only if the mode allowing an user to have multiple user ids is enabled
userIds
ArrayUser ids of the user owning the purchase (A purchase can be owned by multiple user ids if restored)
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
isFamilyShare
BooleanTrue if it is shared by a family member (iOS only)
isPromo
BooleanTrue if it has been purchased from a promo code
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
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 of the renewable subscription cancellation
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/purchases?fromDate=2019-10-12&order=asc

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,
subscriptionPeriodType: "normal",
expirationDate: '2019-11-12T17:34:33.256Z',
linkedPurchase: '2d865c10c41280ba7f0ce9c4',
originalPurchase: '2d865c10c41280ba7f0ce9c4',
productSku: 'membership_pricing1',
productType: 'renewable_subscription'
}
]
}