Document Schemas

Business documents schemas

Different business document types have different schemas even if all data reside in the /document resource. Here are the schemas for the different document types.

Common attributes

Attribute Type Mandatory Description
id integer   The ID of the business document
created_at date   The date and time when the business document was created
created_by_id integer   The ID of the user that created the business document
updated_at date   The date and time when the business document was last updated
updated_by_id integer   The ID of the user that last updated the business document
client_account_id integer Yes The client account ID of the business document
voucher_id integer   The ID of the uploaded file (voucher) associated with the business document
document_type string Yes The type of the business document
is_draft boolean   The draft status of the business document
is_archived boolean   The archive status of the business document
archive_category string   The archive category of the business document

Enums

PaymentMeans

The PaymentMeans enum represents the different methods of payment that can be used for a business document.

Value Description
CASH Payment made using physical currency (coins and banknotes)
CARD Payment made using a debit or credit card
BANK_TRANSFER Payment made by transferring money from one bank account to another
DIRECT_DEBIT Payment made by the payee withdrawing funds directly from a payer’s bank account
UNKNOWN Payment method is not known or not specified

DebtCollectionSeverity

The DebtCollectionSeverity enum represents the different severity levels of a debt collection notice.

Value Description
REMINDER Friendly reminder to the debtor about the outstanding debt
COLLECTION_NOTICE Warning to the debtor about possible collection actions
COLLECTION Collection notice indicating legal action or debt collection agency involvement

Receipt

Description: A receipt is a document that acknowledges the payment of a business document.

Document is postable and will result in a journal entry.

document_types: [‘RECPT’]

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. In this case the supplier
payor_id integer   Empty if payor of the receipt is the company (from company account). Otherwise it points to the employee which has paid with hes private account.
document_date date Yes The date the receipts was issued
document_number string   The unique receipt number / identifier
payment_means PaymentMeans payor_id == null The payment means of the business document
payment_card_number string payment_means == CARD The payment card number. Often masked as on the receipt only showing the last 4 or 5 digits.
gross_amount decimal Yes The gross amount of the business document
net_amount decimal   The net amount of the business document
currency_id integer Yes or … The ID of the currency used in the document
currency_code string … Yes The code of the currency used in the document

Relationships

Relationship Type Description
business_partner BusinessPartner The supplier
payor BusinessPartner The employee who paid

Invoice

Description: An invoice is a commercial document issued by a seller to a buyer, listing the items, quantities, and agreed prices for products or services the seller has provided the buyer. It indicates the amount the buyer owes the seller and the payment terms.

Document is postable and will result in a journal entry.

document_types: ‘ARINV’ (sales) or ‘APINV’ (purchase)

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. For sales invoices, this is the customer. For purchase invoices, this is the supplier.
payor_id integer   The ID of the entity responsible for payment. Usually empty for sales invoices.
document_date date Yes The date when the invoice was issued
due_date date   The date by which the payment is expected to be made
period_start date   The start date of the period covered by the invoice, if applicable
period_end date   The end date of the period covered by the invoice, if applicable
document_number string   The unique invoice number / identifier
buyer_reference string   A reference number or code provided by the buyer, often used for their internal tracking
order_reference string   A reference to the related purchase order, if applicable
note string   Any additional notes or comments related to the invoice
payment_means PaymentMeans Yes The method by which the payment is expected to be made
payment_ref string   A reference code for the payment, often used in bank transfers
gross_amount decimal Yes The total amount of the invoice, including taxes
net_amount decimal   The total amount of the invoice, excluding taxes
bank_account_id integer payment_means == BANK_TRANSFER FK of the bank account associated with the invoice
currency_id integer Yes or … The ID of the currency used in the invoice
currency_code string … Yes The code of the currency used in the invoice

Relationships

Relationship Type Description
business_partner BusinessPartner The customer (for sales invoices) or supplier (for purchase invoices)
bank_account BankAccount The bank account for payment. For sales invoices, this is the company’s bank account. For purchase invoices, this is the supplier’s bank account.
item_lines DocumentLine The individual line items on the invoice, detailing products or services

Credit Note

Description: A credit note is a commercial document issued by a seller to a buyer, which reduces the amount of an invoice. It’s used to correct errors, provide refunds, or adjust the amount due for returned goods or services. It effectively represents a negative invoice or a “reverse invoice”.

Document is postable and will result in a journal entry.

document_types: ‘ARCRN’ (sales) or ‘APCRN’ (purchase)

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. For sales credit notes (ARCRN), this is the customer. For purchase credit notes (APCRN), this is the supplier.
document_date date Yes The date when the credit note was issued
period_start date   The start date of the period covered by the credit note, if applicable
period_end date   The end date of the period covered by the credit note, if applicable
document_number string   The unique credit note number / identifier
buyer_reference string   A reference number or code provided by the buyer, often used for their internal tracking
order_reference string   A reference to the related purchase order, if applicable
note string   Any additional notes or comments related to the credit note
payment_ref string   A reference code for the payment or refund, if applicable
gross_amount decimal Yes The total amount of the credit note, including taxes
net_amount decimal   The total amount of the credit note, excluding taxes
currency_id integer Yes or … The ID of the currency used in the credit note
currency_code string … Yes The code of the currency used in the credit note

Relationships

Relationship Type Description
business_partner BusinessPartner The customer (for sales credit notes) or supplier (for purchase credit notes)
item_lines DocumentLine The individual line items on the credit note, detailing products or services being credited
document_references DocumentReference References to related documents, typically the original invoice being credited

Proforma Invoice

Description: A proforma invoice is a preliminary bill of sale sent to buyers in advance of a shipment or delivery of goods, or received from suppliers before a purchase. It notes the kind and quantity of goods, their value, and other important information such as weight and transportation charges. It is not a true invoice, but rather a document that can be used for customs purposes, to provide information to the buyer or seller, or as a means of getting an advance payment. It can be used in both sales and purchase contexts.

Document is not postable. No journal entry should be created.

document_types: ‘ARPIN’ (sales) or ‘APPIN’ (purchase)

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. For sales (ARPIN), this is the potential customer. For purchases (APPIN), this is the potential supplier.
document_date date Yes The date when the proforma invoice was issued
document_number string   The unique proforma invoice number / identifier
payment_means PaymentMeans   The proposed method of payment
payment_ref string   A reference code for the potential payment
gross_amount decimal Yes The total amount of the proforma invoice, including taxes
net_amount decimal   The total amount of the proforma invoice, excluding taxes
bank_account_id integer payment_means == BANK_TRANSFER FK of the bank account where payment would be made or received
currency_id integer Yes or … The ID of the currency used in the proforma invoice
currency_code string … Yes The code of the currency used in the proforma invoice

Relationships

Relationship Type Description
business_partner BusinessPartner The potential customer (for sales) or potential supplier (for purchases)
bank_account BankAccount The bank account where payment would be made or received
item_lines DocumentLine The individual line items on the proforma invoice, detailing products or services

Cash Invoice

Description: A cash invoice is a document issued by a seller to a buyer at the time of sale, when payment is made in cash. It serves as a receipt for the transaction and provides a record of the goods or services purchased, the amount paid, and the date of the sale.

Document is postable and will result in a journal entry.

document_types: ‘ARCIN’ (sales) or ‘APCIN’ (purchase)

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. For sales cash invoices, this is the customer. For purchase cash invoices, this is the supplier.
payor_id integer   Empty if payor of the receipt is the company (from company account). Otherwise it points to the employee which has paid with hes private account.
document_date date Yes The date when the cash invoice was issued
document_number string   The unique cash invoice number / identifier
payment_means PaymentMeans Yes The method by which the payment was made
payment_ref string   A reference code for the payment
payment_card_number string payment_means == CARD The payment card number. Often masked as on the receipt only showing the last 4 or 5 digits.
gross_amount decimal Yes The total amount of the invoice, including taxes
net_amount decimal   The total amount of the invoice, excluding taxes
bank_account_id integer payment_means == BANK_TRANSFER FK of the bank account where payment was made
currency_id integer Yes or … The ID of the currency used in the cash invoice
currency_code string … Yes The code of the currency used in the cash invoice

Relationships

Relationship Type Description
business_partner BusinessPartner The customer (for sales cash invoices) or supplier (for purchase cash invoices)
payor BusinessPartner The employee who paid

Payment Request

Description: A payment request is a formal notice sent to a business partner

Debt Collection

Description: A debt collection document is a formal notice sent to a debtor regarding outstanding debts, typically issued after previous attempts to collect payment have failed. It outlines the amount owed, payment terms, and potential consequences of non-payment.

Document is not postable. No journal entry should be created.

document_types: ‘ARDEB’ (sales) or ‘APDEB’ (purchase)

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. For sales debt collections (ARDEB), this is the debtor. For purchase debt collections (APDEB), this is the creditor.
collector_id integer Yes FK of the business partner acting as the debt collector
document_date date Yes The date when the debt collection notice was issued
due_date date   The date by which the payment is expected to be made
document_number string Yes The unique debt collection notice number / identifier
collection_case_number string   The unique identifier for this debt collection case
collection_severity DebtCollectionSeverity Yes The severity level of the collection (e.g., “First Notice”, “Final Warning”)
payment_status string Yes The current status of the debt (e.g., “Unpaid”, “Partially Paid”, “Disputed”)
payment_means PaymentMeans Yes The method by which the payment is expected to be made
payment_ref string   A reference code for the payment
gross_amount decimal Yes The total amount of the debt, including fees and interest
net_amount decimal   The total amount of the debt, excluding fees and interest
late_fee_amount decimal   The amount of late fees applied
interest_amount decimal   The amount of interest applied
bank_account_id integer Yes FK of the bank account where payment should be made
currency_id integer Yes or … The ID of the currency used in the debt collection
currency_code string … Yes The code of the currency used in the debt collection

Relationships

Relationship Type Description
business_partner BusinessPartner The debtor (for sales debt collections) or creditor (for purchase debt collections)
collector BusinessPartner The debt collection agency or internal collector
bank_account BankAccount The bank account where payment should be made
document_references DocumentReference References to related documents, typically the original invoices or previous collection notices

Sales report / summary

Description: A sales report or summary is a document that provides an overview of sales transactions within a specific period, typically broken down by product, customer, or other categories. It may include total sales, returns, discounts, and other relevant information.

Document is postable and will result in a journal entry.

document_types: ‘SALSM’

Attribute Type Mandatory Description
business_partner_id integer   FK of business partner. For sales reports, this is the company issuing the sales report.
period_start date   The start date of the period covered by the report
period_end date   The end date of the period covered by the report
gross_amount decimal   The total sales amount for the period, including taxes
currency_id integer   The ID of the currency used in the report
currency_code string   The code of the currency used in the report

Relationships

Relationship Type Description
business_partner BusinessPartner The company issuing the sales report

Report from payment provider

Description: A report from a payment provider is a document that summarizes payment transactions processed through a third-party payment service, such as a credit card processor or online payment gateway. It may include details on fees, chargebacks, refunds, and other payment-related information.

Document is postable and will result in a journal entry.

document_types: ‘PAYPR’

Attribute Type Mandatory Description
business_partner_id integer Yes FK of business partner. This is the payment provider.
period_start date Yes The start date of the period covered by the report
period_end date Yes The end date of the period covered by the report
gross_amount decimal Yes The total amount of transactions processed, including fees
currency_id integer Yes or … The ID of the currency used in the report
currency_code string … Yes The code of the currency used in the report

Relationships

Relationship Type Description
business_partner BusinessPartner The payment provider

Relaterte artikler