Prerequisites
- A credit type defined in Product Catalog → Credits.
- A prepaid plan with:
- Currency set to your credit type.
- Top-up model (e.g., Flat rate) and currency value configured.
- Min/Max rules for purchase amounts, if desired.
- Credit consumption mappings for your metered features.
Option 1: Checkout widget (recommended)
Embed the checkout widget in your app to collect payment and amount, then let Stigg create the grant automatically.- Place the widget on your Billing / Credits page.
- Configure allowed credit types, default amounts, and show the plan’s min/max rules to guide purchases.
- On successful payment:
- A paid grant is created with amount, cost basis, priority, and dates (per plan defaults).
- The customer’s balance updates immediately; the ledger records a Grant entry.
Option 2: API-driven top-ups
If you collect payment through your own flow or another PSP, create the grant from your server after a successful charge.- Charge the customer.
- Call the credits API to create a paid grant with currency/type, amount, cost basis, priority, and optional effective/expiry.
- Confirm the new grant in Customers → [Customer] → Credits → Grants; verify the Ledger increment.
Automatic top-ups (low-balance protection)
Prevent interruptions by configuring an automatic rule:- In Customers → [Customer] → Credits, click Automatic top-up.
- Set Top up when balance below (threshold) and the Top-up amount.
- Define Per unit cost basis, Spend limit period, and Spend limit amount.
- (Optional) Set an Expiry date and Auto top-up expiry.
- Save. The rule will trigger a purchase and grant when the threshold is crossed within the spend cap.
Monitoring and receipts
- Credits utilization shows the live balance and recent changes.
- Grants lists each top-up with remaining/original amounts and dates.
- Ledger records the corresponding Grant entries with deltas and end balances.
Troubleshooting
- Top-up didn’t appear: Check payment status, then look for a new Grant in Grants and a Grant entry in Ledger.
- Rule didn’t fire: Verify threshold, top-up amount, and spend limit; confirm the time window and review the Activity log.