{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quotebill-com/json-schema/quotebill-com-document-created-schema.json",
  "title": "DocumentCreated",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quotebill-com-openapi.yml#/components/schemas/DocumentCreated",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "editor_url": {
      "type": "string",
      "format": "uri",
      "description": "Opens the document in the editor, for the member."
    },
    "number": {
      "type": "string"
    },
    "totals": {
      "anyOf": [
        {
          "$ref": "#/$defs/Totals"
        },
        {
          "type": "null"
        }
      ],
      "description": "null for a document whose lines carry no prices."
    }
  },
  "required": [
    "id",
    "editor_url",
    "number",
    "totals"
  ],
  "additionalProperties": false,
  "$defs": {
    "Totals": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "subtotal": {
          "type": "number",
          "description": "The lines, each rounded to the currency, added up."
        },
        "tax_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "tax_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "description": "A percentage: 19 is 19%."
        },
        "tax_amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "total": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "tax_status": {
          "type": "string",
          "enum": [
            "calculated",
            "rate_needed"
          ],
          "description": "rate_needed: the country has no single national rate (the United States, Canada without a region). No tax and no total until tax_rate is sent."
        },
        "total_hours": {
          "type": "number",
          "description": "Only on an hours template: the quantities added up."
        }
      },
      "required": [
        "currency",
        "subtotal",
        "tax_name",
        "tax_rate",
        "tax_amount",
        "total",
        "tax_status"
      ],
      "additionalProperties": false,
      "description": "What the editor shows under the lines."
    }
  }
}