Skip to main content
Wallets provide a prepaid balance system where customers can deposit funds and use them for future purchases. Wallets are ideal for customers who prefer prepaying or for businesses that want to offer prepaid packages.

Overview

A wallet is a prepaid balance that:
  • Holds funds in a single currency
  • Is credited and debited through the API, with every movement recorded on the wallet ledger
  • Can pay an invoice in the same currency
  • Can be restricted to a set of products
A wallet belongs to one customer, and a customer can hold several wallets. Wallet ids are prefixed wlt_ and customer ids cust_.
Wallets and credits are separate systems. A wallet holds money the customer has paid in; a credit grant is a balance you allocate. See Credit Grants.

Creating a Wallet

From the Dashboard

  1. Navigate to Customers → [Customer] → Profile
  2. In the Wallets card, add a wallet
  3. Give the wallet a name and select the currency
  4. Optionally restrict the wallet to specific products
  5. Save
A wallet is always created empty — there is no opening balance. Add funds afterwards, as described in Adding Funds.

Via API

name, customer_id and currency are required. product_ids is optional and, when set, restricts what the wallet may pay for.
Response:
A wallet has no status field. active is a boolean, and an inactive wallet cannot pay invoices.

Adding Funds

Credit a wallet with the amount, the transaction type it represents, and a reference id that points back to whatever caused the movement.
The response is the updated wallet, with its new current_balance.

Transaction Types

Debiting a Wallet

A debit larger than the wallet balance is rejected with 422.

Wallet Grants

A wallet grant records an amount added to a wallet, optionally tied to the payment or invoice that funded it and to an expiry date. Grants are how a prepaid package is represented on a wallet.
Response:

Grant Status

Listing Grants


Balance Management

Checking Balance

Response:
The wallet itself also carries current_balance, so GET /wallets/{id} answers the same question alongside the rest of the wallet.

Paying Invoices from a Wallet

A wallet is offered as a payment method on an invoice when all of the following hold:
  • The wallet is active
  • The wallet currency matches the invoice currency — Alguna does not convert between them
  • At least one invoice line is for a product the wallet is allowed to pay for
  • The wallet has not already been used on that invoice
  • The invoice is not itself the invoice that funds a wallet grant
The amount charged is capped at the lowest of the wallet balance, the amount still payable on the invoice, and the total of the eligible lines. If that does not cover the invoice, the rest stays payable by another method.

Multi-Currency Wallets

A wallet holds one currency, so a customer who pays in more than one needs a wallet per currency.

Currency Matching

Invoices are paid from the wallet matching the invoice currency. A USD invoice uses the USD wallet, not EUR.

Updating a Wallet

PATCH accepts name, currency, active and product_ids. Deactivating a wallet takes it out of the payment methods offered on an invoice without removing its balance or history.

Deleting a Wallet

A wallet with a non-zero balance cannot be deleted. Debit it down to zero first, or deactivate it instead of deleting it.

Best Practices

One wallet per currency

Wallets never convert. Create a wallet for each currency the customer is invoiced in.

Always send a reference

Every credit and debit carries a reference_id. Point it at the payment, invoice or adjustment that caused it so the ledger stays reconcilable.

Scope with products

Use product_ids when a prepaid balance should only pay for part of the catalog.

Deactivate before deleting

Setting active to false stops new charges while keeping the balance and history intact.

Next Steps

Credits Overview

Learn about the credit system.

Credit Grants

Create and manage credit grants.

Wallets API

Full request and response reference.