Choose what you allow. Your choice applies on every tracken.ee address and you can change it any time with “Cookie settings” in the footer.

Remember your cookie choice, language and theme. Without them the site doesn't work the way you chose.

A cookie with your choice (6 months); language and theme in browser storage.


The services below learn that you visited this site, whether you came from their ad and whether you then created a Tracken account. That shows us which ads work, and these companies may show you Tracken ads later. They may link the data to your account with them. For Meta, Tracken ID's server reports the new account and also sends a hash of your e-mail address, your IP address and browser details.

ServiceCookiesKept for up to
Meta (Facebook, Instagram)_fbp, _fbc90 days

Tracken's own visit counter uses no cookies, stores no IP addresses and shares nothing with anyone. Privacy policy

Skip to content
Beta
BetaThe Tracken Accounts API is in beta: it may still change before v1, and every change is announced in the changelog.

BillingPlan

Response

What to bill whom, every period: lines with fixed amounts, formulas over object properties and meter consumption, or allocations of a cost. A plan keeps one id for life: a change that would alter periods already billed becomes a new revision (revision) from effective_from, and each run bills the revision in force.

Returned in responses. Its enums are open: tolerate values not listed here, which later versions may add.

Attributes

31
idstring (uuid)required

The plan's id, the same for every revision.

revisionintegerrequiredat least 1

This revision's number, from 1.

namestringrequired

Name.

cadencestringrequired

How often a run bills. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) monthly, quarterly, yearly

payment_term_daysintegerrequired

Days from the invoice date to the due date.

start_periodstring (date) · nullablerequired

First period billed (a first of month).

end_periodstring (date) · nullablerequired

Last period billed; null means open-ended.

recipient_modestringrequired

object_type (every in-use object of a type) or partners (a list of contacts). New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) object_type, partners

object_type_idstring (uuid) · nullablerequired

For object_type plans, the object type.

effective_fromstring (date) · nullablerequired

First period this revision bills; null for the first revision (from start_period).

recipient_partner_idsarray of string (uuid)required

For partners plans, the contacts billed; empty when omitted names contacts.

is_archivedbooleanrequired

Archived plans are not offered for runs.

created_atstring (date-time)required

When this revision was made.

updated_atstring (date-time)required

When this revision last changed.

linesarray of BillingPlanLinerequired

Lines, in invoice order.

22 attributes of each item
idstring (uuid)required

Line id.

sort_orderintegerrequired

0-based place on the invoice.

line_kindstringrequired

fixed, formula or allocation (see BillingPlanLineInput). New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) fixed, formula, allocation

labelstringrequired

Line text on the invoice.

tax_code_idstring (uuid) · nullablerequired

Tax code of the invoice line.

account_idstring (uuid) · nullablerequired

Revenue account of the invoice line.

item_idstring (uuid) · nullablerequired

The item the line bills.

price_sourcestringrequired

The price from this line (manual) or from the item (article). New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) manual, article

quantitystring · nullablerequireddecimal string

fixed lines: quantity per recipient.

unitstring · nullablerequired

Unit of measure.

unit_pricestring · nullablerequireddecimal string

fixed lines with a manual price: net price per unit.

qty_formulastring · nullablerequired

formula lines: the quantity formula.

price_formulastring · nullablerequired

formula lines: the price formula.

total_formulastring · nullablerequired

allocation lines: the formula of the amount to split.

weight_formulastring · nullablerequired

allocation lines: the weight formula.

is_activebooleanrequired

An inactive line bills nothing.

recipient_filterBillingPlanLineRecipientFilterrequired

Who the line bills.

2 attributes of recipient_filter
modestringrequired

Every recipient of the plan, or only the listed ones. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) all, selected

recipient_idsarray of string (uuid)required

The listed recipients when mode=selected; empty when mode=all.

missing_reading_policystringrequired

What a run does when a consumption the line uses has no reading. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) block, skip_line, estimate

negative_consumptionstringrequired

How a negative consumption is billed. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) zero, negative

condition_propertyBillingPlanLinePropertyCondition · nullablerequired

Bill only objects whose boolean property has this value.

2 attributes of condition_property
property_keystringrequired

A boolean property of the plan's object type.

equalsbooleanrequired

The value that bills the line.

condition_variableBillingPlanLineVariableCondition · nullablerequired

Bill only in periods where the plan's boolean variable has this value.

2 attributes of condition_variable
variable_keystringrequired

A boolean variable of the plan.

equalsbooleanrequired

The value that bills the line.

dimensionsarray of BillingPlanLineDimensionrequired

Dimension values on the line.

2 attributes of each item
dimension_idstring (uuid)required

The dimension.

dimension_value_idstring (uuid) · nullablerequired

Its value on the line; null only for the object type's own dimension (each recipient's object).

bill_to_property_keysarray of stringrequired

For object_type plans, the contact properties that name the payer, in order.

zero_linesstringrequired

Whether lines that come to zero appear on invoices. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) hide, show

currencystringrequired

The currency (ISO 4217) of every invoice the plan bills; each converts into the book currency at the European Central Bank rate of its posting date.

variablesarray of BillingPlanVariablerequired

Values formulas refer to as var.<key>.

14 attributes of each item
idstring (uuid)required

Variable id.

keystringrequired

Machine name formulas use as var.<key>.

namestringrequired

Name shown to people.

value_typestringrequired

number or boolean. New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) number, boolean

unitstring · nullablerequired

Unit of a number.

kindstringrequired

timed (values by period), asked (given at every run) or formula (computed from its formula at every run). New values may be added: treat a value you do not know as valid, not as an error.

Known values (open: expect new ones) timed, asked, formula

guidancestring · nullablerequired

For asked variables, the hint shown at the run.

needs_reviewbooleanrequired

A copy shifted its values; someone should check them.

sort_orderintegerrequired

0-based display order.

segmentsarray of BillingPlanVariableSegmentrequired

For timed variables, the values by period.

3 attributes of each item
start_periodstring (date)required

First period the value applies to (a first of month).

end_periodstring (date) · nullablerequired

Last period, inclusive; null means onwards.

valuestringrequireddecimal string

The value, a decimal string with at most 4 fraction digits; "1"/"0" for a boolean variable.

used_by_line_idsarray of string (uuid)required

Lines whose formulas or condition use this variable (it cannot be removed while non-empty).

key_lockedbooleanrequired

True when the key can no longer change (used by a line, or a run recorded a value for it).

formulastring · nullableat most 2000 characters

Required for kind=formula; null otherwise. Uses system values and variables earlier in the submitted variable list; self and forward references are refused. Evaluated after system values, before lines, using Decimal precision 28.

invoice_formulastring · nullableat most 2000 characters

For an asked number only: how a billing run computes the value it takes from a purchase invoice's chosen lines, a formula in the invoice context (see parseBillingFormula), e.g. sum_lines(line.amount / line.quantity) for a price per unit.

Details

Null: the chosen lines' sum, sum_lines(line.amount). Stored normalised; the default written out is stored as null.

copied_from_plan_idstring (uuid) · nullablerequired

The plan this one was copied from (an independent plan, not a revision).

approval_issuesarray of BillingPlanIssuerequired

What still blocks approving a draft; empty when it can be approved (and on an approved plan).

4 attributes of each item
codestringrequired

Machine code, e.g. name_missing, start_missing, end_before_start, no_lines, line_label_missing, line_price_missing, line_formula_missing, bill_to_missing, bill_to_invalid, variable_gap, variable_key_invalid, variable_key_duplicate, segment_overlap, segment_end_before_start, segment_value_invalid, condition_variable_unknown, condition_property_unknown, dimension_value_missing, dimension_not_allowed, dimension_duplicate, recipient_selection_empty, recipient_not_in_plan.

pathstringrequired

Where the problem is, in the BillingPlanInput shape; empty for the whole plan.

messagestringrequired

What is wrong, in English.

paramsobject

The figures a localized message needs.

currency_lockedbooleanrequired

The plan's currency can no longer be changed: an invoice from the plan has been issued (a save that changes it is refused, BILLING_PLAN_CURRENCY_LOCKED). To bill in another currency, copy the plan.

external_refstring · nullablerequired

Your own id for the plan, if you set one.

revisionsarray of BillingPlanRevision

Every revision, oldest first. Only with expand=revisions.

4 attributes of each item
revisionintegerrequiredat least 1

Revision number, from 1.

effective_fromstring (date) · nullablerequired

First period it bills; null for the first revision (from the plan's start).

created_atstring (date-time)required

When it was made.

approved_onstring (date) · nullablerequired

When it was approved.

due_end_of_monthboolean

Due on the last day of the invoice date's month, or the next month's last day when issued on month end. Counts from the invoice date on every run, regardless of the billed period. Cannot be combined with due_day_of_next_month; payment_term_days is ignored when true.

due_day_of_next_monthinteger · nullable

When set, invoices fall due on this day of the next month.

approved_onstring (date) · nullable

When the plan was approved (a general meeting or a signed contract). Runs issue only from an approved plan.

approval_protocolstring · nullable

Protocol or contract reference of the approval.

approved_atstring (date-time) · nullable

When the approval was recorded; non-null means approved.

next_revision_fromstring (date) · nullable

For an approved plan with issued invoices: the first period with no issued invoice, the earliest effective_from a change may take. Null when a change is made in place.

omittedarray of string

Parts of the plan left out because the token's scopes do not read them: contacts (the contacts a partners plan bills, recipient_partner_ids, and the contacts a line selects, by contacts:read), objects (the objects a line of an object-type plan selects, by objects:read). Empty for the web app.

Known values (open: expect new ones) contacts, objects

Used by