Skip to main content

Post user receipt

This API route will let you post a user ios/android receipt.

POST

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, your can only process up to 5 receipts simultaneously.

Url parameters

appId
StringApp id
userId
StringUser id

Body parameters

environment(Optional)Values
StringApp environment (production by default)
platformValues
StringUser platform
token
StringReceipt token
sku
StringProduct sku (Required for android only)
upsert(Optional)
BooleanOption to create user if it doesn't exist (disabled by default)

Response parameters

statusValues
StringStatus of the receipt
newTransactions
ArrayThe new transactions processed in the receipt
Array element
id
StringProduct id
sku
StringProduct sku
purchase
StringPurchase id
purchaseDate
StringPurchase date
webhookStatusValues
StringWebhook status
Only if the product has a group
group
StringGroup id
groupName
StringGroup name
Only for a subscription
expirationDate
StringDate of the subscription expiration
autoResumeDate
StringThe subscription renewal has been paused, date the subscription will be automatically resumed (Android only)
isSubscriptionRenewable
StringTrue if the subscription is renewable (false if the subscription has been cancelled)
isSubscriptionRetryPeriod
StringTrue if the subscription is currently trying to be renewed
subscriptionPeriodTypeValues
StringCurrent period type of the subscription
oldTransactions
ArrayThe old transactions in the receipt (Already processed or expired subscriptions, limited to the latest transaction of an sku)
Array element
id
StringProduct id
sku
StringProduct sku
purchase
StringPurchase id
purchaseDate
StringPurchase date
Only if the product has a group
group
StringGroup id
groupName
StringGroup name
Only for a subscription
expirationDate
StringDate of the subscription expiration
isSubscriptionRenewable
StringTrue if the subscription is renewable (false if the subscription has been cancelled)
isSubscriptionRetryPeriod
StringTrue if the subscription is currently trying to be renewed
subscriptionPeriodTypeValues
StringCurrent period type of the subscription

Example

Url

https://api.iaphub.com/v1/app/acc317e366ce2d1f18fcb743/user/5cc317e366ce2d1f18fcb743/receipt

Body

{
environment: 'staging',
platform: 'android',
token:'AO-J1OxnZr_-c4xGioV-wbb9YI4w7gtRzY87CRLsa6CrHuP_nF97WNzHaBjbqCyZeYYf_sZByLD1DKxkMOFlpIsiOJnSeHxu5XIwa303DbJwFQ7Lo-sM6dgY4-4DCEqk61C9qgUx0GsLaOMZJF0zMC0mRS9K8Z2P3-uSDQpUv0qorTGt7xQC42s',
sku: 'pack30_tier20'
}

Response

{
status: 'success',
newTransactions: [{
id: '5e517bdd0613c16f11e7fae0',
sku: 'pack30_tier20',
purchase: '2e517bdd0613c16f11e7faz2',
purchaseDate: '2020-05-22T01:34:40.462Z',
group: "3e517bdd0613c16f41e7fae2",
groupName: "pack",
webhookStatus: 'success'
}],
oldTransactions: []
}