Skip to content

Instantly share code, notes, and snippets.

@ruslandanilin
Last active December 11, 2024 19:40
Show Gist options
  • Save ruslandanilin/606be78914064bc0b26c0e47f5bb3100 to your computer and use it in GitHub Desktop.
Save ruslandanilin/606be78914064bc0b26c0e47f5bb3100 to your computer and use it in GitHub Desktop.
{
"$defs": {
"Address": {
"properties": {
"street": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Street"
},
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "City"
},
"state_region": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State Region"
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Postal Code"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
}
},
"title": "Address",
"type": "object"
},
"ChargeType": {
"enum": [
"freight",
"handling",
"misc",
"discount"
],
"title": "ChargeType",
"type": "string"
},
"Contact": {
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Email"
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phone"
},
"role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Role"
},
"note": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Note"
}
},
"title": "Contact",
"type": "object"
},
"DocumentReferences": {
"properties": {
"purchase_orders": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Purchase Orders"
},
"goods_receipts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Goods Receipts"
},
"sales_orders": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Sales Orders"
},
"shipments": {
"default": [],
"items": {
"$ref": "#/$defs/ShipmentDetails"
},
"title": "Shipments",
"type": "array"
},
"contracts": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Contracts"
}
},
"title": "DocumentReferences",
"type": "object"
},
"InvoicePeriod": {
"properties": {
"start": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Start"
},
"end": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "End"
}
},
"title": "InvoicePeriod",
"type": "object"
},
"LineItem": {
"properties": {
"line_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Line Number"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Type"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"unit_price": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"$ref": "#/$defs/LineItemQuantity",
"default": {
"invoiced": null,
"unit_of_measure": null
}
},
"sub_total": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"taxable_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"taxes": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Tax"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Taxes"
},
"charges": {
"default": [],
"items": {
"$ref": "#/$defs/LineItemCharges"
},
"title": "Charges",
"type": "array"
},
"total_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
]
},
"references": {
"$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": {
"$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": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cost Center Code"
},
"custom_attributes": {
"anyOf": [
{
"type": "object"
},
{
"type": "null"
}
],
"default": {},
"title": "Custom Attributes"
}
},
"required": [
"total_amount"
],
"title": "LineItem",
"type": "object"
},
"LineItemCharges": {
"properties": {
"charge_type": {
"anyOf": [
{
"$ref": "#/$defs/ChargeType"
},
{
"type": "null"
}
],
"default": null
},
"amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "LineItemCharges",
"type": "object"
},
"LineItemQuantity": {
"properties": {
"invoiced": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Invoiced"
},
"unit_of_measure": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unit Of Measure"
}
},
"title": "LineItemQuantity",
"type": "object"
},
"LineItemReferences": {
"properties": {
"po_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Po Number"
},
"po_line_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Po Line Number"
},
"delivery_note": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Delivery Note"
},
"packing_slip_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Packing Slip Number"
},
"movement_control_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Movement Control Id"
},
"tracking_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Tracking Number"
},
"contract_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Contract Number"
},
"goods_receipt_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Goods Receipt Number"
},
"goods_receipt_line_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Goods Receipt Line Number"
}
},
"title": "LineItemReferences",
"type": "object"
},
"Money": {
"properties": {
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
}
],
"default": "0",
"title": "Amount"
},
"currency": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Currency"
}
},
"title": "Money",
"type": "object"
},
"Party": {
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Code"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"tax_registration_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Tax Registration Id"
},
"address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"contacts": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Contact"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Contacts"
}
},
"title": "Party",
"type": "object"
},
"PaymentTerm": {
"properties": {
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"discount_due_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Discount Due Days"
},
"discount_percent": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Discount Percent"
},
"net_due_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Net Due Days"
}
},
"title": "PaymentTerm",
"type": "object"
},
"PaymentToInfo": {
"properties": {
"payment_method": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Payment Method"
},
"account_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Account Number"
},
"financial_institution": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Financial Institution"
},
"financial_institution_address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"remittance_to": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/Contact"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Remittance To"
}
},
"title": "PaymentToInfo",
"type": "object"
},
"Product": {
"properties": {
"internal_material_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Internal Material Number"
},
"internal_part_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Internal Part Number"
},
"external_material_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "External Material Number"
},
"external_part_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "External Part Number"
},
"commodity_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Commodity Code"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
}
},
"title": "Product",
"type": "object"
},
"ShipmentDetails": {
"properties": {
"bill_of_lading_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Bill Of Lading Number"
},
"delivery_note": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Delivery Note"
},
"packing_slip_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Packing Slip Number"
},
"actual_delivery_date": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Actual Delivery Date"
},
"delivery_address": {
"anyOf": [
{
"$ref": "#/$defs/Address"
},
{
"type": "null"
}
],
"default": null
},
"reference_contact": {
"anyOf": [
{
"$ref": "#/$defs/Contact"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "ShipmentDetails",
"type": "object"
},
"Tax": {
"properties": {
"amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Code"
},
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"title": "Rate"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Country"
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Type"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
}
},
"title": "Tax",
"type": "object"
},
"Totals": {
"properties": {
"gross_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"tax_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"net_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"handling_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"freight_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"discount_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
},
"misc_amount": {
"anyOf": [
{
"$ref": "#/$defs/Money"
},
{
"type": "null"
}
],
"default": null
}
},
"title": "Totals",
"type": "object"
}
},
"properties": {
"bill_to": {
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"ship_to": {
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"remit_to": {
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"counterparty": {
"anyOf": [
{
"$ref": "#/$defs/Party"
},
{
"type": "null"
}
],
"default": null
},
"invoice_number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Invoice Number"
},
"invoice_date": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Invoice Date"
},
"invoice_period": {
"anyOf": [
{
"$ref": "#/$defs/InvoicePeriod"
},
{
"type": "null"
}
],
"default": null
},
"document_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Document Type"
},
"currency": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Currency"
},
"shipping_terms": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Shipping Terms"
},
"payment_terms": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/PaymentTerm"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Payment Terms"
},
"payment_info": {
"anyOf": [
{
"$ref": "#/$defs/PaymentToInfo"
},
{
"type": "null"
}
],
"default": null
},
"line_items": {
"default": [],
"items": {
"$ref": "#/$defs/LineItem"
},
"title": "Line Items",
"type": "array"
},
"totals": {
"$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": {
"$ref": "#/$defs/DocumentReferences",
"default": {
"purchase_orders": [],
"goods_receipts": [],
"sales_orders": [],
"shipments": [],
"contracts": []
}
},
"custom_attributes": {
"default": {},
"title": "Custom Attributes",
"type": "object"
},
"notes": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": [],
"title": "Notes"
}
},
"title": "CanonicalInvoice",
"type": "object"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment