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.

PurchaseInvoicePatch

Request

Fields to change. lines replaces the lines: a line with an id is kept and updated, one without is added, one left out is removed.

Sent in requests. Its values are closed: anything not listed is refused.

Attributes

15
datestring (date)

Document date, as printed.

due_datestring (date)

Payment due date; not before date.

posting_datestring (date) · nullable

The date to book the invoice at. Null follows date again. A posted invoice cannot move to another period.

currencystring3–3 characters

Document currency (ISO 4217).

exchange_ratestring · nullabledecimal stringpattern ^([1-9][0-9]{0,14}(\.[0-9]{1,10})?|0\.([1-9][0-9]{0,9}|0[1-9][0-9]{0,8}|00[1-9][0-9]{0,7}|000[1-9][0-9]{0,6}|0000[1-9][0-9]{0,5}|00000[1-9][0-9]{0,4}|000000[1-9][0-9]{0,3}|0000000[1-9][0-9]{0,2}|00000000[1-9][0-9]?|000000000[1-9]))$

State the rate instead of the European Central Bank's. Omitted keeps a stated rate; null returns to the bank's. Refused on a document in the book currency and on a credit note, which uses its invoice's rate (EXCHANGE_RATE_OVERRIDE_INVALID). With no bank rate for the date and none stated, 400 EXCHANGE_RATE_MISSING.

book_tax_totalstring · nullabledecimal string

The VAT in the book currency as the seller states it, of the supply: a prepayment deduction keeps its prepayment's VAT, so the invoice's stored book_tax_total is this figure less the deducted VAT.

Details

Between 0 and twice the supply's converted VAT, else 400 BOOK_TAX_TOTAL_OUT_OF_RANGE. Omitted keeps a stated figure while the document's VAT is unchanged; null returns to the converted figure.

contact_idstring (uuid) · nullable

The supplier. Changing it copies the new supplier's details unless party is sent too. A posted invoice's supplier cannot change.

The supplier as the invoice names it.

5 attributes of party
namestringrequired

Name.

registry_codestring · nullable

Register code.

vat_numberstring · nullable

VAT number.

addressstring · nullable

Address as one line of text.

emailstring · nullable

Email.

supplier_invoice_numberstring · nullableat most 50 characters

The number printed on the supplier's invoice.

notesstring · nullableat most 5000 characters

Free-text notes.

payment_referencestring · nullableat most 140 characters

The supplier's reference to pay with.

kindstring

Reclassify a draft. Not on a posted invoice, nor on a credit note that credits one of your invoices.

One of invoice, credit_note

linesarray of PurchaseInvoiceLineInputat most 500 items

The whole new list of lines, in order.

11 attributes of each item
namestringrequired1–255 characters

Line text, as printed.

quantitystringrequireddecimal string

Quantity; negative for a supplier's return row.

unitstringrequiredat most 50 characters

Unit of measure.

unit_pricestringrequireddecimal string

Net price per unit, as the supplier printed it; may be negative (a discount row). A document whose total is below zero is refused (INVOICE_TOTAL_NEGATIVE); register it as a credit note.

tax_code_idstring (uuid)required

The line's VAT code; its rate on the invoice date is frozen on the line.

account_idstring (uuid)required

The expense or asset account. Never the organization's accounts payable or receivable control account (400 PURCHASE_LINE_CONTROL_ACCOUNT at the line), except a kept line that stays on the account it already has.

idstring (uuid)

Keep the line with this id (from the invoice's lines); omit it for a new line.

item_idstring (uuid) · nullable

The item the line is for, if any.

descriptionstring · nullableat most 1000 characters

Longer text under the name.

dimensionsarray of DimensionAssignmentat most 50 items

Dimension values on the line.

2 attributes of each item
dimension_idstring (uuid)required

The dimension.

value_idstring (uuid)required

The value within that dimension.

tax_amountstring · nullabledecimal string

The line's VAT as the document states it. Kept only on a historical create -- one that links its imported transaction_id, or is dated before the organization's opening date; the document's VAT is then these figures, not the ones its codes derive.

Details

On any other write it may only repeat the VAT the line derives (a read sent back), and is not stored; another figure is 400 VALIDATION_ERROR by pointer. A line with no VAT rate states none; the VAT sits on the line value's side of zero.

rounding_amountstring · nullabledecimal string

A VAT-free rounding added to the total, in whole cents; null means none.

external_refstring · nullable1–200 characters

Your id for this invoice; null removes it.

Used by