Change an account's balance
These methods change the balance of an account and record the change as a payment in its Payment History. They are the API side of the balance actions on the account in the panel: E-Payment (Add Funds), Manual Credit and Manual Charge (Debit).
| Method | Balance | Recorded as | Use it for |
|---|---|---|---|
accountAddFunds |
Goes up by amount |
Payment with a positive amount, method Add Funds | Money you received from the account holder |
accountCredit |
Goes up by amount |
Payment with a positive amount, method Credit | A refund or a goodwill credit, no money received |
accountDebit |
Goes down by amount |
Payment with a negative amount, method Debit | A manual charge |
accountAddFunds and accountCredit change the balance in exactly the same way. They differ only in how the payment is labelled in the history and the reports.
Common parameters
Section titled “Common parameters”All three methods take the same parameters.
| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | yes | ID of the account |
amount |
double | yes | Amount, as a positive number. accountDebit subtracts it, the other methods add it |
currency |
string | yes | ISO 4217 code of the currency of amount, for example USD |
payment_notes |
string | no | Notes stored with the payment. This is the only place to explain a manual change later |
payment_time |
string | no | Time of the payment, UTC, in the format %H:%M:%S.000 GMT %a %b %d %Y, for example 09:57:29.000 GMT Wed Nov 18 2009. Default: now |
When currency is not the account’s currency, amount is converted with the exchange rates of the account’s customer, and the payment is recorded in the account’s currency. The currency must have an exchange rate there, otherwise the call fails.
accountAddFunds
Section titled “accountAddFunds”Adds a received payment to the account’s balance.
Parameters
Section titled “Parameters”The common parameters.
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("accountAddFunds", { "i_account": 3092, "amount": 25.0, "currency": "USD", "payment_notes": "Bank transfer 2026-01-15, ref. 55120",}){"result": "OK"}accountCredit
Section titled “accountCredit”Credits the account’s balance without a received payment, for example to refund a failed call.
Parameters
Section titled “Parameters”The common parameters.
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("accountCredit", { "i_account": 3092, "amount": 1.5, "currency": "USD", "payment_notes": "Refund for ticket 4471",}){"result": "OK"}accountDebit
Section titled “accountDebit”Charges the account: the balance goes down by amount.
Parameters
Section titled “Parameters”The common parameters. Pass amount as a positive number.
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("accountDebit", { "i_account": 3092, "amount": 10.0, "currency": "USD", "payment_notes": "Setup fee",}){"result": "OK"}Related
Section titled “Related”- Accounts: the balance actions of an account
- Balance and credit limit
- Payments: the payment history
- Get payment details
- Change a customer’s balance
- Get account information: the current
balance