Skip to main content

Server-side API

With the API, you can:

  1. Check a user's subscription status.
  2. Activate a user's subscription with an access level.
  3. Retrieve user attributes.
  4. Set user attributes.

note

To track subscription events, use Webhook integration in Adapty or integrate directly with your existing service.

Case 1: Syncing subscribers between web and mobile

  1. If you use web payment providers like Stripe, ChargeBee, or others, you can sync your subscribers easily. Here’s how:
    1. Assign a unique ID to each user.
    2. Check their subscription status using the API.
    3. If a user is on a freemium plan, display a paywall on your website.
    4. After a successful payment, update the subscription status in Adapty via API.
    5. Your subscribers will automatically stay in sync with your mobile app.

Case 2: Grant a subscription

note

Due to security reasons, you can't grant a subscription via mobile SDK.

If you're selling through your own online store, Amazon Appstore, Microsoft Store, or any other platform besides Google Play and App Store, you’ll need to sync those transactions with Adapty to provide access and track the transaction in analytics.

  1. Assign a unique ID to each user.
  2. Set up a custom store for your products in the Adapty Dashboard.
  3. Sync the transaction to Adapty using the Set transaction API request.

Case 3: Grant an access level

Let’s say you're running a promotion offering a 7-day free trial and you want the experience to be consistent across platforms. To sync this with the mobile app:

  1. Assign a unique ID to each user.
  2. Use the API to grant premium access for 7 days.

After the 7 days, users who don’t subscribe will be downgraded to the free tier.

Case 4: Syncing users' properties and custom attributes

If you have custom attributes for your users—such as the number of words learned in a language learning app—you can sync them as well.

  1. Assign a unique ID to each user.
  2. Update the attribute via API or SDK.

These custom attributes can be used to create segments and run A/B tests.


What's next: