Expenses (expense)

Expenses (expense)

Result: list of elements

UI Equivalent: go to BillingExpenses in the left menu of the platform.

Returns a list of expenses.

Access level: admin, user

ParameterTypeRequiredValue
idPositive integerYesUnique identifier of the expense.
locale_nameStringYesExpense name.
accountStringYesClient from whose account the funds were debited.
realdateDate and timeYesDebit date. Format: YYYY-MM-DD.
cdateDate and timeNoService provision date (start of period). Format: YYYY-MM-DD.
amountStringYesDebit amount. Monetary value with a period separator. For example, 15.00 USD
notpaydStringNoUnpaid portion of the expense. For example, 43.00 USD
discountamountStringNoDiscount amount provided upon debit. For example, 75.00 USD
paymentsStringYesPayment numbers used to pay the expense.
discountStringNoProvided discount code. Possible values:
  • personal — personal;
  • promo — promotional discount;
  • globaldiscount — global discount.
taxamountStringNoTax amount.

Edit expense

Function: expense.edit

Result: successful operation execution or error message

UI Equivalent: go to BillingExpenses → select expense → click Edit.

Used for viewing, modifying, and creating an expense.

Access level: admin

ParameterTypeRequiredValue
elidPositive integerYesUnique identifier of the expense
subaccountPositive integerYesProvider (subaccount) to which the expense belongs.
itemPositive integerNoservice ID for which the expense will be created. For example, 2882.
operationStringNoOperation on the basis of which the expense will be created.
amountStringYesExpense amount. Monetary value in period-separated format. For example, 15.00 USD
taxrateStringNo

Tax rate in percent. Tax amount is calculated automatically:

AMOUNT - (AMOUNT / ((100 + RATE) / 100)).

postpaidFlagNoIf the option is set (on), if there are insufficient funds in the account, the expense will be created on credit.
nameStringNoExpense name. If not specified, it is generated automatically based on the operation.
realdateDate and timeNoActual debit date. Format: YYYY-MM-DD.
cdateDate and timeNoService provision date (start of period). Format: YYYY-MM-DD.
sokStringYesThe value ok confirms operation execution. Without this parameter, changes will not be applied.

Delete expense

Function: expense.delete

Result: successful operation execution or error message

UI Equivalent: go to BillingExpenses → select expense → click Delete.

Deletes the specified expense. Supports deletion of multiple expenses separated by commas. Confirmation via the sok parameter is required.

Access level: admin

ParameterTypeRequiredValue
elidString (list)YesOne or more expense ids separated by commas. For example, 123,456.
sokStringYesThe value ok confirms operation execution. Without this parameter, changes will not be applied.

Set client filter

Function: expense.setfilter

Result: successful operation execution or error message

UI Equivalent: go to BillingExpenses →→ click Filter by client.

Sets a client filter for the list of expenses. Conditions are saved and applied each time the list is displayed until changed or reset.

Access level: admin

ParameterTypeRequiredValue
accountStringNoClient from whose account the funds were debited. Wildcard * is supported. For example, client = *smith will filter expenses of all clients whose names contain smith: Blacksmith, Goldsmith, etc.
sokStringNoThe value ok confirms saving the filter.

Log in to the panel with user privileges

Function: expense.su

Result: successful operation execution or error message

UI Equivalent: go to BillingExpenses → select expense → click Log in button.

Authorizes the administrator in the control panel with the privileges of the client to whom the expense is assigned.

Access level: admin

ParameterTypeRequiredValue
elidPositive integerYesExpense id to log in with.

Set filter

Function: expense.filter

Result: successful operation execution or error message

UI Equivalent: go to BillingExpensesFilter menu in the expenses list.

Sets an advanced filter. You can specify selection conditions for this list. They will be applied when it is displayed until the filter is changed or cleared.

Access level: admin

ParameterTypeRequiredValue
idPositive integerNoUnique identifier of the expense for filtering.
locale_nameStringNoExpense name. Wildcard * is supported. For example, client = *smith will filter expenses of all clients whose names contain smith: Blacksmith, Goldsmith, etc.
accountStringNoClient from whose account the funds were debited.
realdate.fromDate and timeNoStart of the debit date range. Format: YYYY-MM-DD.
realdate.toDate and timeNoEnd of the debit date range. Format: YYYY-MM-DD.
amountStringNoDebit amount. Comparison operators are supported. For example, id = >100, client = smith will filter all clients named Smith, except the first 100.
notpaydStringNoUnpaid portion of the expense.
paymentsStringNoPayment numbers used to pay the expense.
taxamountStringNoTax amount. For example, 220.00 USD
resetFlagNoThe value on resets all set filters.

Payments

Allocate expense amount to payments

Function: expense.payment

Result: list of elements

UI Equivalent: go to BillingExpenses → select expense → click Payments.

Returns a list of expense-to-payment bindings indicating the amount debited from each payment.

Access level: admin, user

ParameterTypeRequiredValue
elidPositive integerYesExpense id for which to show the allocation.

Create or edit payments

Function: expense.payment.edit

Result: successful operation execution or error message

UI Equivalent: go to BillingExpenses → select expense → Payments button → click Add.

Allows viewing, modifying, or binding a portion of the expense amount to a specific payment.

Access level: admin

ParameterTypeRequiredValue
plidPositive integerYesUnique identifier of the expense to which the payment should be bound (the id element from the expense function).
elidPositive integerNoUnique identifier of the binding (the payment element from the expense.payment function). Mandatory for modifying an existing record.
paymentPositive integerYesPayment code from which a portion of the expense amount will be debited.
amountStringYesAmount to be debited from the payment. Monetary value in period-separated format. For example, 15.00 USD
sokStringYesThe value ok confirms operation execution. Without this parameter, changes will not be applied.

Delete binding

Function: expense.payment.delete

Result: successful operation execution or error message

UI Equivalent: go to BillingPayments → select payment → click Delete.

Deletes the binding of an expense portion to a payment. Supports deletion of multiple records separated by commas. Confirmation via the sok parameter is required.

Access level: admin

ParameterTypeRequiredValue
elidString (list)YesOne or more binding identifiers (payment) separated by commas. For example, 100,200.
sokStringYesThe value ok confirms operation execution. Without this parameter, changes will not be applied.