On this page
- Step 1: Install the required Monetization and Commerce modules
- Step 2: Set up a store
- Step 3: Add products to the store
- Step 4: Add an Add Credit button to your prepaid balance page
- Step 5: Configure permissions to view and purchase Add Credit products
- Configure wait settings for Add Credit top-ups
- Step 7: Configure notifications for adding credit
- Step 8: Test the shopping experience
- Step 9: Manage orders
Enable the Apigee Monetization Add Credit Module
Enable prepaid app developers to add credit to their balance by installing the Apigee Monetization Add Credit module, setting up a Drupal Commerce store, and defining products to increment the credit balance. The steps are outlined in the following sections:
- Step 1: Install the required Monetization and Commerce modules
- Step 2: Set up a store
- Step 3: Add products to the store
- Step 4: Add an Add Credit button to your prepaid balance page
- Step 5: Configure permissions to view and purchase Add Credit products
- Step 6: Configure wait settings for Add Credit top-ups
- Step 7: Configure notifications for adding credit
- Step 8: Test the shopping experience
- Step 9: Manage orders
Step 1: Install the required Monetization and Commerce modules
Ensure that you have installed the Apigee Monetization module, as described in Install the Apigee Monetization module.
In addition, you will need to install the Drupal Commerce module to provide the dependencies needed for the Apigee Monetization Add Credit module. The Apigee Monetization Add Credit module is included in the Apigee Monetization module, but will need to be installed, as described below.
- Install the Drupal Commerce module using Composer. Note: Composer must be executed at the root of your Drupal installation. For example:
cd path/to/drupal/root composer require drupal/commerce
- Select Extend in the Drupal administration menu.
- Scroll to the Apigee section of the page.
- Select Apigee Monetization Add Credit.
- Click Install.
- When prompted to install Drupal Commerce modules required as dependencies, click Continue.
Step 2: Set up a store
To enable prepaid developers to add credit to their balance and manage any orders, you need to set up a store. See also Setting up your store in the Drupal Commerce documentation.
To set up a store:
- If necessary, add a new currency, as described in Adding a currency in the Drupal Commerce documentation.
- From the Drupal administration menu, select Reports > Requirements report.
- Click Setup store.
- Configure the store details, including name, email address for notifications, default currency, and mailing address.
- Click Submit.
Step 3: Add products to the store
Add products to the store to enable prepaid developers to add credit to their balance using a fixed or custom value. See also Products in the Drupal Commerce documentation.
To add and configure products automatically:
- From the Drupal administration menu, select Reports > Requirements report.
- Click Create product type.

- At the prompt, click Submit to create the product type and variation.
- Click Create products.

- Select the supported currencies for your products.
- Click Submit.
Alternatively, you can add and configure products manually:
- Select Commerce > Configuration > Products > Product types.
- Click + Add product type.
- Configure the product type details.
- Ensure that you select Enable Apigee Monetization Add Credit for this product type.
- Configure any additional properties for this product type.
- The first three properties are enabled by default upon installation of the Commerce module, but may be unchecked if you wish to limit the number of product variations for a product type, remove product variation details from the display of your product, or require manual publishing of your product in your store.
- You can also choose to Skip cart and go directly to checkout for this product type if you wish to eliminate the Cart message from your portal’s Add Credit page, and proceed directly to checkout.
- Click Save.
- Customize the Add Credit product type:
- Select Commerce > Configuration > Products > Product variation types.
- In the Operations column for the Add Credit product type, select Manage display.
- Drag the Product field from the Disabled section to the first field position.
- Drag List price to the Disabled section.
- For the Product and Price fields, select Hidden in the Label column.
- Click Save.
- Select Commerce > Configuration > Products > Product types.
- For the Add Credit product type, select Manage display in the Operations column.
- For the Variations field, select Hidden in the Label column.
- Click Save.
- Add a product using the Add Credit product type:
- Select Commerce > Products.
- Click + Add product.
- Click on the product type of the product you wish to create, i.e. your Add Credit product type.
- Configure the title and description of the product. Ensure that This is an Apigee add credit product is selected.
- Click Save and add variations.
- Click + Add variation.
- Enter a title, SKU and price details, and select Published.
- Click Save.
- Customize the “Add to Cart” checkout page display for Add Credit products:
- Select Commerce > Configuration > Orders > Order Item types.
- Select Manage form display from the Operations column for your Order Item type. Note: Your Order Item type may be named “Default,” depending upon your configuration.
- Click the Add to Cart tab.
- Drag and drop the Unit Price or other data fields from Disabled to the displayed field list, as desired.
- Use the field widgets to display the appropriate values for each field, as desired. For example, you can use the Unit Price field widget to select the price or unit price value for display.
- Click Save.
Step 4: Add an Add Credit button to your prepaid balance page
You can make it easy for developers to add credit to their prepaid balances using the Add Credit products from your store. If you created Add Credit products automatically using the "Requirements report" page in Step 3, the "Add Credit" button is automatically added to your prepaid balance page. You can skip to Step 5: Configure permissions below.
If you manually created Add Credit products, follow these steps to add an Add Credit button to your portal’s prepaid balance page:
- Select Configuration > Apigee Edge > Monetization > Prepaid Balance.
- Select the Add credit tab.
- Create or edit an Add Credit product to enable adding credit to prepaid balances. One product must be added for each currency offered. If more than one currency is enabled for prepaid balances, make sure to add or configure a separate Add Credit product for each currency offered.
- For each currency displayed, select a product from the autocomplete list.
- To edit an Add Credit product that you previously added under the Commerce configuration, click the edit operation and make changes as needed.
- If no Add Credit products are available, see Step 3: Add products to the store.
- Click Save Configuration.
- The Add Credit button will display on your prepaid balance page:

Step 5: Configure permissions to view and purchase Add Credit products
To configure permissions for developers to view and purchase Add Credit products:
- Select People > Permissions.
- Scroll to the Apigee Monetization Add Credit section of the page.
- Ensure that Add credit to any developer prepaid balance is checked for the Authenticated User role.
- Click Save Permissions.
To configure permissions that enable a developer portal admin or Team lead to view prepaid balances and purchase Add Credit products for another developer:
- Log in to the developer portal as an admin or Team lead.
- Select People > Permissions.
- Scroll to the Apigee Monetization section of the page. Ensure that the View any prepaid balance permission is checked for the Administrator role.
- Scroll to the Apigee Monetization Add Credit section of the page. Ensure that the Add credit to any developer prepaid balance permission is checked for the Administrator role.
- Click Save Permissions.
- Navigate to user/
uid/monetization/billing, whereuidis the user ID of the developer whose prepaid balance is to be viewed or adjusted using Add Credit. - View the developer's prepaid balance or add credit for the developer as needed.
Configure wait settings for Add Credit top-ups
In order to synchronize the availability of the Add Credit top-up option for developers in the portal with the Apigee Monetization credit balance API, the developer portal will disable the Add credit option for a specified period of time after each developer top-up.
If needed, the Top-up balance wait time can be configured by the portal administrator:
- Sign in to the developer portal with admin credentials.
- Go to Configuration > Apigee Monetization> General> Settings.
- Edit the number of seconds in the Top-up balance wait field.
- Click Save configuration.
Note: If the wait time between top-ups is adjusted, make sure that any changes comply with any Monetization availability guarantees for your account to prevent errors.
Step 7: Configure notifications for adding credit
Send a notification when a developer adds credit to their account using the Add Credit product in your portal. You can configure whether to be notified at all times or only when an error is encountered.
To configure notifications for adding credit:
- Select Configuration > Apigee Edge > Monetization > Prepaid Balance.
- Select the Add credit tab
- Scroll down to Notifications section.
- Select one of the following options:
- Always: always send a notification when an app developer adds credit. This is the default.
- Only on error: Send a notification when an app developer encounters an error when adding credit.
- Enter the email address of an individual or team to receive the notifications.
- Click Save configuration.
Step 8: Test the shopping experience
To test the shopping experience:
- Click the Add credit button on your portal’s prepaid balance page. The Add Credit page displays.
- Click Add to cart.
- Click the link to your cart in the confirmation message.
- Edit the item, as required, and click Update cart.
- Edit items in the cart:
- Click Remove to remove an item.
- Edit the item quantity and click Update cart.
- Click Checkout.
- Update the order information and add billing information, as required.
- Click Continue to review.
- Review the order.
- Click Pay and complete purchase.
Step 9: Manage orders
To view and manage Add Credit orders:
- Click My account.
- Click Orders.
- Review your orders.
- To view details of an order, click the order number.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion