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
- 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:
Define the Plan
- Create an API in the API Connect Designer if you
don’t already have an existing one that you want to use.
- In the API Connect Designer interface select the .
- Select the APIs tab to view the existing APIs.
- Select Add + to create an API or to import one.
- Enter the required information for the API.
- Leave the Add a product box unselected.
- Add the API to a Product.
- Select the Products tab to view the list of Products.
- Select Add + to create or import a Product.
- Complete the required information for the Product.
- Select Create product to create your Product.
- With the Design tab selected for your new Product, select APIs in the navigation.
- Select + beside the APIs entry to add your API to the Product.
- Select your API, and then Apply.
- Create the Plan with pricing for your Product.
- 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.
- Delete the Default Plan by selecting its trash icon.
- Select + to create your first Plan, which is titled New Plan 1 by default.
- Change the Title and Name to Basic.
- Select Monthly Subscription in the Billing Model field.
- Select USD in the Currency field.
- Set the price per month to 9.99.
- Set the Free Trial Days to 30.
- Set your rate limits to what you want for the Product on that Plan. For this example, set it to 7 calls per minute.
- Leave the rest of the information as it is.
- Select the Save icon () to save the new Plan.
Publish your Product to catalog
- Stage your Product to a catalog by selecting the stage icon and selecting the catalog to stage the product to.
- Select the Navigate to... icon () > Dashboard to view your catalogs.
- Select the catalog where you staged your product.
- Select the Settings tab, and ensure that the Development mode slider is off.
- Select the Save icon () to save your settings, if you changed them.
- 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.
- Select the icon of the three vertically aligned dots next to your product, and select Publish to publish your product.
- 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
- Log in to your Stripe account with your API Connect management server, if you are not already logged in.
- Select Events and Logs in the navigation.
- 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