Subscription API
General provisions
Endpoint:
Query type: POST
The query body is a JSON object with fields described in the table below.
Fields
Name | Description |
| Type of notification |
| ID of the original transaction |
| Transaction ID |
| Subscription start date in milliseconds in UTC |
| Subscription expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| Subscription price |
| Currency of the subscription payment |
| The event is flagged if it’s trial ana d isn’t flagged if it’s a subscription |
| Extension of subscription renewal date in days. If this field is filled in and the user didn’t renew the subscription before the expiration date, then wait for gracePeriod days to flag it as expired |
Fields for user identification (Attention! Regardless of the type of notification, at least one of the user IDs must be specified in the query) | |
| Available platforms: iOS |
| Available platforms: iOS |
| Available platforms: Android, Windows |
| Available platforms: Android |
| The same as Main ID in user card |
| String custom user ID Available platforms: all platforms |
| d2d numeric user idAvailable platforms: all platforms |
Notification types
Notification types | Description |
purchase | First-time subscription purchase |
renewal | Active subscription renewal |
refund | Money refund |
cancellation | Cancellation of an active subscription and proportional refund |
Server response
If the notification is accepted, the response status is 200. If the query is incorrect, the response status is 400. In case of an internal error, the response status is 500.
In case the status is 400 or 500, the error description will be indicated in the query body as a JSON object:
Notification types and corresponding fields
Available notification types for a trial (all postbacks should be flagged as ‘
isTrial
= true’):
purchase - trial subscription
cancellation - subscription cancellation before the end of that trial
2. Available notification types for subscription purchase:
purchase - subscription purchase
renewal - subscription renewal
cancellation - premature termination of a subscription and proportional refund
refund - money refund
Trial purchase
Field name | Description |
| Notification type = purchase |
| ID of the original transaction |
| Transaction ID |
| Trial start date in milliseconds in UTC |
| Trial expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| true |
Trial cancellation
Field name | Description |
| Notification type = cancellation |
| ID of the original transaction |
| Transaction ID |
| Trial expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| true |
Subscription purchase
Field name | Description |
| Notification type = purchase |
| ID of the original transaction |
| Transaction ID |
| Subscription start date in milliseconds in UTC |
| Subscription expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| false |
| Subscription price |
| Currency of the subscription payment |
| Extension of subscription renewal date in days |
Subscription renewal
Field name | Description |
| Notification type = renewal |
| ID of the original transaction |
| Transaction ID |
| Subscription start date in milliseconds in UTC |
| Subscription expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
|
|
| Subscription price |
| Currency of the subscription payment |
| Extension of subscription renewal date in days |
Subscription cancellation
Field name | Description |
| Notification type = cancellation |
| ID of the original transaction |
| Transaction ID |
| Subscription expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| false |
Subscription refund
Field name | Description |
| Notification type = refund |
| ID of the original transaction |
| Transaction ID |
| Subscription expiration date in milliseconds in UTC |
| Subscription SKU |
| Subscription type (line) |
| false |
| The amount of money refunded to the user |
| Currency of the subscription payment |
Query example
Last updated