Automated Credit Top-Ups
Automated credit top-ups ensure your customer’s credit balance never drops below a certain point.
Credit top up plans allow you to automatically grant credits to customers when their available balance reaches a threshold amount. You can use these plans to ensure that customers are always pre-paying for their subscriptions. When the customer’s available balance reaches or becomes lower than the threshold amount, the customer will be granted the provided amount of credits at the defined price. As this is based on available balance, it will happen in near real time as you send usage and the customer’s accrued revenue increases.
Credit Top Up Plans can be created through the API or via the Octane Portal:
Automated credit top-ups in Octane offer a seamless way to ensure your customer's credit balance never falls below a certain threshold. However, there are situations where you may want more control over when credits are granted, particularly if you want to ensure that credits are only added when payment is successful. Octane introduces features to address these needs, including "Immediate Charging" and the management of payment retries.
The default behavior for automated credit top-up plans is to create a credit grant and it's corresponding invoice when the available balance drops below the threshold. The credit grant is immediately added to the ledger balance, and the invoice follows the regular billing flow. This means that the credits are immediately usable even if the corresponding invoice has not yet been paid. Essentially, Octane grants the credits as soon as the customer's available balance reaches the threshold, regardless of the payment status.
To gain more control over the credit-granting process, you can configure the automated top-up plan to charge_immediately. With charge_immediately = True, Octane will create the credit grant and corresponding invoice, but not add it to the ledger balance. Then Octane will immediately attempt to charge the customer. Octane will only add the credit grant to the ledger if the payment is successful. Otherwise the credit grant will remain ungranted and the invoice will be in failed payment status. Octane will re-attempt paying the invoice according to the failed payment retry billing settings.
Octane keeps you informed about credit top-ups through webhooks:
- credit_grant.new - credit grant was created
- credit_grant.granted - credit grant was granted to the customer's credit ledger
- invoice.new - invoice was created
- invoice.updated - invoice was updated (e.g., paid, failed payment)
- payment.new- payment was attempted