Skip to main content
Limited Release
Billing credits are non-monetary grants that customers purchase or receive upfront to pay for their usage-based subscriptions. To offer billing credits, you create a digital wallet for each customer. Billing credits have two types:
  • Prepaid credits: Customers purchase with real money for advance payment.
  • Granted credits: Free promotional credits you provide to customers.
Billing credits connect the following:
  • Customers who purchase or receive credits to pay for usage-based charges.
  • Digital wallets that hold and manage credits for each customer.
When PayPal generates invoices, billing credits are consumed first before charging payment methods.

Prerequisite

Ensure you have registered customers with valid external_id values and payment methods.

1. Understand wallet configuration

Before creating a wallet, understand the available configuration options. Basic wallet configuration
  • Rate amount: Specify the cost per credit in real money (example: rate amount of $1.00 means 10 credits cost $10.00).
  • Paid credits: Specify the credits customers purchase with real money.
  • Granted credits: Specify the free promotional credits you provide to customers.
Applicability scope
  • Fee types: Determine which types of charges the credits can pay for. You can specify subscription fees, usage-based charges, minimum commitments, or any combination of these.
    If you do not specify the fee types scope, wallet credits apply to all three charge types by default.
  • Expiration date: Optionally set when the credits expire if you want to create time-limited promotional offers or enforce credit usage policies.
Automatic top-up configuration Recurring transaction rules: Set up automated rules that define when and how credits are added to the wallet. When you include the recurring_transaction_rules[] array in your wallet configuration, the method and trigger fields are mandatory for each rule. Additional configuration

2. Create wallet and add credits

You can create a basic wallet, or include automatic top-up rules to automatically replenish credits. Use a valid access token and make a POST call to the /v1/commerce/billing/wallets endpoint. Include the following parameters: For information on all parameters, see API reference.

Basic wallet example

The following example shows the fundamental structure of a basic wallet creation request where you manually add credits when required.

Automatic top-up variations

Each automatic top-up strategy requires different properties within the recurring_transaction_rules[] array. The following examples show how to configure the various strategies.

Fixed amount with schedule trigger

Use this strategy when you want to add predictable credit amounts at regular intervals. This approach adds the same number of credits weekly/monthly regardless of usage patterns, providing consistent credit additions for predictable billing scenarios.

Fixed amount with threshold trigger

Use this strategy to prevent service interruption by adding credits when your customer’s balance is less than a set amount. Threshold triggers watch actual usage patterns and adds credits only when required.

Target balance with schedule trigger

Use this strategy to maintain a minimum balance through regular checks. This approach dynamically calculates the required credits to reach your specified balance during each scheduled interval.

Target balance with threshold trigger

Use this strategy to ensure customers always have sufficient credits balance while minimizing unused credit accumulation. This approach combines the efficiency of threshold-based triggering with the precision of target balance calculations - adding credits only when the balance is less than the threshold and calculating the exact amount needed to reach your target balance.
A successful call returns a 201 Created response. The response includes the following parameter: For information on all parameters, see API reference.

3. Understand wallet lifecycle and manage wallets

Wallets progress through distinct states throughout their lifecycle. These states determine credit availability and available management actions. To monitor a wallet’s current state, make a GET call to the /v1/commerce/billing/wallets/ endpoint and review the status parameter. The wallet’s lifecycle state determines the management actions you can perform to ensure proper wallet handling.