Stripe Advanced: Usage-Based Billing & Prepaid Wallets Step-by-Step Guide
This guide details how to configure a prepaid credit wallet system, synchronize metered pricing catalog data, fund a test wallet, and verify automated recharges when usage events trigger the replenishment threshold.
Phase 1: Product Catalog Setup in Stripe
Step 1: Create the "Credits" Product
- Open your Stripe Dashboard (Test Mode) and navigate to Product Catalog > Add Product.
- Name the product Credits.
Step 2: Configure Price 1 (Metered Consumption Price)
- Under Pricing Options, select More pricing options and click Usage-Based Pricing.
- Set the unit price to $0.01 (or your desired price per credit).
- Under the Meter selection, click Create new meter:
- Meter Name:
credit
- Event Name:
credit
- Aggregation: Set to Sum (this aggregates total credits used).
- Click Create Meter.
Step 3: Configure Price 2 (One-off Replenishment Price)
- Scroll down and click Add another price on the same product page.
- Set this price to a flat $1.00.
- Choose One-off (do not make this a recurring subscription price).
- Enter Credits for Usage in the price description.
- Save the product to push the product and its two prices into ValStorm.
Phase 2: Configuration Mapping in ValStorm
Step 4: Flag the One-off Price as a "Credit Grant"
- Switch to the Billing Workspace in ValStorm.
- Go to Prices, locate the one-off Credits for Usage price, and click into it.
- Edit the record, check the box for Credit Grant, and click Save. This tells the ledger that purchasing this price adds cash value to a customer's wallet.
Step 5: Configure the Usage Meter Mapping
- In ValStorm, navigate to Usage Meters.
- Locate the synchronized
credit meter and edit it.
- Map the meter to the Credits product and select the monthly metered usage price.
- Click Save to ensure all incoming events know how much to charge.
Phase 3: Customer Setup & Subscription
Step 6: Setup Customer Account
- Complete the sales cycle (Lead ──> Opportunity ──> Account) to ensure your customer (e.g., Baxter Inc.) is synced and carries a valid Stripe Customer ID.
Step 7: Subscribe Customer to Metered Pricing
- In your Stripe Dashboard, go to Customers, click Baxter Inc., and select Create Subscription.
- Add the metered Credits product price (the $0.01 usage-based price).
- Scroll down, select Add Test Payment Method, and enter test credentials.
- Select Automatically charge payment method on file and click Create Subscription.
Phase 4: Wallet Setup & Initial Funding
Step 8: Create the Billing Wallet in ValStorm
- On the Baxter Inc. Account page, click through to the Billing Wallet related list and click Create.
- Configure the wallet:
- Name:
wallet
- Usage Meter: Select your mapped
credit meter.
- Replenish Price ID: Select Credits for Usage.
- Replenishment Amount: Set to 200 (this is the top-up amount).
- Replenished Threshold: Set to 50 (this triggers the top-up when balance falls below $50).
- Click Save (the wallet's remaining balance will start at $0.00).
Step 9: Fund the Wallet (Initial Deposit)
- Go to your Stripe Dashboard, navigate to the Baxter Inc. profile, and click Create Invoice.
- Add the flat Credits for Usage price and set the quantity to 200 (total invoice of $200.00).
- Scroll to the bottom and click Charge Customer.
- Return to ValStorm, open Baxter's Billing Wallet, and verify that:
- The Remaining Balance has jumped to $200.00.
- A ledger record is created in the Credit Grants related list.
Step 10: Turn on Auto-Replenishment
- On Baxter's Billing Wallet page in ValStorm, click Edit.
- Check the box for Auto Replenishment and click Save.
Phase 5: Simulating Usage & Auto-Recharge Triggering
Step 11: Record First Usage Event
- In ValStorm, navigate to the Usage Events tab and click Create.
- Configure the event:
- Account: Baxter Inc.
- Billing Wallet: Select the Baxter wallet.
- Usage Meter: credit
- Quantity:
1,000 (representing 1,000 credits used).
- Click Save.
- Open the Billing Wallet and verify the balance has dropped to $190.00 (1,000 credits x $0.01 = $10.00 deduction).
Step 12: Record Second Event to Test Proximity
- Create another Usage Event for Baxter's wallet with a quantity of 6,000 credits.
- Click Save.
- Verify the wallet balance has dropped to $130.00 ($60.00 deduction).
Step 13: Trigger Auto-Replenishment (Cross the Threshold)
- Create a third Usage Event for Baxter's wallet with a quantity of 9,000 credits.
- Click Save.
- The $90.00 cost drops the balance to $40.00, which falls below your $50.00 replenishment threshold.
- Open your Stripe Dashboard, go to Invoices, and verify that a new invoice for $200.00 has automatically been generated, charged, and paid for Baxter Inc.
- In ValStorm, verify that Baxter's Billing Wallet balance has jumped back up to $240.00 ($40.00 remaining balance + $200.00 top-up).