Skip to content

Instantly share code, notes, and snippets.

@sperand-io
Forked from ruslandanilin/schema.json
Last active December 11, 2024 19:50
Show Gist options
  • Save sperand-io/b022398afe05affbc850d1896dec1f5c to your computer and use it in GitHub Desktop.
Save sperand-io/b022398afe05affbc850d1896dec1f5c to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CanonicalInvoice",
"description": "Represents a standardized invoice document that captures all essential billing information, line items, and related business documents. This schema defines the complete structure for representing commercial invoices in a canonical format.",
"type": "object",
"$defs": {
"Address": {
"title": "Address",
"description": "Physical location information including street address, city, state/region, postal code and country",
"type": "object",
"properties": {
"street": {
"title": "Street Address",
"description": "Street name, building number, and any additional address details (e.g., suite, floor)",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"123 Business Ave",
"Floor 4, Tower B"
]
},
"city": {
"title": "City",
"description": "Name of the city or municipality",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"San Francisco",
"London"
]
},
"state_region": {
"title": "State/Region/Province",
"description": "State, region, province, or territorial subdivision",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"CA",
"Ontario"
]
},
"postal_code": {
"title": "Postal Code",
"description": "ZIP code, postal code, or other regional delivery code",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"94105",
"SW1A 1AA"
]
},
"country": {
"title": "Country",
"description": "Country name or ISO country code",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"US",
"United Kingdom"
]
}
}
},
"ChargeType": {
"title": "ChargeType",
"description": "Categorizes additional charges or adjustments applied to line items or the overall invoice",
"type": "string",
"oneOf": [
{
"const": "freight",
"title": "Freight Charge",
"description": "Transportation and shipping costs including carrier fees, fuel surcharges, and delivery charges. May cover both domestic and international shipping expenses, customs fees, and special handling requirements for transportation."
},
{
"const": "handling",
"title": "Handling Charge",
"description": "Processing, packaging, and preparation fees. Includes warehouse operations, special packaging requirements, material costs, labor for order preparation, and any specific handling instructions or requirements."
},
{
"const": "misc",
"title": "Miscellaneous Charge",
"description": "Additional charges that don't fit into other categories. Can include administrative fees, documentation charges, certification costs, rush processing fees, or any other supplementary charges not covered by standard categories."
},
{
"const": "discount",
"title": "Discount",
"description": "Price reductions or promotional adjustments. Encompasses early payment discounts, volume discounts, promotional offers, loyalty rewards, or any other reduction in the standard pricing."
}
]
},
"Contact": {
"title": "Contact",
"description": "Information about an individual or department contact point",
"type": "object",
"properties": {
"name": {
"title": "Contact Name",
"description": "Full name of the contact person",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"John Smith",
"Accounts Payable Department"
]
},
"email": {
"title": "Email Address",
"description": "Primary email address for the contact",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"[email protected]",
"[email protected]"
]
},
"phone": {
"title": "Phone Number",
"description": "Contact telephone number including country/area codes if applicable",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"+1-555-123-4567",
"020 7123 4567"
]
},
"role": {
"title": "Role/Position",
"description": "Job title, department, or functional role of the contact",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Purchasing Manager",
"Accounts Payable Specialist"
]
},
"note": {
"title": "Additional Notes",
"description": "Supplementary information about the contact or their role",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Preferred contact for billing inquiries",
"Available 9AM-5PM EST"
]
}
}
},
"DocumentReferences": {
"title": "Document References",
"description": "Collection of related business documents and their identifiers that are associated with this invoice",
"type": "object",
"properties": {
"purchase_orders": {
"title": "Purchase Order References",
"description": "List of related purchase order numbers/identifiers",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": [],
"examples": [
[
"PO-2024-001",
"PO-2024-002"
]
]
},
"goods_receipts": {
"title": "Goods Receipt References",
"description": "List of related goods receipt document numbers",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": [],
"examples": [
[
"GR-2024-001",
"GR-2024-002"
]
]
},
"sales_orders": {
"title": "Sales Order References",
"description": "List of related sales order numbers",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": [],
"examples": [
[
"SO-2024-001",
"SO-2024-002"
]
]
},
"shipments": {
"title": "Shipment Details",
"description": "List of related shipment information including delivery notes and tracking",
"default": [],
"type": "array",
"items": {
"$ref": "#/$defs/ShipmentDetails"
}
},
"contracts": {
"title": "Contract References",
"description": "List of related contract or agreement numbers",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": [],
"examples": [
[
"CNT-2024-001",
"MSA-2023-456"
]
]
}
}
},
"InvoicePeriod": {
"title": "Invoice Period",
"description": "Time period covered by the invoice, typically used for recurring services or consolidated billing",
"type": "object",
"properties": {
"start": {
"title": "Period Start Date",
"description": "Start date and time of the billing period",
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"2024-01-01T00:00:00Z"
]
},
"end": {
"title": "Period End Date",
"description": "End date and time of the billing period",
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"2024-01-31T23:59:59Z"
]
}
}
},
"LineItem": {
"title": "Invoice Line Item",
"description": "Individual billable item on the invoice, including product details, quantities, pricing, and related references",
"type": "object",
"required": [
"total_amount"
],
"properties": {
"line_number": {
"title": "Line Item Number",
"description": "Sequential or reference number for the line item within the invoice",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"1",
"LINE-001"
]
},
"type": {
"title": "Line Item Type",
"description": "Categorization of the line item (e.g., product, service, fee)",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"product",
"service",
"subscription"
]
},
"description": {
"title": "Item Description",
"description": "Detailed description of the product or service being billed",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Professional Services - January 2024",
"Widget Model XYZ-123"
]
},
"unit_price": {
"title": "Unit Price",
"description": "Price per unit of the item",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"title": "Quantity Information",
"description": "Amount ordered/delivered and unit of measure",
"$ref": "#/$defs/LineItemQuantity",
"default": {
"invoiced": null,
"unit_of_measure": null
}
},
"sub_total": {
"title": "Subtotal Amount",
"description": "Line item total before taxes and additional charges",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"taxable_amount": {
"title": "Taxable Amount",
"description": "Amount subject to tax calculations",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"taxes": {
"title": "Applied Taxes",
"description": "List of tax calculations applied to this line item",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/$defs/Tax"
}
},
{
"type": "null"
}
],
"default": []
},
"charges": {
"title": "Additional Charges",
"description": "List of additional fees or adjustments applied to this line item",
"type": "array",
"items": {
"$ref": "#/$defs/LineItemCharges"
},
"default": []
},
"total_amount": {
"title": "Total Amount",
"description": "Final line item amount including all taxes and charges",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
]
},
"references": {
"title": "Line Item References",
"description": "Related document references specific to this line item",
"$ref": "#/$defs/LineItemReferences",
"default": {
"po_number": null,
"po_line_number": null,
"delivery_note": null,
"packing_slip_number": null,
"movement_control_id": null,
"tracking_number": null,
"contract_number": null,
"goods_receipt_number": null,
"goods_receipt_line_number": null
}
},
"product": {
"title": "Product Information",
"description": "Detailed product identification and description",
"$ref": "#/$defs/Product",
"default": {
"internal_material_number": null,
"internal_part_number": null,
"external_material_number": null,
"external_part_number": null,
"commodity_code": null,
"description": null
}
},
"cost_center_code": {
"title": "Cost Center Code",
"description": "Accounting cost center or department code for allocation",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"CC-001",
"DEPT-123"
]
},
"custom_attributes": {
"title": "Custom Fields",
"description": "Additional custom key-value pairs specific to the line item",
"anyOf": [
{
"type": "object"
},
{
"type": "null"
}
],
"default": {},
"examples": [
{
"projectCode": "PRJ-001",
"customerId": "CUST-123"
}
]
}
}
},
"LineItemCharges": {
"title": "Line Item Additional Charges",
"description": "Additional fees or adjustments applied to a specific line item",
"type": "object",
"properties": {
"charge_type": {
"title": "Charge Type",
"description": "Category of the additional charge",
"anyOf": [
{
"$ref": "#/$defs/ChargeType"
},
{
"type": "null"
}
],
"default": null
},
"amount": {
"title": "Charge Amount",
"description": "Monetary value of the additional charge",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
}
}
},
"LineItemQuantity": {
"title": "Line Item Quantity",
"description": "Quantity information for a line item including amount and unit of measure",
"type": "object",
"properties": {
"invoiced": {
"title": "Invoiced Quantity",
"description": "Number of units being billed",
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
5,
"5.5",
"10"
]
},
"unit_of_measure": {
"title": "Unit of Measure",
"description": "Standard unit used for quantity measurement",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"EA",
"KG",
"HOURS"
]
}
}
},
"LineItemReferences": {
"title": "Line Item Document References",
"description": "Collection of related document references specific to a line item",
"type": "object",
"properties": {
"po_number": {
"title": "Purchase Order Number",
"description": "Reference to associated purchase order",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"PO-2024-001"
]
},
"po_line_number": {
"title": "Purchase Order Line Number",
"description": "Specific line number from referenced purchase order",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"1",
"LINE-001"
]
},
"delivery_note": {
"title": "Delivery Note Number",
"description": "Reference to associated delivery documentation",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"DN-2024-001"
]
},
"packing_slip_number": {
"title": "Packing Slip Number",
"description": "Reference to associated packing slip",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"PS-2024-001"
]
},
"movement_control_id": {
"title": "Movement Control ID",
"description": "Internal reference for goods movement tracking",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"MOV-2024-001"
]
},
"tracking_number": {
"title": "Tracking Number",
"description": "Carrier-provided shipment tracking identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"1Z999AA1234567890"
]
},
"contract_number": {
"title": "Contract Number",
"description": "Reference to associated contract or agreement",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"CNT-2024-001"
]
},
"goods_receipt_number": {
"title": "Goods Receipt Number",
"description": "Reference to associated goods receipt document",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"GR-2024-001"
]
},
"goods_receipt_line_number": {
"title": "Goods Receipt Line Number",
"description": "Specific line number from referenced goods receipt",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"1",
"LINE-001"
]
}
}
},
"Money": {
"title": "Money",
"description": "Monetary amount with currency specification",
"type": "object",
"properties": {
"amount": {
"title": "Amount",
"description": "Numerical value of the monetary amount",
"anyOf": [
{
"type": "number"
},
{
"type": "string"
}
],
"default": "0",
"examples": [
100.5,
"100.50"
]
},
"currency": {
"title": "Currency Code",
"description": "ISO 4217 currency code or custom currency identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"USD",
"EUR",
"GBP"
]
}
}
},
"Party": {
"title": "Business Party",
"description": "Details of a business entity involved in the transaction (buyer, seller, shipper, etc.)",
"type": "object",
"properties": {
"code": {
"title": "Party Code",
"description": "Internal identifier or reference code for the business party",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"VEND-001",
"CUST-123"
]
},
"name": {
"title": "Party Name",
"description": "Legal or trading name of the business entity",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Acme Corporation",
"Global Services Ltd"
]
},
"tax_registration_id": {
"title": "Tax Registration ID",
"description": "Tax identification number or VAT registration number",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"GB123456789",
"DE987654321"
]
},
"address": {
"title": "Party Address",
"description": "Physical location or registered address",
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"contacts": {
"title": "Contact Persons",
"description": "List of contact individuals or departments",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/$defs/Contact"
}
},
{
"type": "null"
}
],
"default": []
}
}
},
"PaymentTerm": {
"title": "Payment Terms",
"description": "Payment conditions including due dates and available discounts",
"type": "object",
"properties": {
"description": {
"title": "Terms Description",
"description": "Human-readable description of payment terms",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"2% 10 Net 30",
"Net 45 days"
]
},
"discount_due_days": {
"title": "Discount Due Days",
"description": "Number of days to pay to qualify for early payment discount",
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"examples": [
10,
15
]
},
"discount_percent": {
"title": "Discount Percentage",
"description": "Percentage discount offered for early payment",
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"examples": [
2,
1.5
]
},
"net_due_days": {
"title": "Net Due Days",
"description": "Number of days until full payment is due",
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"examples": [
30,
45,
60
]
}
}
},
"PaymentToInfo": {
"title": "Payment Information",
"description": "Banking and remittance details for processing payment",
"type": "object",
"properties": {
"payment_method": {
"title": "Payment Method",
"description": "Requested or required payment method",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"ACH",
"WIRE",
"CHECK"
]
},
"account_number": {
"title": "Account Number",
"description": "Bank account number or payment account identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"****1234"
]
},
"financial_institution": {
"title": "Financial Institution",
"description": "Name of bank or financial institution",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"First National Bank"
]
},
"financial_institution_address": {
"title": "Bank Address",
"description": "Physical address of the financial institution",
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"remittance_to": {
"title": "Remittance Contacts",
"description": "Contact information for payment-related queries",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/$defs/Contact"
}
},
{
"type": "null"
}
],
"default": []
}
}
},
"Product": {
"title": "Product Information",
"description": "Detailed product identification and classification",
"type": "object",
"properties": {
"internal_material_number": {
"title": "Internal Material Number",
"description": "Buyer's internal material or product identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"MAT-001"
]
},
"internal_part_number": {
"title": "Internal Part Number",
"description": "Buyer's internal part number reference",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"PART-001"
]
},
"external_material_number": {
"title": "External Material Number",
"description": "Supplier's material or product identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"SUP-MAT-001"
]
},
"external_part_number": {
"title": "External Part Number",
"description": "Supplier's part number reference",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"SUP-PART-001"
]
},
"commodity_code": {
"title": "Commodity Code",
"description": "Standard classification code (e.g., HS Code, UNSPSC)",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"85167100"
]
},
"description": {
"title": "Product Description",
"description": "Detailed description of the product",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"High-Performance Widget Model X"
]
}
}
},
"ShipmentDetails": {
"title": "Shipment Information",
"description": "Details about the delivery and transportation of goods",
"type": "object",
"properties": {
"bill_of_lading_number": {
"title": "Bill of Lading Number",
"description": "Transportation document identifier",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"BOL-2024-001"
]
},
"delivery_note": {
"title": "Delivery Note",
"description": "Reference to delivery documentation",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"DN-2024-001"
]
},
"packing_slip_number": {
"title": "Packing Slip Number",
"description": "Reference to packing documentation",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"PS-2024-001"
]
},
"actual_delivery_date": {
"title": "Actual Delivery Date",
"description": "Date and time when goods were delivered",
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"2024-01-15T14:30:00Z"
]
},
"delivery_address": {
"title": "Delivery Address",
"description": "Location where goods were delivered",
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"reference_contact": {
"title": "Reference Contact",
"description": "Contact person for delivery-related queries",
"anyOf": [
{
"$ref": "#/$defs/Contact"
},
{
"type": "null"
}
],
"default": null
}
}
},
"Tax": {
"title": "Tax Information",
"description": "Details of tax calculations and applications",
"type": "object",
"properties": {
"amount": {
"title": "Tax Amount",
"description": "Calculated tax value",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"title": "Tax Code",
"description": "Identifier for tax category or rate",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"VAT",
"GST"
]
},
"rate": {
"title": "Tax Rate",
"description": "Percentage rate applied for tax calculation",
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"examples": [
20,
7.5
]
},
"country": {
"title": "Tax Country",
"description": "Country where tax is applicable",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"GB",
"DE"
]
},
"type": {
"title": "Tax Type",
"description": "Category or classification of tax",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Sales Tax",
"Value Added Tax"
]
},
"description": {
"title": "Tax Description",
"description": "Additional details about the tax application",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"Standard Rate VAT",
"Reduced Rate GST"
]
}
}
},
"Totals": {
"title": "Invoice Totals",
"description": "Summary of all monetary amounts on the invoice",
"type": "object",
"properties": {
"gross_amount": {
"title": "Gross Amount",
"description": "Total amount before adjustments and taxes",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"tax_amount": {
"title": "Tax Amount",
"description": "Total of all taxes applied",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"net_amount": {
"title": "Net Amount",
"description": "Final amount after all adjustments and taxes",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"handling_amount": {
"title": "Handling Amount",
"description": "Total handling charges",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"freight_amount": {
"title": "Freight Amount",
"description": "Total shipping and transportation charges",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"discount_amount": {
"title": "Discount Amount",
"description": "Total discounts and deductions applied",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"misc_amount": {
"title": "Miscellaneous Amount",
"description": "Total of other charges not falling into standard categories",
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
}
}
}
},
"properties": {
"bill_to": {
"title": "Bill-to Party",
"description": "Entity responsible for paying the invoice",
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"ship_to": {
"title": "Ship-to Party",
"description": "Entity receiving the goods or services",
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"remit_to": {
"title": "Remit-to Party",
"description": "Entity to whom payment should be made",
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"counterparty": {
"title": "Counterparty",
"description": "Trading partner (typically the supplier/vendor)",
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"invoice_number": {
"title": "Invoice Number",
"description": "Unique identifier for the invoice document",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"INV-2024-001"
]
},
"invoice_date": {
"title": "Invoice Date",
"description": "Date when the invoice was issued",
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"2024-01-15T00:00:00Z"
]
},
"invoice_period": {
"title": "Invoice Period",
"description": "Time period covered by the invoice",
"anyOf": [
{
"$ref": "#/$defs/InvoicePeriod"
},
{
"type": "null"
}
],
"default": null
},
"document_type": {
"title": "Document Type",
"description": "Classification of invoice document (e.g., standard, credit memo, debit memo)",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"INVOICE",
"CREDIT_MEMO"
]
},
"currency": {
"title": "Invoice Currency",
"description": "Primary currency for all monetary amounts",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"USD",
"EUR",
"GBP"
]
},
"shipping_terms": {
"title": "Shipping Terms",
"description": "Terms and conditions for shipping (e.g., FOB, CIF)",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"FOB DESTINATION",
"EXW"
]
},
"payment_terms": {
"title": "Payment Terms",
"description": "Terms and conditions for payment",
"anyOf": [
{
"type": "array",
"items": {
"$ref": "#/$defs/PaymentTerm"
}
},
{
"type": "null"
}
],
"default": null
},
"payment_info": {
"title": "Payment Information",
"description": "Banking and remittance details",
"anyOf": [
{
"$ref": "#/$defs/PaymentToInfo"
},
{
"type": "null"
}
],
"default": null
},
"line_items": {
"title": "Line Items",
"description": "Individual billable items on the invoice",
"type": "array",
"items": {
"$ref": "#/$defs/LineItem"
},
"default": []
},
"totals": {
"title": "Invoice Totals",
"description": "Summary of all monetary amounts",
"$ref": "#/$defs/Totals",
"default": {
"gross_amount": null,
"tax_amount": null,
"net_amount": null,
"handling_amount": null,
"freight_amount": null,
"discount_amount": null,
"misc_amount": null
}
},
"references": {
"title": "Document References",
"description": "Related business document references",
"$ref": "#/$defs/DocumentReferences",
"default": {
"purchase_orders": [],
"goods_receipts": [],
"sales_orders": [],
"shipments": [],
"contracts": []
}
},
"custom_attributes": {
"title": "Custom Attributes",
"description": "Additional custom key-value pairs for the invoice",
"type": "object",
"default": {},
"examples": [
{
"departmentCode": "DEPT-001",
"projectNumber": "PRJ-2024-001"
}
]
},
"notes": {
"title": "Invoice Notes",
"description": "Additional textual information or instructions",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": [],
"examples": [
[
"Please reference invoice number in payment",
"Tax exempt per certificate #12345"
]
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment