CommercialDocument

Base schema for all commercial documents (invoices, quotes, delivery notes, orders, credit notes, etc.) - universal across all countries and business types. This schema uses intentional denormalization for addresses to maintain point-in-time historical accuracy.

49 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
documentNumberstring
stored

Unique document number/reference

Example: "DOC-2024-001"

Required
documentTypeDocumentType
stored

Type of document (reference to DocumentType entity)

Required
statusstring
enum

Current status of the document in its lifecycle

Example: "sent"

Required
versionnumber
stored

Version number of this document (1 for original, incremented for revisions)

Example: 1

Required
previousVersionCommercialDocument
stored

Reference to the previous version if this is a revision

Optional
revisionReasonstring
stored

Reason for creating this revision (if applicable)

Optional
issueDateDate
stored

Date when the document was issued

Example: "2024-01-15"

Required
validUntilDate
stored

Validity date (typically used for quotes and offers)

Example: "2024-02-15"

Optional
dueDateDate
stored

Payment due date (for invoices) - if not set, computed from issueDate and paymentTerms

Example: "2024-02-15"

Optional
deliveryDateDate
stored

Actual or expected delivery date (for orders and delivery notes)

Optional
issuerOrganization
stored

Organization issuing the document (seller/supplier)

Required
issuerNamestring
stored

Cached name of issuer organization for quick display and historical accuracy

Example: "Acme Corp"

Optional
recipientOrganization | Person
stored

Recipient of the document (buyer/customer)

Required
recipientNamestring
stored

Cached name of recipient (organization or person) for quick display and historical accuracy

Example: "Client Company"

Optional
billingAddressPostalAddress
stored

Billing address at the time of document issuance (snapshot from recipient entity for point-in-time historical accuracy)

Required
shippingAddressPostalAddress
stored

Shipping/delivery address at the time of document issuance (snapshot for point-in-time historical accuracy)

Optional
lineItemsCommercialDocumentLine[]
stored

Line items/products in the document (composition relationship - line items are part of the document lifecycle)

Optional
lineItemCountnumber
computed

Number of line items in this document (computed from lineItems.length)

Optional
currencyCurrency
stored

Currency used throughout this document - all monetary amounts must use this currency

Required
languageLanguage
stored

Language of the document content (for internationalization)

Example: "en"

Optional
localestring
stored

Locale for number and date formatting (e.g., 'en-US', 'fr-FR', 'de-DE')

Example: "en-US"

Optional
subtotalAmountMonetaryAmount
computed

Sum of all line items before taxes and discounts (computed: sum of lineItems[].quantity * lineItems[].unitPrice)

Optional
discountPercentagenumber
stored

Discount percentage applied to the entire document (alternative to discountAmount)

Example: 5

Optional
discountAmountMonetaryAmount
stored

Fixed discount amount applied to the entire document (alternative to discountPercentage)

Optional
discountReasonstring
stored

Reason for discount (early payment, bulk order, promotion, customer loyalty, etc.)

Example: "Early payment discount"

Optional
taxAmountMonetaryAmount
computed

Total tax amount across all line items (computed: sum of taxes from lineItems)

Optional
taxDetailsTaxEntry[]
computed

Breakdown of taxes by rate and jurisdiction (computed from line items, grouped by tax rate)

Optional
isTaxExemptboolean
stored

Whether this document is exempt from taxes

Optional
taxExemptionReasonstring
stored

Reason for tax exemption (if applicable)

Optional
totalAmountMonetaryAmount
computed

Final total amount (computed: subtotalAmount + taxAmount - discountAmount). For finalized documents, this value is cached.

Required
amountPaidMonetaryAmount
computed

Total amount paid so far (computed from related payment records)

Optional
balanceDueMonetaryAmount
computed

Remaining amount to be paid (computed: totalAmount - amountPaid)

Optional
isOverdueboolean
computed

Whether payment is past due date (computed: current date > dueDate and balanceDue > 0)

Optional
totalsLockedboolean
stored

Whether computed totals have been calculated and locked (true for finalized documents beyond draft status)

Optional
paymentTermsPaymentTerm
stored

Payment terms and conditions (reference to PaymentTerm entity)

Optional
deliveryMethodstring
enum

Shipping/delivery method

Optional
trackingNumberstring
stored

Shipping tracking number (if applicable)

Optional
carrierOrganization
stored

Shipping carrier organization (reference to carrier/logistics company)

Optional
notesstring
stored

Additional notes or comments

Optional
internalNotesstring
stored

Internal notes not visible to recipient

Optional
termsAndConditionsstring
stored

Terms and conditions text applicable to this document

Optional
relatedDocumentsCommercialDocument[]
stored

Related documents in the transaction chain (quote -> order -> invoice -> credit note). Note: For complex relationship tracking, consider using a separate CommercialDocumentRelation junction entity.

Optional
attachmentsDocument[]
stored

Attached files (PDF, images, supporting documents, etc.) - references to Document entity

Optional
legalEntityOrganization
stored

Legal entity responsible for this document (may differ from issuer for multi-entity organizations)

Optional
fiscalYearnumber
stored

Fiscal year this document belongs to

Example: 2024

Optional
fiscalPeriodstring
stored

Fiscal period within the year (Q1, Q2, Q3, Q4, or month)

Example: "Q1"

Optional
approvedByPerson
stored

Person who approved this document (if approval is required)

Optional
approvedDateDate
stored

Date when this document was approved

Optional
metadataobject
stored

Country-specific, industry-specific, or custom fields for extensibility

Optional

Examples

Example 1

{
  "@type": "CommercialDocument",
  "documentNumber": "INV-2024-001",
  "documentType": {
    "@type": "DocumentType",
    "code": "invoice",
    "name": "Invoice"
  },
  "status": "sent",
  "version": 1,
  "issueDate": "2024-01-15",
  "dueDate": "2024-02-15",
  "issuer": {
    "@type": "Organization",
    "name": "Acme Corp"
  },
  "issuerName": "Acme Corp",
  "recipient": {
    "@type": "Organization",
    "name": "Client Company"
  },
  "recipientName": "Client Company",
  "billingAddress": {
    "@type": "PostalAddress",
    "streetAddress": "456 Client Street",
    "addressLocality": "New York",
    "addressRegion": "NY",
    "postalCode": "10001",
    "addressCountry": "US"
  },
  "lineItems": [
    {
      "@type": "CommercialDocumentLine",
      "lineNumber": 1,
      "description": "Professional Services - Consulting",
      "quantity": 10,
      "unitPrice": {
        "@type": "MonetaryAmount",
        "value": 150,
        "currency": {
          "@type": "Currency",
          "code": "USD",
          "symbol": "$"
        }
      },
      "taxRate": 10
    }
  ],
  "lineItemCount": 1,
  "currency": {
    "@type": "Currency",
    "code": "USD",
    "symbol": "$"
  },
  "language": "en",
  "locale": "en-US",
  "subtotalAmount": {
    "@type": "MonetaryAmount",
    "value": 1500,
    "currency": "USD"
  },
  "taxAmount": {
    "@type": "MonetaryAmount",
    "value": 150,
    "currency": "USD"
  },
  "totalAmount": {
    "@type": "MonetaryAmount",
    "value": 1650,
    "currency": "USD"
  },
  "balanceDue": {
    "@type": "MonetaryAmount",
    "value": 1650,
    "currency": "USD"
  },
  "amountPaid": {
    "@type": "MonetaryAmount",
    "value": 0,
    "currency": "USD"
  },
  "isOverdue": false,
  "totalsLocked": true,
  "fiscalYear": 2024,
  "fiscalPeriod": "Q1"
}

Example 2

{
  "@type": "CommercialDocument",
  "documentNumber": "QUOTE-2024-042",
  "documentType": {
    "@type": "DocumentType",
    "code": "quote",
    "name": "Quotation"
  },
  "status": "sent",
  "version": 1,
  "issueDate": "2024-03-01",
  "validUntil": "2024-03-31",
  "issuer": {
    "@type": "Organization",
    "name": "Tech Solutions Inc"
  },
  "issuerName": "Tech Solutions Inc",
  "recipient": {
    "@type": "Person",
    "givenName": "John",
    "familyName": "Smith"
  },
  "recipientName": "John Smith",
  "billingAddress": {
    "@type": "PostalAddress",
    "streetAddress": "789 Customer Ave",
    "addressLocality": "Boston",
    "addressRegion": "MA",
    "postalCode": "02115",
    "addressCountry": "US"
  },
  "shippingAddress": {
    "@type": "PostalAddress",
    "streetAddress": "789 Customer Ave",
    "addressLocality": "Boston",
    "addressRegion": "MA",
    "postalCode": "02115",
    "addressCountry": "US"
  },
  "lineItems": [
    {
      "@type": "CommercialDocumentLine",
      "lineNumber": 1,
      "description": "Website Development",
      "quantity": 1,
      "unitPrice": {
        "@type": "MonetaryAmount",
        "value": 5000,
        "currency": {
          "@type": "Currency",
          "code": "USD",
          "symbol": "$"
        }
      },
      "taxRate": 10
    }
  ],
  "lineItemCount": 1,
  "currency": {
    "@type": "Currency",
    "code": "USD",
    "symbol": "$"
  },
  "language": "en",
  "locale": "en-US",
  "subtotalAmount": {
    "@type": "MonetaryAmount",
    "value": 5000,
    "currency": "USD"
  },
  "discountPercentage": 10,
  "discountAmount": {
    "@type": "MonetaryAmount",
    "value": 500,
    "currency": "USD"
  },
  "discountReason": "First-time customer discount",
  "taxAmount": {
    "@type": "MonetaryAmount",
    "value": 450,
    "currency": "USD"
  },
  "totalAmount": {
    "@type": "MonetaryAmount",
    "value": 4950,
    "currency": "USD"
  },
  "totalsLocked": true,
  "notes": "This quote is valid for 30 days. Payment terms: 50% upfront, 50% upon completion.",
  "fiscalYear": 2024,
  "fiscalPeriod": "Q1"
}