PurchaseInvoiceCreateInput
RequestA supplier's invoice or credit note to register as a draft. lines is required unless credits_invoice_id names the invoice to credit, whose lines are then copied.
Sent in requests. Its values are closed: anything not listed is refused.
Attributes
18The date to book the invoice at (its ledger entry, period and VAT return), when not date. Omitted or null: date.
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).
Details
With no bank rate for the date and none stated, 400 EXCHANGE_RATE_MISSING. On an issued create linked to an imported transaction (transaction_id) it is the source system's rate: the document ties to that journal at it, within a cent per VAT group, and keeps it as an imported rate; omitted there, the rate is the one the journal was booked at.
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.
The supplier. Its name and identifiers are copied onto the invoice unless party gives them. Required to post.
The supplier as the invoice names it, when not as the contact has it.
The number printed on the supplier's invoice; required to post.
The supplier's reference to pay with. An Estonian 7-3-1 or RF reference is stored without spaces; anything else is kept as sent.
Only with kind: credit_note: the posted invoice of this supplier that the credit note credits. Without lines it credits all of it; the lines keep that invoice's VAT rates either way.
The lines, in order.
11 attributes of each item
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.
The line's VAT code; its rate on the invoice date is frozen on the line.
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.
Dimension values on the line.
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.
A VAT-free rounding added to the total so it equals the printed one, e.g. -0.02; whole cents. Omitted or null means none.
Your id for this invoice, unique among the organization's purchase invoices.
draft (the default) registers a draft; issued creates a historical document a migration brings over: it links the imported transaction that booked it (transaction_id, required), keeps its number, dates and stated line VAT, posts and sends nothing, and reads origin: import.
One of draft, issued
With status: issued: the imported transaction (origin: import, posted by no document) that booked this document, dated on its posting date, whose receivable (sales) or payable (purchases) lines name this contact or none and move exactly its total in its direction (an invoice debits a receivable and credits a payable, a credit note the reverse).
Details
400 INVOICE_TRANSACTION_NOT_LINKABLE otherwise. The transaction is only linked, never changed. Refused (400 INVOICE_TRANSACTION_NOT_LINKABLE) as well: a transaction any lines of which carry a VAT code (the return would count them beside the invoice), whose VAT accounts do not move the invoice's VAT, that an imported payment already holds, or a document with no total. A document in another currency than the book currency ties in book figures: at the rate sent as exchange_rate (the source system's), its receivable or payable and VAT legs within a cent per VAT group of the converted total and VAT; without one, at the rate the journal booked (its receivable or payable over the total), its VAT legs likewise. Its rate and book figures are then read off that journal. A link into a period marked done is 409 PERIOD_CONFIRM_REQUIRED, and into a filed VAT return's period 409 INVOICE_TRANSACTION_VAT_PERIOD_FILED. Needs the ledger:write scope besides invoices:write (403 INSUFFICIENT_SCOPE).