Enterprise Marketplace

Streamline monetization by setting up billing integration for your API marketplace

Setting up and Testing Axway Enterprise Marketplace Billing Integration Blog image

A key piece of successful API monetization is making the process more self-service. It’s why we’ve added billing integration to Amplify Enterprise Marketplace, making it easier for providers to collect payments for product usage by consumers, enhancing user convenience and streamlining revenue collection.

In this article, we will explore how to configure a billing platform, integrate it with your API marketplace, build an API Product with a paid plan which leverages the integration, and finally walk through the consumer experience for getting access to an API with the paid plan.

We will be using Stripe as the billing platform in this example.

Stripe account configuration

Navigate to Stripe at https://stripe.com and log into your account.

A developer account can be used to test your Marketplace integration. You can register for a developer account at https://dashboard.stripe.com.

The Marketplace uses a webhook with a Stripe Restricted API Key to communicate between the platforms. It supports the latest Stripe API version (2024-06-20 at the time of this writing). The Stripe UI does not provide the ability to generate a webhook using this version, so we will need to use the Stripe platform API to generate the webhook.

Create a Restricted Key for API calls from Marketplace

  1. Navigate to https://dashboard.stripe.com and log into your stripe account.
  2. Navigate to Developer -> API Keys.
  3. Click Create restricted key.
  4. Use the following values:Name: Amplify Marketplace Integration
    Permissions:
    Core resource : Customers -Write-
    All billing resources : Invoices -Write-
  5. Click create key.
  6. Click Reveal test key and note the value of the key. It will be required later in when configuring billing in the Marketplace.

Locate the Secret Key for calling Stripe APIs.

  1. Navigate to Developer -> API Keys.
  2. In the Standard keys section, click the Reveal test key button.
  3. Copy the value of the Secret key. This will be used when calling the Stripe Platform APIs.

 

 

Use the Stripe Platform API to create the Webhook

Access and Configure Stripe Postman Collection

  1. Navigate to the Postman Stripe API Collection. You will need to log on to your Postman account or create one.
  2. Either fork the project (for use online) or export the Collection and Environment (for use locally). In this example we will export and run the collection locally in Postman.         
  3. (Optional) Import the collection into Postman if running locally.
  4. Make sure the Stripe Environment Template environment is selected.
  5. Open the Stripe Environment Template.
  6. Paste the value of the Stripe Secret Key obtained above into the secret_key value in the Stripe Environment Template.
  7. Save your changes.

Create the Webhook Endpoint

  1. Locate the Webhook Endpoints folder in the Postman Collection.
  2. Select the POST Create a webhook endpoint operation.
  3. Use the following values:Note: Keys for enabled_events[2]&[3] must be added to what is provided in the template.enabled_events[0]: invoice.finalized
    enabled_events[1]: invoicemarked_uncollectable
    enabled_events[2]: invoice.paid
    enabled_events[3]: invoice.voided
    url: https://apicentral.axway.com/integrations/stripe
    api_version: 2022-11-15
    description: [Optional description. Helpful in the Stripe UI to identify the webhook]
  4. Send the POST request. Stripe will return a 200 response containing details about the newly created webhook. It is not necessary to note anything in the response.
  5. In the Stripe UI, navigate to Developers -> Webhooks. A Hosted endpoint should be present, representing the newly created webhook.

Locate the Webhook signing secret

  1. Click on the newly created webhook.
  2. Click the reveal link in the Signing secret column.
  3. Note the value of the signing secret. It will be used later when configuring Billing in the Marketplace.

Enable Stripe Billing Customer portal

  1. In the Stripe UI, navigate to Settings -> Billing -> Customer portal
  2. Enable to Customer portal link.
  3. Copy the link URL. This will be used when configuring billing in the Enterprise Marketplace.

Enable Stripe integration in Marketplace

  1. Navigate to https://platform.axway.com and log in.
  2. Navigate to Organization -> Marketplace. The Organization link can be found under the Organization name located in the top right corner of the UI.
  3. Select the Marketplace where billing will be enabled.
  4. Select the Billing tab.
  5. Enable the billing integration.
  6. Select Stripe form the billing Vendor list.
  7. Restricted key: Enter the restricted key obtained earlier when configuring Stripe.
  8. Webhook signature: Enter the value of the Webhook signing secret obtained after creating the webhook in Stripe.
  9. Customer portal: Enter the URL of the Stripe Billing customer portal obtained when enabling the customer portal in Stripe.
  10. Click Save.

This completes the configuration of both Stripe and Amplify Marketplace, enabling the Marketplace to use Stripe as a billing platform.

Enable Consumer Organizations in the Marketplace

Marketplace Consumers must be members of a Consumer Organization.  If self-signup is enabled for a Marketplace, a new user has the option to create a new Consumer Organization and they will become the administrator of that Organization. If self-signup is not enabled then a Marketplace administrator must create a Consumer Organization and invite the initial member, who will become the administrator.

Creating and managing Consumer Organizations is outside the scope of this example.  Complete details and instructions can be found in the Consumer organization management section of the Marketplace documentation.

  1. Navigate to https://platform.axway.com and log in.
  2. Navigate to Marketplaces.
  3. Locate the tile representing the Marketplace you want to configure.
  4. Click on the name of the Marketplace.
  5. Under settings, check the following.
    Note the Marketplace URL
    Consumer Organizations: Allow
    Self Signup: Disallow/Allow (optional)

If self-signup is disallowed, navigate to Consumer orgs then create a new org and invite a user per the instructions in the documentation linked above.

If self-signup is allowed, then navigate to the Marketplace URL and register as a consumer.

Note: Before registering as a consumer, you will need to either log out of the Marketplace administrative view or use a browser’s anonymous capabilities. Otherwise you will connect to the consumer Marketplace as your admin account.

Create a product with a pricing plan

In the previous section, a Marketplace was configured to integrate billing with the Stripe platform. Any product containing a paid Plan which is published to the integrated Marketplace will use Stripe for billing.

Multiple Marketplaces can be configured to use the same Stripe integration. The steps from the previous section simply need to be followed for each subsequent Marketplace.

Note: These steps assume you are familiar with creating an API Product in the Marketplace and have existing Assets to place into a Product.  If not, please refer to the Marketplace Documentation sections for Manage your Service Registry and Manage your Asset Catalog. Once you have Assets, return to these instructions.

See also: How to curate API assets with Amplify Enterprise Marketplace

In this section we will complete the minimal steps to create a Product with a Paid pricing plan. Watch the video below for a quick demo of the process.

 

 

For complete details on all options available when creating a Procut, refer to the Marketplace Documentation section on Manage your Product Foundry. For a complete description of all Pricing Plan options, refer to the Marketplace Documentation section on Manage Product Plans.

  1. Navigate to https://platform.axway.com and log in.
  2. Navigate to Catalog -> Product Foundry -> Add New.
  3. Provide a Name for the Product. Logical Name, Description and Image/Icon are optional.
    Name: Monetized Product 

  4. Click Next.
  5. Leave all defaults on the Release Management page and click Next.
  6. Select an Asset from the list of Available Assets to add to the Product by clicking the link icon to the left of the Asset name.
  7. In the Versions to include dialog, accept the defaults and click Link Asset.
  8. Click Next.
  9. In the Usage plan dialog, create a new Paid plan.
    Name: Enterprise Plan
    Plan Cost: Paid

  10. Click Next.
  11. Enter a Base Price of 25.
  12. Change the Limit under Units & Quotas to 1000.
  13. Under Assign Resources, click Select All and then the right arrow to assign the selected Resources.
  14. This is a very basic plan and should look similar to the image below when complete. There are many other options available when building pricing plans, this is the minimum required for this example.
  15. Click Next.
  16. Leave the defaults on all subsequent panels by clicking Next until the Save & Activate button turns green.
  17. Click Save & Activate.
  18. Select Major Release Type, click Save & Activate.

The product is now activated but has not yet been published to a Marketplace.

Publish API product to a marketplace

  1. In the Product Foundry, locate the Product which was created in the previous step.
  2. Click the Marketplace icon to publish the Product.
  3. Under Product Visibility, select the Marketplace where Stripe Billing was enabled in a previous step.
  4. Leave all other options as default.
  5. Click Save & Publish.
  6. In the subsequent dialog, click the Select All checkbox.
  7. Click Publish.
  8. Click Return to product.

The product has now been published to a Marketplace which has Stripe Billing enabled. The next step is to connect to the Marketplace as a Consumer and get access to the API Product.

Gain access to a monetized API

In this section, we will navigate to the Marketplace where Stripe billing has been configured. As an API Consumer we will select a pricing plan and navigate through the steps to complete payment and gain access to the API.

  1. Navigate to the Marketplace URL noted in a previous section of this document.
  2. Log on to the Marketplace as a member of a Consumer Organization which was created in the same previous section.
  3. Locate the API Product you want to gain access to and click on its tile. If following the steps in this example it will be the “Monetized Product”.
  4. Select Plans and click Subscribe.
  5. In the Subscription Request panel, accept all defaults and click the Terms of Use checkbox.
  6. Click Continue.
  7. In the Subscription Summary panel, click Checkout.
  8. Since the Subscription approval process for this Product is set to Automatic, the subscription is approved.
  9. Click View Subscription.
  10. Expand the Invoices section.
  11. Click on the Invoice #.
  12. You will be redirected to the Stripe payment portal. If using a Stripe Developer account, select the US Bank Account option and Test Institution.
  13. If prompted, grant access to the Test Institution, select the High Balance account and click Connect Account.
  14. Click Pay.
  15. Once payment has been processed you may close the Stripe Invoice tab.
  16. Close the Subscription Details panel in the Marketplace.
  17. Click on the Subscription name in the Product Subscriptions panel.
  18. Expand the Invoices section. The invoice should now show as paid.

 

Now that the invoice has been paid you can navigate to the Resources tab for the API Product and click the Request Access (key icon) link next to the APIs you have subscribed to.

Note: It is possible to have APIs in a single product covered by different plans. If this is the case, then only APIs to which you have a valid (and paid if required) will be accessible.

 

 

If the plan has a recurring billing cycle, the invoice must be paid (either manually or automatically) for each new cycle, or access will be denied to the API(s) in the plan.

Discover 9 steps to implementing the API marketplace of the future