This is an Aviate-only feature.

Introduction

The Aviate plugin enables the management of Account wallets — credit pools that can be replenished manually or automatically based on configurable criteria. These credits are consumed by the system to pay for usage, and the wallet mechanism is primarily intended for prepaid scenarios. This helps mitigate financial risk typically associated with billing for usage in arrears.

Credits can be granted either for free or as part of a payment. In the latter case, a Kill Bill invoice is generated and a payment is processed using the Account’s default payment method. An optional expiration date can be assigned to credits. If the payment fails, the credit is recorded but remains inactive; it is only activated once the payment against the invoice is successfully completed.

Wallets can be configured with automatic replenishment rules (top-off), which support two modes: restoring the balance to a target level or adding a fixed amount when the balance falls below a threshold. These automatically granted credits can also include an expiration date. Additionally, wallets can be initialized with a predefined amount of free or paid credits.

The wallet is implemented as a ledger that tracks all transactions, including credit additions and consumptions. It exposes two values: the balance, representing currently available credits, and the live balance, which includes credits reserved for pending invoice generation.

Currently, each customer Account supports a single wallet, and the wallet must use the Account’s default currency.

Getting Started with Aviate Wallet

This section provides a step-by-step guide to start using the Aviate Wallet functionality.

Installing the Plugin

Install the Aviate plugin as described in the How to Install the Aviate Plugin guide.

Enabling Aviate Wallet

To enable wallet functionality in the Aviate plugin, start Kill Bill with the following system property:

com.killbill.billing.plugin.aviate.enableWalletApis=true

For details on setting configuration properties, refer to the Kill Bill Configuration Guide.

Using Wallet APIs

Once the plugin is installed and wallet support is enabled, you can interact with the Aviate Wallet using its API. The API allows you to create wallets, add credits, and configure top-off rules. Full API documentation is available at our API documentation.

Using the Wallet Functionality

  1. Create a wallet for a customer Account, optionally specifying initial credits (free or paid) and top-off rules.

  2. Record usage events. The system automatically adjusts the balance and enforces top-off rules as configured.

  3. Optionally, manually add credits or update the top-off configuration to better suit your use case.