What Is a Credit Balance?
A client's credit balance is a positive monetary amount stored against their account that is automatically applied to future invoices. Credits reduce the amount a client needs to pay — or eliminate the need for payment entirely if the credit covers the full invoice amount.
Credit transactions are stored in the client_credits table, each linked to the client record, an optional source invoice, and an optional applied-to invoice.
How Credits Accumulate
Credits can be added to a client's account in three ways:
1. Staff Manual Addition
The most common method. A staff member adds a credit directly from the client record.
Steps:
- Go to Admin → Clients → [Client] → Credits tab.
- Click Add Credit.
- Enter the amount, the currency (must match the client's billing currency), and a description.
- Click Save.
Common reasons to add credit manually:
- Goodwill gesture for a service disruption
- Migration discount ("first month free")
- Overpayment correction
- Promotional offer
2. Refund as Credit
When staff process a refund for an overpayment or a cancelled service, they can choose to credit the amount back to the client's account instead of issuing a gateway refund.
During the refund flow: Admin → Invoice → Refund → select "Add to client credit balance".
This avoids gateway refund fees and keeps the funds available for the client's next renewal.
3. Overpayment
If a bank transfer arrives for more than the invoice amount, staff can apply the excess as credit after marking the invoice as paid. Enter the payment amount and select "Remainder to credit balance" in the payment recording form.
How Credits Are Applied to Invoices
Credit is applied automatically when a new invoice is generated for a client who has a positive balance.
The process:
- Invoice is created (e.g. a renewal invoice).
- Commerce checks the client's credit balance.
- Available credit is applied as a line item: "Account Credit" (negative amount).
- If the credit covers the full invoice amount, the invoice is marked Paid immediately — no payment action is required from the client.
- If the credit covers part of the invoice, the remaining balance is due via payment gateway.
[!IMPORTANT] Credit is applied in the client's billing currency. If the client has credit in USD but an invoice is in EUR, the credit is not applied. Ensure the credit currency matches the invoice currency when adding manual credits.
Viewing the Credit History
Go to Admin → Clients → [Client] → Credits tab.
The credit history table shows:
| Column | Description |
|---|---|
| Date | Timestamp of the transaction |
| Type | Addition or deduction |
| Amount | Amount in the client's billing currency |
| Description | Staff-entered reason or auto-generated reason |
| Source invoice | The invoice that generated this credit (if applicable) |
| Applied to invoice | The invoice this credit offset (if applicable) |
Client-Visible Credit Balance
Clients can see their current credit balance on the Client → Dashboard page as a summary widget ("Account Credit: $X.XX"). They cannot see the full transaction history — only the current balance total.
Manually Applying Credit to an Existing Invoice
Credit is applied automatically on invoice generation. For existing unpaid invoices, staff can manually apply available credit:
- Go to Admin → Invoices → [Invoice].
- Click Apply Credit.
- Enter the amount to apply (up to the lesser of the invoice balance or the client's available credit).
- Confirm.
The invoice balance is reduced by the applied amount. If it reaches zero, the invoice is marked Paid.
Expiring or Removing Credit
Commerce does not expire credits automatically. To remove a credit manually (e.g. if it was added in error):
- Go to Admin → Clients → [Client] → Credits.
- Click Deduct Credit.
- Enter the amount to remove and a description (e.g. "Correction — credit added in error").
- Confirm.
[!TIP] Always enter a description when deducting credit. The credit history is auditable and descriptions help future staff (and audits) understand what happened.