Skip to content

Subscription-based APIs

A subscription-based API is a published API proxy that has one or more subscription plans assigned. Subscription plans define quotas, rate limits, and related controls at the organization level. When consumers use the API Platform Developer Portal, they choose an API, subscribe to the API with a plan, and generate Subscription Token according to your plan rules.

This model fits APIs where you need tiered access, usage limits, or clear commercial separation between consumer applications.

Before you begin

Assign subscription plans to the API

  1. Sign in to the API Platform Console.
  2. Select the project and the API proxy.
  3. Go to ManageMonetize.
  4. Enable the Subscription Plan Status toggle for each plan you want to offer for this API by toggling Enabled field.

    Enable Subscription Plans

For detailed steps and field behavior, see Assign Subscription Plans to APIs.

Assign Subscription Validation Policy to the API

  1. Go to DevelopPolicies.

    Policies Overview

  2. Select Subscription Validation policy.

    Select Sub Val Policy

  3. (Optional) Configure Subscription Header/Cookie value in the policy Advanced Section.

    Select Sub Val Policy Advanced

  4. Click Add to attach the policy to API level policy.

  5. Click Save to save the API.

    Policies Save

Deploy the API

  1. Go to Deploy and click Deploy.

    Deploy API

Publish the API

  1. Go to ManageLifecycle.

    LifeCycle Created

  2. Click Publish.

  3. In the publish dialog, confirm the display name and production endpoint and click Confirm. The lifecycle state becomes Published.

    LifeCycle Published

Subscribe to the API

  1. Navigate to Developer Portal by clicking Developer Portal.

    Navigate to Devportal

  2. Consumers can find the API in the Developer Portal by going to APIs.

  3. Select the API and click Subscribe.

    Select API to Subscribe

  4. Pick a Subscription plan and click Subscribe.

    Select Plan to Subscribe

  5. You will receive a Subscription Token.

    Receive Subscription Token

Invoke the API

  1. Receive the cURL to invoke the API using the Subscription Token by navigating to the Documentation.

    Document API

  2. Invoke the API.

    Sample Request

    curl --request GET \
    --url <api-invocation-url> \
    --header 'Accept: application/json' \
    --header 'Subscription-Key: <subscription-token>' -k
    

    Sample Response

    Invoke API