API - Post user receipt
This API route will let you post a user ios/android receipt.
POST
https://api.iaphub.com/v1/app/:appId/user/:userId/receipt
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
StringApp id
StringUser id
Body parameters
StringApp environment (production by default)
platform
ValuesStringUser platform
StringReceipt token
StringProduct sku (Required for android only)
upsert
(Optional)BooleanOption to create user if it doesn't exist (disabled by default)
Response parameters
status
ValuesStringStatus of the receipt
ArrayThe new transactions processed in the receipt
Array element
StringProduct id
StringProduct sku
StringPurchase id
StringPurchase date
webhookStatus
ValuesStringWebhook status
Only for a subscription
StringDate of the subscription expiration
StringThe subscription renewal has been paused, date the subscription will be automatically resumed (Android only)
StringTrue if the subscription is renewable (false if the subscription has been cancelled)
StringTrue if the subscription is currently trying to be renewed
subscriptionPeriodType
ValuesStringCurrent period type of the subscription
ArrayThe old transactions in the receipt (Already processed or expired subscriptions, limited to the latest transaction of an sku)
Array element
StringProduct id
StringProduct sku
StringPurchase id
StringPurchase date
Only for a subscription
StringDate of the subscription expiration
StringTrue if the subscription is renewable (false if the subscription has been cancelled)
StringTrue if the subscription is currently trying to be renewed
subscriptionPeriodType
ValuesStringCurrent 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: []
}