{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/conduyt-com/json-schema/conduyt-com-invoice-create-schema.json",
  "title": "InvoiceCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/conduyt-com-invoices-api-openapi.yml#/components/schemas/InvoiceCreate",
  "type": "object",
  "required": [
    "items"
  ],
  "properties": {
    "invoiceNumber": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Optional; generated when omitted. 1 to 200 characters."
    },
    "contactId": {
      "type": "string",
      "format": "uuid"
    },
    "companyId": {
      "type": "string",
      "format": "uuid"
    },
    "dealId": {
      "type": "string",
      "format": "uuid"
    },
    "dueDate": {
      "type": "string",
      "format": "date-time"
    },
    "taxRate": {
      "type": "number",
      "format": "double"
    },
    "currency": {
      "type": "string",
      "default": "USD"
    },
    "notes": {
      "type": "string"
    },
    "terms": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "unitPrice"
        ],
        "properties": {
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unitPrice": {
            "type": "number"
          },
          "sortOrder": {
            "description": "Read by the handler from the JSON body (the route declares no schema for its type)."
          }
        }
      }
    }
  }
}