E-Invoices

Table name: e_invoices

One row per e-invoice document issued by your teams and operators (the seller side), for example the invoices, credit notes and self-billed invoices Monta sends to the buyer over the e-invoicing network. The line items of each document are in E-Invoice Lines.

Credit notes carry negative amounts, as sent to the buyer. Net, VAT and gross amounts are calculated from the document lines. Purged drafts stay in the table with deleted_at set (document_status = 'deleted'). Drafts and failed documents are included too; read document_status to tell the states apart, and filter on document_status = 'delivered' for the documents the buyer received.

SQL: e_invoices

Schema

Column NameData TypeDescription
Primary ID
idINTEGERPrimary key, unique identifier of the e-invoice document
Other IDs
invoice_numberVARCHARSerial number carried on the transmitted document
corrects_document_idINTEGERFor a credit note, the id of the e-invoice document it gives money back against. Null on every other document type. Not available in the Partner API
seller_owner_idINTEGERID of the team or operator that owns the legal entity which issued the document
seller_wallet_idINTEGERWallet the document was issued from, as recorded on the latest submission. Null when the document has no submission
buyer_owner_idINTEGERID of the team or operator the document was issued to
buyer_wallet_idINTEGERWallet of the buyer, as recorded on the latest submission. Null when the document has no submission
Timestamps
created_atTIMESTAMP_NTZTimestamp when the document was created
updated_atTIMESTAMP_NTZTimestamp when the document was last updated
deleted_atTIMESTAMP_NTZTimestamp when the document was soft deleted (a purged draft or failed document, not a cancelled invoice), null if not deleted. The Partner API never returns deleted documents
period_fromTIMESTAMP_NTZStart of the period the document covers
period_toTIMESTAMP_NTZEnd of the period the document covers
submitted_atTIMESTAMP_NTZWhen the document was handed to the e-invoicing network
delivered_atTIMESTAMP_NTZWhen the network confirmed delivery to the buyer
payment_lifecycle_status_atTIMESTAMP_NTZWhen the buyer reported payment_lifecycle_status
Dates
invoice_dateDATEDate the document was issued
due_dateDATEWhen payment is due: the end of the invoicing period plus the agreed days to pay. Null when the document asks for nothing. Not available in the Partner API
Seller
seller_owner_typeVARCHARType of the seller owner: TEAM or OPERATOR
seller_company_nameVARCHARRegistered company name of the seller. Null when unknown or the seller is a deleted personal account
seller_country_codeVARCHARISO 3166-1 alpha-2 country of the seller. Null when unknown or the seller is a deleted personal account
seller_identifiersARRAYTax and registration identifiers of the seller, as an array of objects with scheme (Monta scheme name such as NL_KVK or FO_VAT) and id (the value)
Buyer
buyer_owner_typeVARCHARType of the buyer owner: TEAM or OPERATOR
buyer_company_nameVARCHARRegistered company name of the buyer. Null when unknown or the buyer is a deleted personal account
buyer_country_codeVARCHARISO 3166-1 alpha-2 country of the buyer. Null when unknown or the buyer is a deleted personal account
buyer_identifiersARRAYTax and registration identifiers of the buyer, same shape as seller_identifiers
Attributes
document_typeVARCHARType of document: INVOICE, SELF_BILLED_INVOICE or CREDIT_NOTE
currency_codeVARCHARISO 4217 currency code of every amount on the document
net_amountNUMBERTotal excluding VAT, in major units. Sum of the line net amounts; negative on credit notes
vat_amountNUMBERTotal VAT, in major units. Sum of the line VAT amounts; negative on credit notes
gross_amountNUMBERTotal including VAT, in major units. Negative on credit notes
payable_amountNUMBERPart of the total the receiver still owes against this document. 0 means the whole total was settled through the Monta wallets. Not available in the Partner API
noteVARCHARFree-text note carried on the document
Status
document_statusVARCHAROne reading of where the document stands: deleted when deleted_at is set; otherwise the lowercase latest submission status: delivered (the only value meaning the buyer received it), failed (see submission_error_details), draft, processing or pending, or no_submission when the document has no live submission. Draft, failed and no_submission documents were never delivered
submission_statusVARCHARLatest non-deleted submission status on the e-invoicing network: PENDING, DRAFT, PROCESSING, DELIVERED or FAILED. Null when there is none
submission_error_detailsVARCHARWhy the submission failed, when submission_status is FAILED
payment_lifecycle_statusVARCHARLatest payment state the buyer reported back over the e-invoicing network

Inclusion Criteria

A document is included if its seller is a team or operator within your scope. Documents issued to your teams and operators by others (the buyer side) are not included, which matches the Partner API.

Soft-deleted documents are included with deleted_at set, and so are drafts and failed documents. Submission fields (submission_status, submitted_at, delivered_at, submission_error_details) come from the latest non-deleted submission. The seller and buyer company name, country and identifiers are blank for a deleted personal team, the same rule as in teams.

Data flow

Upstream tablesDownstream tables
teamse_invoice_lines
operators---

Alignment

Monta API

  • Aligns with the Monta API e-invoices endpoint, which returns only the documents the owner issued (seller side)
  • The Monta DW table includes additional fields not in the API response: payable_amount, due_date, corrects_document_id, and the soft-deleted documents (deleted_at, document_status = 'deleted')
  • Payment instructions, bank details and the raw document payload are not exposed

Joining e-invoices to their lines

select
    i.invoice_number
    , i.document_type
    , i.invoice_date
    , i.currency_code
    , l.item_name
    , l.quantity
    , l.net_amount
    , l.vat_amount
from e_invoices i
inner join e_invoice_lines l
    on l.e_invoice_document_id = i.id
where i.document_status = 'delivered'

Did this page help you?