Skip to main content
Version: 2.4

Billing Documents

Billing documents are the output of cycle calculation. In core tSM billing they represent invoices and related accounting documents that can be printed and sent to the customer.

This document covers billing document structures, line composition, document typing/status, and SAP export payload support.


1. Business Meaning

1.1 What a Billing Document Represents

BillingDocument is the header-level accounting document for one customer and billing cycle. It stores invoice identifiers, due dates, totals, currency, and lifecycle status.

1.2 What a Billing Document Line Represents

BillingDocumentLine is the item-level charge row on the document. Lines carry quantity, VAT, unit/line price values, ordering (sortOrder), and optional links to catalog specification and runtime service configuration.

1.3 Document Type and Status Governance

  • BillingDocumentType controls business type, accounting type, templates, and generation behavior.
  • BillingDocumentStatus controls lifecycle states.
  • BillingDocumentAccountingType enum marks key accounting semantics (INVOICE, CORRECTIVE_TAX).

This allows multiple document types in one installation (for example invoice, corrective tax document, custom settlement document).

1.4 SAP Export Document

SapDocument groups billing documents for SAP-oriented CSV integration and tracks export status.


2. Entity Reference: BillingDocument (BillingDocument)

FieldTypeRequiredRead-onlyDescription
idUUIDNoNoBilling document primary key.
nameStringYesNoHuman-readable document name.
keyStringYesNoTechnical/business key (ASCII without spaces recommended).
statusStringYes (business)NoFK code of document status (BillingDocumentStatus.code).
billingCycleStringYes (business)NoFK code of billing cycle (BillingCycle.code).
customerIdStringYes (business)NoFK identifier of CRM customer.
priceWithVatDoubleYesNoDocument total amount.
invoiceNumberStringNoNoInvoice number/identifier shown on customer document.
invoicedForStringNoNoOptional explanatory text for invoiced subject.
invoiceDateDateNoNoInvoice issue date.
dueDateDateNoNoInvoice maturity date.
billingCurrencyCodeStringYesNoFK code of currency (Currency.code).
dataTagsList<String>NoNoOptional labels/tags.
billingDocumentTypeStringYesNoFK code of document type (BillingDocumentType.code).
charsTsmCharsNoNoDynamic document attributes.
descriptionStringNoNoOptional description.
accountIdUUIDNoNoOptional account reference.

2.1 Practical Notes

  • API schema flags several FK fields as required for normal billing flow (status, billingCycle, customerId).
  • The field name is priceWithVat; treat it as authoritative for integrations and data mapping.

3. Entity Reference: BillingDocumentLine (BillingDocumentLine)

FieldTypeRequiredRead-onlyDescription
idUUIDNoNoLine primary key.
nameStringYesNoLine display name.
billingDocumentCodeStringYesNoFK code of parent billing document.
charsTsmCharsNoNoDynamic line attributes.
quantityDoubleYes (business)NoLine quantity/amount multiplier.
priceWithoutVATDoubleNoNoPrice excluding VAT (defaults to 0.0).
vatDoubleYesNoVAT value (defaults to 0.0).
sortOrderIntYesNoOrder used for invoice rendering.
entityCatalogSpecificationIdUUIDNoNoOptional linked catalog specification ID.
entityInstanceConfigurationIdUUIDNoNoOptional linked runtime configuration ID.
parentDocumentLineIdUUIDNoNoOptional parent line for hierarchical rendering.
dataMap<String, Any?>NoNoAdditional custom payload.

4. Entity Reference: BillingDocumentType (BillingDocumentType)

FieldTypeRequiredRead-onlyDescription
idUUIDNoNoDocument type primary key.
codeStringYesNoTechnical type code.
nameStringYesNoDisplay name.
validityFromDateNoNoValidity start.
validityToDateNoNoValidity end.
descriptionStringNoNoOptional type description.
localizationDataLocalizationDataNoNoLocalization payload.
billingDocumentSpecIdUUIDNoNoOptional billing document specification reference.
billingDocumentLineSpecIdUUIDNoNoOptional billing document line specification reference.
formatterDocumentTemplateIdUUIDNoNoOptional formatter template reference for output generation.
tsmModuleIdUUIDNoNoOptional module reference.
mnemonicCodeStringNoNoOptional mnemonic code.
aggregationTqlStringNoNoOptional aggregation TQL definition.
createPrivilegeStringNoNoOptional privilege required for create operations.
accountingTypeBillingDocumentAccountingTypeNoNoAccounting behavior marker (INVOICE or CORRECTIVE_TAX).
registryMap<String, Any?>NoNoRegistry payload.
configMap<String, Any?>NoNoAdditional configuration payload.
dataTagsList<String>NoNoOptional labels/tags.
tsmModuleStringNoNoOptional module code reference.
iconStringNoNoOptional icon metadata.
sapConfigStringNoNoOptional SAP integration configuration payload.

5. Entity Reference: BillingDocumentStatus (BillingDocumentStatus)

FieldTypeRequiredRead-onlyDescription
idUUIDNoNoStatus primary key.
codeStringYesNoTechnical status code.
nameStringYesNoDisplay name.
validityFromDateNoNoValidity start.
validityToDateNoNoValidity end.
descriptionStringNoNoOptional status description.
localizationDataLocalizationDataNoNoLocalization payload.
dataTagsList<String>NoNoOptional labels/tags.
configMap<String, Any?>NoNoAdditional configuration payload.

6. Entity Reference: SapDocument (SapDocument)

FieldTypeRequiredRead-onlyDescription
idUUIDNoNoSAP export document primary key.
statusStringYes (business)NoSAP document status code.
billingCycleStringYes (business)NoBilling cycle code used for export batching.
customerIdStringYes (business)NoCustomer identifier in export context.
hasCsvBooleanNoNoIndicates whether CSV export payload was generated.
billingDocumentIdsList<UUID>YesNoBilling documents included in this SAP export package.

7. Enum Reference: BillingDocumentAccountingType (BillingDocumentAccountingType)

ValueMeaning
INVOICEStandard invoice accounting type.
CORRECTIVE_TAXCorrective tax document accounting type.