LogoLogo
My AppsLive demoNewsArticles
  • Introduction
  • 📌Product updates: 2025
    • 2024
    • 2023
  • Getting Started
    • Registration
    • Adding a space
    • Adding an app to the space
  • Basic Events & Custom Events
  • Integration
    • Expert Tips
      • What to track
      • Payments & Anti-cheat
      • Check your integration
    • Integration of SDK 2.0+
      • SDK Integration
        • Android
        • iOS
        • macOS
        • Windows
        • Web
          • Web SDK Integration
          • Web SDK Releases
        • Unity
        • Unreal Engine
        • Godot Engine
      • Automatic payment tracking
        • App Store
        • Google Play
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anticheat methods
        • Track sessions
      • Push notifications
        • Android
        • iOS
        • Windows (UWP)
        • Unity
          • Android
          • iOS
          • Windows (UWP/WSA)
        • Unreal Engine
      • A/B testing
        • Description of A/B testing on the SDK side
        • Working with A/B tests in the devtodev interface
        • A/B testing examples
    • Integration of SDK 1.0+ (deprecated)
      • SDK Integration
        • iOS
        • Android
        • Windows 8.1 and 10
        • Web
        • Unity
        • Mac OS
        • Adobe Air
        • UE4
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anti-cheat Methods
      • Push Notifications
        • IOS
        • Android
        • Windows 8.1 and Windows 10
        • Unity
        • Abode Air
        • UE4
    • Test Devices
    • Server API
      • Data API 2.0
      • Subscription API
      • Push API
        • IOS
        • Android
        • Windows UWP
        • Windows
      • Raw Export
      • Labels API
      • Data API
    • Import historical data via API
    • Data Export
      • Data Export to Cloud Storage (BigQuery / Amazon S3)
  • 3rd Party Sources
    • Attribution Trackers
      • AppsFlyer
      • Adjust
      • Branch.io
      • Kochava
      • Tenjin
      • Tune (MAT)
      • Singular
      • Custom postback API
      • Facebook Ads referral decryption
    • App Marketplace Data
      • App Store Connect Stats
      • App Store Subscriptions
      • Google Play Console Stats
      • Google Play Subscriptions
      • AppGallery Connect Stats
    • Ad revenue
      • AdColony
      • AdMob
      • Facebook
      • MoPub
      • Unity Ads
      • Vungle
      • Ad revenue API
    • Cohort export
  • Reports and Functionality
    • Space-related Reports and Functionality
      • Overview
      • Custom dashboards & Reports
      • SQL
        • SQL tips
        • SQL Query examples
      • Audience overlap
    • Project-related Reports and Functionality
      • Overview
        • Real-Time Dashboard
        • Acquisition reports
        • Engagement reports
        • Monetization reports
        • In-game analysis reports
        • Cohort analysis
      • Reports
      • Push Notifications
        • Android Notifications
        • IOS Notifications
        • Windows Notifications
        • Button Templates
      • Predictions
      • Users & Segments
      • Filters
      • A/B Testing
      • Tuning
      • Settings
  • Metrics and Glossary
    • Ad networks metrics
    • Market Metrics
    • Prediction Metrics
    • SDK Metrics
    • Subscription metrics
  • Space Management
  • User Profile Management
  • Limits
  • Scenarios and Best Practices
    • Analytics use cases
    • Match-3
    • MMORPG Games
    • Hyper-Casual games
    • Social Casino
    • RPG games
    • Farming games
    • Non-gaming app
    • Acquisition Example
  • FAQ
    • Identification
    • Raw Data
    • All about data discrepancies
  • Slack
Powered by GitBook
On this page
  • General provisions
  • Fields
  • Notification types
  • Server response
  • Notification types and corresponding fields
  • Trial purchase
  • Trial cancellation
  • Subscription purchase
  • Subscription renewal
  • Subscription cancellation
  • Subscription refund
  • Query example

Was this helpful?

Export as PDF
  1. Integration
  2. Server API

Subscription API

General provisions

Endpoint:

https://statgw.devtodev.com/subscriptions/api?apikey={project’s API key}

Query type: POST

The query body is a JSON object with fields described in the table below.

Fields

Name

Description

notificationType

Type of notification

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

startDateMs

Subscription start date in milliseconds in UTC

expiresDateMs

Subscription expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

price

Subscription price

currency

Currency of the subscription payment

isTrial

The event is flagged if it’s trial ana d isn’t flagged if it’s a subscription

gracePeriod

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)

idfa

Available platforms: iOS

idfv

Available platforms: iOS

advertisingId

Available platforms: Android, Windows

androidId

Available platforms: Android

userId

The same as Main ID in user card

customId

String custom user ID

Available platforms: all platforms

devtodevId

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:

{
  "title": "Bad request",
  "error": "Not set parameter api-key"
}

Notification types and corresponding fields

  1. 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

notificationType

Notification type = purchase

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

startDateMs

Trial start date in milliseconds in UTC

expiresDateMs

Trial expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

true

Trial cancellation

Field name

Description

notificationType

Notification type = cancellation

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

expiresDateMs

Trial expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

true

Subscription purchase

Field name

Description

notificationType

Notification type = purchase

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

startDateMs

Subscription start date in milliseconds in UTC

expiresDateMs

Subscription expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

false

price

Subscription price

currency

Currency of the subscription payment

gracePeriod

Extension of subscription renewal date in days

Subscription renewal

Field name

Description

notificationType

Notification type = renewal

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

startDateMs

Subscription start date in milliseconds in UTC

expiresDateMs

Subscription expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

false

price

Subscription price

currency

Currency of the subscription payment

gracePeriod

Extension of subscription renewal date in days

Subscription cancellation

Field name

Description

notificationType

Notification type = cancellation

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

expiresDateMs

Subscription expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

false

Subscription refund

Field name

Description

notificationType

Notification type = refund

originalTransactionId

ID of the original transaction

transactionId

Transaction ID

expiresDateMs

Subscription expiration date in milliseconds in UTC

product

Subscription SKU

productType

Subscription type (line)

isTrial

false

price

The amount of money refunded to the user

currency

Currency of the subscription payment

Query example

POST https://statgw.devtodev.com/subscriptions/api?apikey=ak-cDNRQl0Lypq4AOUrx8aGGMnmJT1FSebd
{
   "notificationType":"PURCHASE",
   "transactionId":"transactionId",
   "startDateMs":1640072573468,
   "expiresDateMs":1640245373468,
   "product":"com.demo.bundle.weekly",
   "price":90.9,
   "currency":"RUB",
   "isTrial":false,
   "devtodevId":4064192
}
PreviousData API 2.0NextPush API

Last updated 5 days ago

Was this helpful?