{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mynto-no/json-schema/mynto-no-publicapi-invoice-schema.json",
  "title": "publicapi.Invoice",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mynto-no-openapi.yml#/components/schemas/publicapi.Invoice",
  "properties": {
    "customerId": {
      "format": "int64",
      "type": "integer"
    },
    "dueDate": {
      "type": "string"
    },
    "grossMinor": {
      "format": "int64",
      "type": "integer"
    },
    "id": {
      "format": "int64",
      "type": "integer"
    },
    "issueDate": {
      "type": "string"
    },
    "kid": {
      "type": "string"
    },
    "kind": {
      "title": "Kind: invoice | credit_note.\n",
      "type": "string"
    },
    "lines": {
      "items": {
        "$ref": "#/$defs/publicapi.InvoiceLine"
      },
      "type": "array"
    },
    "netMinor": {
      "format": "int64",
      "type": "integer"
    },
    "number": {
      "description": "it is still a draft).\n",
      "format": "int64",
      "title": "Number is the invoice number, assigned when the invoice is sent (0 while\n",
      "type": "integer"
    },
    "status": {
      "title": "Status: draft | sent | paid | overdue | credited.\n",
      "type": "string"
    },
    "vatMinor": {
      "format": "int64",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "customerId",
    "number",
    "kind",
    "status",
    "issueDate",
    "dueDate",
    "netMinor",
    "vatMinor",
    "grossMinor",
    "kid",
    "lines"
  ],
  "type": "object",
  "$defs": {
    "publicapi.InvoiceLine": {
      "properties": {
        "description": {
          "type": "string"
        },
        "quantity": {
          "type": "number"
        },
        "unitCode": {
          "title": "UnitCode is a UN/ECE rec 20 unit, e.g. EA (each), HUR (hour).\n",
          "type": "string"
        },
        "unitPriceMinor": {
          "format": "int64",
          "type": "integer"
        },
        "vatRate": {
          "format": "int64",
          "title": "VATRate is the MVA percentage: 0, 12, 15 or 25.\n",
          "type": "integer"
        }
      },
      "required": [
        "description",
        "quantity",
        "unitPriceMinor",
        "vatRate",
        "unitCode"
      ],
      "type": "object"
    }
  }
}