{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Invoice data",
  "type": "object",
  "properties": {
    "invoiceNumber": {
      "type": "string",
      "title": "Invoice number",
      "examples": [
        "INV-2026-0001"
      ]
    },
    "invoiceDate": {
      "type": "string",
      "format": "date",
      "title": "Invoice date",
      "examples": [
        "2026-10-21"
      ]
    },
    "dueDate": {
      "type": "string",
      "format": "date",
      "title": "Due date",
      "examples": [
        "2026-11-20"
      ]
    },
    "poNumber": {
      "type": "string",
      "title": "PO number",
      "examples": [
        "PO-4401"
      ]
    },
    "terms": {
      "type": "string",
      "title": "Terms",
      "examples": [
        "Net 30"
      ]
    },
    "company": {
      "type": "object",
      "title": "Company",
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "examples": [
            "Summit Fulfillment Co."
          ]
        },
        "address1": {
          "type": "string",
          "title": "Street",
          "examples": [
            "4100 Commerce Pkwy, Building C"
          ]
        },
        "city": {
          "type": "string",
          "title": "City",
          "examples": [
            "Atlanta"
          ]
        },
        "state": {
          "type": "string",
          "title": "State",
          "examples": [
            "GA"
          ]
        },
        "postalCode": {
          "type": "string",
          "title": "ZIP code",
          "examples": [
            "30336"
          ]
        }
      }
    },
    "billTo": {
      "type": "object",
      "title": "Bill to",
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "examples": [
            "Northwind Retail #1187"
          ]
        },
        "address1": {
          "type": "string",
          "title": "Street",
          "examples": [
            "2250 Lakeshore Blvd"
          ]
        },
        "city": {
          "type": "string",
          "title": "City",
          "examples": [
            "Columbus"
          ]
        },
        "state": {
          "type": "string",
          "title": "State",
          "examples": [
            "OH"
          ]
        },
        "postalCode": {
          "type": "string",
          "title": "ZIP code",
          "examples": [
            "43215"
          ]
        }
      }
    },
    "lines": {
      "type": "array",
      "title": "Line items",
      "items": {
        "type": "object",
        "properties": {
          "sku": {
            "type": "string",
            "title": "SKU",
            "examples": [
              "APP-TS-1001"
            ]
          },
          "description": {
            "type": "string",
            "title": "Description",
            "examples": [
              "Organic cotton crew tee, navy, M"
            ]
          },
          "qty": {
            "type": "integer",
            "title": "Quantity",
            "examples": [
              12
            ]
          },
          "unitPrice": {
            "type": "number",
            "title": "Unit price",
            "examples": [
              9.7
            ]
          },
          "amount": {
            "type": "number",
            "title": "Amount (qty x unit price)",
            "examples": [
              116.4
            ]
          }
        }
      }
    },
    "totals": {
      "type": "object",
      "title": "Totals",
      "properties": {
        "subtotal": {
          "type": "number",
          "title": "Subtotal",
          "examples": [
            1250.5
          ]
        },
        "taxRate": {
          "type": "number",
          "title": "Tax rate (0.07 = 7%)",
          "examples": [
            0.07
          ]
        },
        "tax": {
          "type": "number",
          "title": "Tax",
          "examples": [
            87.54
          ]
        },
        "shipping": {
          "type": "number",
          "title": "Shipping",
          "examples": [
            25
          ]
        },
        "total": {
          "type": "number",
          "title": "Total due",
          "examples": [
            1363.04
          ]
        }
      }
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "title": "Notes",
      "examples": [
        "Thank you for your business."
      ]
    }
  }
}
