Перейти к содержимому

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.

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.

Adds a received payment to the account’s balance.

The common parameters.

Name Type Description
result string OK
request
call("accountAddFunds", {
"i_account": 3092,
"amount": 25.0,
"currency": "USD",
"payment_notes": "Bank transfer 2026-01-15, ref. 55120",
})
response
{"result": "OK"}

Credits the account’s balance without a received payment, for example to refund a failed call.

The common parameters.

Name Type Description
result string OK
request
call("accountCredit", {
"i_account": 3092,
"amount": 1.5,
"currency": "USD",
"payment_notes": "Refund for ticket 4471",
})
response
{"result": "OK"}

Charges the account: the balance goes down by amount.

The common parameters. Pass amount as a positive number.

Name Type Description
result string OK
request
call("accountDebit", {
"i_account": 3092,
"amount": 10.0,
"currency": "USD",
"payment_notes": "Setup fee",
})
response
{"result": "OK"}