Tutorial: How to monetize an API Product
This tutorial shows you how to define a pricing plan for an API Product, and how API consumers can then subscribe to that monetized Product in the Developer Portal.
Before you begin
- Either be the provider organization owner, or have Settings: Manage permissions, for your API Manager account.
- The billing microservice must be enabled on your management system by your system administrator. See Configuring monetization on Kubernetes and Configuring monetization on VMware for more information.
- Have internet access that allows your API Connect management server to communicate with your Stripe account. See Firewall requirements on Kubernetes and Firewall requirements on VMware for more information about this requirement.
- Have a Stripe test account. If you don't 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.
About this tutorial
IBM® API Connect includes a subscription billing feature that allows API providers to define pricing Plans in their API Products, and monetize their API offerings. If a Product contains a pricing Plan, API consumers must enter their payment information into the Developer Portal before they can subscribe to that Plan. API Connect supports integration with Stripe Subscription Billing, an independent cloud service that manages monetized product Plans, customers, their payment information, and their subscription history, in order to generate monthly invoices and charge customers automatically. With this integration, Stripe serves as both the subscription billing system and the payment processing system.
Set up your billing resource
Create a Stripe billing integration resource for your provider organization by completing the following steps.
Configure a stripe-test catalog
To be able to publish monetized Product Plans, you must add your billing integration resource to a catalog. During this activity you will create a new catalog called stripe-test, so you can delete the catalog at the end of the tutorial if you wish.
- In the API Manager, click
the
Manage icon in the side navigation bar.
- Click , and create a new catalog called stripe-test.
- Click the stripe-test catalog tile, and then click the Catalog settings tab. Select Gateway services and ensure that the catalog is configured to use either a DataPower® Gateway (v5 compatible) or a DataPower API Gateway, or both. Then select Portal, and create a Developer Portal. If you're not sure how to configure these settings, see Creating and configuring Catalogs.
- To add the billing integration resource to the catalog, select Billing,
and then click Edit.
- Select the My Stripe Billing resource that you created earlier, and click
Save. My Stripe Billing is now listed as the billing integration resource for the stripe-test catalog.
Enable the Stripe payment method in the Developer Portal
To enable API consumers to subscribe to Products with paid Plans, you must configure the Stripe payment method in the Developer Portal for the stripe-test catalog.
- Log in to the Developer Portal as an administrator.
- If the administrator dashboard is not displayed, click Manage to display it.
- In the administrator dashboard, click Extend. The List tab for the Extend page opens, and the list of installed modules is displayed.
- Enter Stripe into the search filter, select APIC Monetization
Stripe Integration, and click Enable. The default settings for the APIC Monetization Stripe Integration module are now enabled, and you now need to edit those settings.
- Click .
- Change the billing provider module mapping drop-down option to be the newly enabled
APIC Monetization Stripe Integration (ibm_stripe_payment_method), and click
Save configuration.
- Click My Stripe Billing integration resource in
Step 5 of Set up your billing resource. Then click
Save configuration.The Stripe payment method is now configured in the Developer Portal.
, and enter the same Stripe test API
credentials that you entered for the
Create and publish a monetized Product
Create a Product that includes a pricing Plan, and publish the Product to the Developer Portal.
- First you need to download a test API to use with your Product:
- If your stripe-test catalog uses a DataPower Gateway (v5 compatible), download the findbranch.txt file to your local filesystem. Rename this file to findbranch.yaml.
- If your stripe-test catalog uses a DataPower API Gateway, download the findbranch_v6.txt file to your local filesystem. Rename this file to findbranch.yaml.
- To import the API into API Manager, click
the
Develop icon in the side navigation bar, and then click .
- Ensure that OpenAPI 2.0 is selected, and then select Existing
OpenAPI from the Import section, and click
Next.
- Click Drag and drop files here or click to upload, and select the
findbranch.yaml file on your local file system to upload it. Then click
Next.
- Leave Activate API unchecked, as you will activate the API when you publish the monetized Product later in this section. Click Next to continue.
- The Summary page displays, showing that the API definition has been
generated.
- Click Edit API to see your generated API definition, and then click the
Develop icon in the side navigation bar to continue with creating a monetized Product. The FindBranch API should now be shown in your list of APIs - if it isn't, just click the
Refresh icon to refresh your browser.
- Click
- Select New product, and click Next.
- Enter FindBranches in the Title field, and click
Next.
- Select the FindBranch API that you imported, or your own API, and click Next.
- Accept the defaults for Plans, and click Next.
You'll add a priced Plan later.
- Accept the defaults for Publish, Visibility, and
Subscribability as well, and click Next.
- The Summary page is displayed, confirming that the new product has been
created.
- Click Edit product to continue with the configuration.
- With the Design tab selected, click Plans in the
navigation menu.
- In the Billing integration section, select my-stripe-billing as the billing integration resource.
- In the Plans section, click Add to create a new Plan with pricing.
- Enter a Title for the new Plan, for example Gold, but leave the Approval checkbox unchecked.
- Change the toggle to On for Plan pricing, and the Plan pricing definition section is displayed.
- Select Include free trial days, and leave the default of 1 for the number of trial days that a subscriber can use the Plan without charge, after which their billing cycle begins.
- Again, leave the defaults of USD - US Dollar for
Currency, and 10 for the Price per
month to bill the subscriber for.
- In the Plan rate limits section, change the Calls to
be 1000 per hour, to differentiate this Plan from the Default Plan. Click
Save to save the new pricing Plan.
- Now you can publish the monetized Product to the stripe-test catalog by clicking the
Options icon for the Product , and clicking Publish.
- Ensure that the stripe-test catalog is selected, and then click Publish.
- You can verify that the FindBranches Product is now published by clicking
the
Manage icon in the side navigation bar, and selecting the stripe-test tile. The FindBranches Product is now listed under the Products tab.
Tip: Remember to click theRefresh icon if the Product isn't displayed.
Verify the publish in your Stripe account
You can verify that the Product Plans were published into your Stripe account by completing the following steps.
- Log in to your Stripe test account.
- Select Events in the Developer navigation.
- Check that events were created when you published the Product plans.
View the monetized Product in the Developer Portal
You can check that the monetized Product is now visible in the Developer Portal by completing the following steps.
- Open the Developer Portal for the stripe-test catalog in your web browser. You don't need to log in.
- You should see the FindBranches Product on the Home page.
- Click the FindBranches tile, and the Plans are displayed, showing both
the Default and Gold Plans. You can see the pricing information for the Gold Plan, and if you hover
over the text 2 rate limits you can see the rate limit detail. An API
Consumer can now subscribe to this monetized Plan.
What you did in this tutorial
In this tutorial, you successfully created and published a monetized Product ready for API Consumer subscriptions. You completed the following activities:
- Created a Stripe billing integration resource.
- Configured a stripe-test catalog.
- Enabled Stripe in the Developer Portal.
- Created and published a monetized Product.
- Verified the publish in your Stripe account.
- Viewed the monetized Product in the Developer Portal.