[V5.0.8 or later]

Tutorial: Defining a subscription Plan with pricing for your API Product

This tutorial shows you how to define a Plan with pricing that consumers can use to subscribe to your API Product, in IBM® API Connect Version 5.0.8 and later.

About this tutorial

In API Manager, you will create a subscription Plan with pricing for your API Product.

Prerequisites

To complete this tutorial, ensure that you have the following prerequisites:
  • User ID with Administrative privileges to your API Manager account.
  • IBM API Connect version 5.0.8.0, or later, for the on-premises platform.
  • APIs that are being managed in an API Connect Developer Portal.
  • Internet access that allows your API Connect management server to communicate with your Stripe account. See Firewall requirements for more information about this requirement.
  • A Stripe test account for the credit card setup. If you do not have a Stripe account, you can create one during this tutorial. Stripe accounts (including test accounts) can be created at https://dashboard.stripe.com/register. Stripe provides the credit card payment processing for the API Connect transactions, and integrates into the API Connect Developer Portal through an iFrame.
    Important:

    There is no sharing of data between Stripe accounts, and there is no sharing of data between a single account's test keys and production keys. If you plan to use test keys for a Stripe account, make sure that you use them on a test provider organization. Only use the live API keys of your production Stripe account with your production provider organizations.

    The Stripe subscription plans, customers, payment methods, and subscriptions created using a test key are not visible when using a production key or when using the key to another account. If you change your Stripe keys after publishing a monetized product (for example, to a different account, or from test keys to production keys), the references that link APIC resources to the corresponding Stripe resources cannot be resolved. Subsequent operations might fail, resulting in inconsistent data between the APIC and Stripe systems.

Set up your environment

To define and apply payment options to your subscription Plan, complete the following steps:

  1. In API Manager, if you have not previously pinned the UI navigation pane then click the Navigate to icon The Navigate to icon. The API Manager UI navigation pane opens. To pin the UI Navigation pane, click the Pin menu icon The Pin menu icon..
  2. In your API Connect Designer interface, select Navigate to The Navigate to icon) > Admin.
  3. Select the Billing tab.
  4. Select Add + > Stripe integration.
  5. Select api keys to link to your Stripe account.
  6. If you have a Stripe account, log into it on the Stripe website and skip to step 8.
  7. If you do not have a Stripe account, create one now. You can complete this tutorial with a test account or a standard account.
    1. Select Don’t have an account? Sign up.
    2. Create an account with an email address and password. You need a test account for this procedure.
    3. Log in to your new Stripe account.
  8. In the Stripe dashboard, select API in the navigation. You will need the two keys to copy into your API Connect interface to join the two accounts.
  9. Copy your Stripe Publishable key from your Stripe dashboard, and paste it in the corresponding field on the Add Stripe Account window of API Connect.
  10. Copy your Stripe Secret Key from the Stripe dashboard, and paste it in the corresponding field on the Add Stripe Account window of API Connect.
    Note: Select the option to display the key if it is not already displayed.
  11. Select Create to complete the Stripe integration. Your new integration should be displayed in the Billing Integrations table. A status of Connected means that the connection was verified.

Define the Plan

  1. Create an API in the API Connect Designer if you don’t already have an existing one that you want to use.
    1. In the API Connect Designer interface select the Navigate to The Navigate to icon) > Drafts .
    2. Select the APIs tab to view the existing APIs.
    3. Select Add + to create an API or to import one.
    4. Enter the required information for the API.
    5. Leave the Add a product box unselected.
  2. Add the API to a Product.
    1. Select the Products tab to view the list of Products.
    2. Select Add + to create or import a Product.
    3. Complete the required information for the Product.
    4. Select Create product to create your Product.
    5. With the Design tab selected for your new Product, select APIs in the navigation.
    6. Select + beside the APIs entry to add your API to the Product.
    7. Select your API, and then Apply.
  3. Create the Plan with pricing for your Product.
    1. With your Product open, select Plans in the navigation to define the monetization Plan for your Product. The Plans are the different subscription options that your customers choose from to use your APIs.
    2. Delete the Default Plan by selecting its trash icon.
    3. Select + to create your first Plan, which is titled New Plan 1 by default.
    4. Change the Title and Name to Basic.
    5. Select Monthly Subscription in the Billing Model field.
    6. Select USD in the Currency field.
    7. Set the price per month to 9.99.
    8. Set the Free Trial Days to 30.
    9. Set your rate limits to what you want for the Product on that Plan. For this example, set it to 7 calls per minute.
    10. Leave the rest of the information as it is.
    11. Select the Save icon (The Save icon.) to save the new Plan.

Publish your Product to catalog

  1. Stage your Product to a catalog by selecting the stage icon and selecting the catalog to stage the product to.
  2. Select the Navigate to... icon (The Navigate to icon) > Dashboard to view your catalogs.
  3. Select the catalog where you staged your product.
  4. Select the Settings tab, and ensure that the Development mode slider is off.
  5. Select the Save icon (The Save icon.) to save your settings, if you changed them.
  6. Select the Products tab. Your staged product should be in the list of Products. If not, you might have staged it to a different catalog or not staged it.
  7. Select the icon of the three vertically aligned dots next to your product, and select Publish to publish your product.
  8. Confirm your visibility settings and select Publish. The Public (Developer Portal) setting indicates that anyone with access to your Developer Portal can see this Product.

Verify that the subscription is created in your Stripe account

  1. Log in to your Stripe account with your API Connect management server, if you are not already logged in.
  2. Select Events and Logs in the navigation.
  3. Verify that there is an event that was created when you published the Plan.

What you did in this tutorial

In this tutorial, you completed the following activities:

  • Connected your API with a credit card processing service (in this tutorial, we used Stripe)
  • Created a Plan with pricing for a Product
  • Staged the Product to your Developer Portal so your customers can subscribe to it