Skip to main content
A wallet is a prepaid balance of money, in one currency, belonging to one customer. The customer (or you, on their behalf) funds it, every movement is recorded on the wallet ledger, and the wallet is offered as a payment method on invoices in the same currency. Use wallets when a customer wants to deposit funds up front and settle invoices from the balance, or when you sell prepaid packages that should be spendable on only part of your catalogue.
Wallets and credit grants are separate systems. A wallet holds money the customer paid in; a credit grant is credit you allocate, consumed while invoices are priced. The overview compares them.
A customer can hold several wallets — one per currency, or several with different product_ids. Wallet ids are prefixed wlt_, wallet grant ids wgr_, customer ids cust_. See How Alguna Works.

Create a wallet

Via API

name, customer_id, and currency are required. product_ids is optional and, when set, restricts which invoice lines the wallet may pay for. See Create a wallet.
Response:
A wallet has no status field. active is a boolean; an inactive wallet cannot pay invoices. A wallet is always created empty — add funds afterwards.

From the dashboard

  1. Open Customers → [Customer] → Profile.
  2. In the Wallets card, add a wallet.
  3. Name it, choose the currency, and optionally restrict it to products.
  4. Save.

Add and remove funds

POST /wallets/{id}/credit and POST /wallets/{id}/debit move money and write a ledger entry. amount, transaction_type, and reference_id are required; description is optional. The response is the updated wallet with its new current_balance. See Credit a wallet and Debit a wallet.
A debit larger than the balance is rejected with 422.

Transaction types


Wallet grants

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

Grant status

Transitions are pending → approved, pending → voided, pending → expired, and approved → expired; voided and expired are terminal. A grant funded by an invoice (invoice_id) is approved when that invoice is paid; a top-up recorded without a payment is approved immediately.

List grants

See List grants for a wallet and List wallet grants.

Check the balance

Response: { "balance": "750.00" }. The wallet itself also carries current_balance, so GET /wallets/{id} answers the same question alongside the rest of the wallet. GET /wallets?customer_id=…&active=true lists a customer’s wallets.

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 (or product_ids is empty).
  • 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. Anything left stays payable by another method. See Invoicing Customers.

Update or deactivate a wallet

PATCH /wallets/{id} accepts name, currency, active, and product_ids. Deactivating a wallet takes it out of the payment methods offered on an invoice without touching its balance or history. See Update a wallet.

Delete a wallet

DELETE /wallets/{id} returns 204. A wallet with a non-zero balance cannot be deleted: debit it to zero first, or deactivate it instead. See Delete a wallet.

Multi-currency

A wallet holds one currency, so a customer who is invoiced in more than one needs a wallet per currency. Invoices are paid from the wallet matching their currency. See Multi-Currency.

Best practices

One wallet per currency

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

Always send a reference

Point reference_id at the payment, invoice, or adjustment that caused the movement so the ledger reconciles.

Scope with products

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

Deactivate before deleting

active: false stops new charges while keeping the balance and history.

Next steps

Credits Overview

Wallets versus credit grants.

Credit Notes

Refund a credit note into a wallet.

Wallets API

Full request and response reference.