API - Get purchase
This API route will let you to get a purchase by its id.
GET
https://api.iaphub.com/v1/app/:appId/purchase/:purchaseId
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
StringPurchase id
Query parameters
StringApp environment (production by default)
Response properties
StringId of the purchase
StringDate of purchase
NumberQuantity
platform
ValuesStringPlatform
StringCountry of the user on purchase
ObjectTags of the user on purchase
StringIOS/Android order id of the purchase
StringApp id
StringUser id (from IAPHUB)
StringUser id (you provided at login) of the user that purchased the product
StringReceipt id
StringAndroid purchase token
StringProduct id
StringProduct sku
productType
ValuesStringProduct type of the purchase
Only if the product has a group
StringProduct group name
StringListing id
StringStore id
NumberStore segment index (when a store is used for testing, 0 by default)
StringPrice currency
NumberPrice amount
StringCurrency configured on your app settings
NumberPrice amount converted to the currency of your app
BooleanTrue if it is a sandbox purchase
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
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)
BooleanTrue if the purchase has been refunded
Only if isRefunded is true
StringDate of the refund
refundReason
ValuesStringReason of the refund
NumberRefund amount (using the currency of purchase)
NumberRefund amount (using the converted currency)
BooleanTrue if it is a subscription
Only if isSubscription is true
BooleanTrue if the subscription is currently active
BooleanTrue if the subscription is renewable
BooleanTrue if the subscription is currently trying to be renewed
BooleanTrue if the subscription is currently in a grace period
BooleanTrue if the purchase is the conversion of a trial
subscriptionState
ValuesStringCurrent state of the subscription
subscriptionPeriodType
ValuesStringPeriod type of the subscription
subscriptionCancelReason
ValuesStringReason for the cancellation of the auto-renewable subscription.
DateDate of auto-renewable subscription cancellation detected by IAPHUB.
Only when the transaction has been created because of a subscription replace
StringProration mode
StringProduct id of next renewal
StringProduct sku of next renewal
StringDate of the subscription expiration
StringDate when the subscription will automatically resume after being paused. Note that this feature is available only on Android.
StringNext purchase id of a renewable subscription
StringPrevious purchase id of a renewable subscription
StringOriginal purchase id of a renewable subscription
Example
Url
https://api.iaphub.com/v1/app/5d86507259e828b8fe321f7e/purchase/5da20ea9fbd92641ae8d0c03?environment=staging
Response
{
id: '5da20ea9fbd92641ae8d0c03',
purchaseDate: '2019-10-12T17:34:33.256Z',
quantity: 1,
platform: 'ios',
country: 'US',
tags: {},
orderId: '9873637705964380',
app: '5d86507259e828b8fe321f7e',
user: '5d865c10c41280ba7f0ce9c2',
userId: '62785074-8f32-42a5-b86b-90dbd79ce212',
product: '5d86507259e828b8fe321f8a',
listing: '5d86507259e828b8fe321f32',
store: '5d86507259e828b8fe321f85',
receipt: '5d86507259e828b8fe321f34',
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'
}