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

Change a vendor's balance

Это содержимое пока не доступно на вашем языке.

These methods change the balance of a vendor and record the change as a payment in the Payments History of the root customer. They are the API side of the balance actions on the vendor in the panel: E-Payment (Add Funds), Manual Credit and Manual Charge (Debit).

The methods support trusted mode with i_customer, which is 1, the root customer.

Method Balance Recorded as Use it for
vendorAddFunds Goes up by amount Payment with a positive amount, method Add Funds Money you paid to the vendor, for example to prepay traffic
vendorCredit Goes up by amount Payment with a positive amount, method Credit A credit note from the vendor, no money paid
vendorDebit Goes down by amount Payment with a negative amount, method Debit A manual charge

vendorAddFunds and vendorCredit change the balance in exactly the same way. They differ only in how the payment is labelled in the history.

All three methods take the same parameters.

Name Type Required Description
i_vendor int yes ID of the vendor
amount double yes Amount, as a positive number. vendorDebit 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
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 vendor’s currency, amount is converted with the exchange rates of the root customer, and the payment is recorded in the vendor’s currency. The currency must have an exchange rate there, otherwise the call fails. System vendors cannot be paid.

Records a payment you made to the vendor and adds it to the vendor’s balance.

The common parameters.

Name Type Description
result string OK
request
call("vendorAddFunds", {
"i_vendor": 5,
"amount": 1000.0,
"currency": "USD",
"payment_notes": "Prepayment, wire 2026-01-15",
})
response
{"result": "OK"}

Credits the vendor’s balance without a payment.

The common parameters.

Name Type Description
result string OK
request
call("vendorCredit", {
"i_vendor": 5,
"amount": 40.0,
"currency": "USD",
"payment_notes": "Credit note CN-118, disputed calls",
})
response
{"result": "OK"}

Charges the vendor’s balance: it goes down by amount.

The common parameters. Pass amount as a positive number.

Name Type Description
result string OK
request
call("vendorDebit", {
"i_vendor": 5,
"amount": 15.0,
"currency": "USD",
"payment_notes": "Port fee",
})
response
{"result": "OK"}