Moloni ON Logo WhiteGuidesAPI ReferenceExplorer
Guides

Document Types

Document types define the structure, behavior, and fiscal rules of each document category in Moloni ON (invoices, receipts, credit notes, etc.). They are system-defined and fixed, meaning you cannot create or delete them. Your code refers to them by their documentTypeId or, more commonly, by their apiCode.

Fetching document types

Use the documentTypes query to retrieve the full list with all their properties. Pass defaultLanguageId in options to populate the title and titlePlural shorthand fields (see Translated Fields for details).

query {
  documentTypes(options: { defaultLanguageId: 2 }) {
    data {
      documentTypeId
      apiCode
      apiCodePlural
      saftDocCode
      group
      entityType
      title       # populated because defaultLanguageId was passed
      titlePlural
      canConvertTo {
        documentTypeId
        apiCode
      }
    }
  }
}

To fetch a single type by ID:

query {
  documentType(documentTypeId: 1) {
    data {
      documentTypeId
      apiCode
      apiCodePlural
      saftDocCode
      title
    }
  }
}

Key fields

FieldDescription
documentTypeIdNumeric ID used when creating documents or filtering document sets
apiCodecamelCase identifier used as the prefix for all API operations on this type
apiCodePluralPlural form of apiCode, used for list queries and some API operations
saftDocCodePortuguese SAF-T fiscal code (e.g. FT for Invoice, RE for Receipt)
groupLogical grouping: Sales, Settlements, Transport, Suppliers, etc.
entityTypeThe counterparty type: Customer, Supplier, or Salesperson
title / titlePluralHuman-readable name, only populated when defaultLanguageId is passed in options (see Translated Fields)
canConvertToDocument types this one can be converted into
canBeConvertedFromDocument types that can originate this one

How apiCode drives the API

The apiCode is the building block for all type-specific API operations. By convention:

OperationNaming patternExample (Invoice)
Create a document{apiCode}CreateinvoiceCreate
Get a single document{apiCode}invoice
List documents{apiCodePlural}invoices
Generate PDF{apiCode}GetPDFinvoiceGetPDF
Get PDF download token{apiCode}GetPDFTokeninvoiceGetPDFToken
Update a document{apiCode}UpdateinvoiceUpdate
Delete a document{apiCode}DeleteinvoiceDelete
Count documents{apiCode}CountinvoiceCount

Sales (Customer)

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Invoice1invoiceinvoicesFT
Simplified Invoice20simplifiedInvoicesimplifiedInvoicesFS
Invoice Receipt27invoiceReceiptinvoiceReceiptsFR
Debit Note4debitNotedebitNotesND
Settlement Note19settlementNotesettlementNotesNDL
Pro Forma Invoice13proFormaInvoiceproFormaInvoicesPF
Purchase Order28purchaseOrderpurchaseOrdersNE
Recurring Agreement12recurringAgreementrecurringAgreementsAV

Settlements (Customer)

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Receipt2receiptreceiptsRE
Credit Note3creditNotecreditNotesNC
Payment Return35paymentReturnpaymentReturnsDP

Transport (Customer)

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Delivery Note6deliveryNotedeliveryNotesGR
Bills of Lading15billsOfLadingbillsOfLadingsGT
Customer Return Note32customerReturnNotecustomerReturnNotesGD

Other Documents (Customer)

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Estimate14estimateestimatesOR
Table Consult47tableConsulttableConsultsCM

Suppliers

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Supplier Invoice8supplierInvoicesupplierInvoicesFF
Supplier Receipt10supplierReceiptsupplierReceiptsREF
Supplier Credit Note21supplierCreditNotesupplierCreditNotesNCF
Supplier Purchase Order7supplierPurchaseOrdersupplierPurchaseOrdersNEF
Supplier Bills of Lading78supplierBillsOfLadingsupplierBillsOfLadingsGTF
Purchase Recurring Agreement80purchaseRecurringAgreementpurchaseRecurringAgreementsAVF

Salespersons

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Salesperson Payment33salespersonPaymentsalespersonPaymentsPV

Migrated Documents

Document typedocumentTypeIdapiCodeapiCodePluralSAF-T
Migrated Invoice11migratedInvoicemigratedInvoicesSMFT
Migrated Simplified Invoice25migratedSimplifiedInvoicemigratedSimplifiedInvoicesSMFS
Migrated Invoice Receipt66migratedInvoiceReceiptmigratedInvoiceReceiptsSMFR
Migrated Receipt79migratedReceiptmigratedReceiptsSMRE
Migrated Credit Note18migratedCreditNotemigratedCreditNotesSMNC
Migrated Debit Note24migratedDebitNotemigratedDebitNotesSMND
Migrated Estimate73migratedEstimatemigratedEstimatesSMOR
Migrated Purchase Order81migratedPurchaseOrdermigratedPurchaseOrdersSMNE

Next steps

© 2026 Moloni ON

Tax Authority Certificate No. 3075