{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentaos-ai/json-schema/agentaos-ai-invoice-list-response-schema.json",
  "title": "InvoiceListResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentaos-ai-invoices-api-openapi.yml#/components/schemas/InvoiceListResponse",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Invoice"
      }
    },
    "total": {
      "type": "integer"
    },
    "hasMore": {
      "type": "boolean"
    }
  },
  "required": [
    "items",
    "total",
    "hasMore"
  ],
  "$defs": {
    "Invoice": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "invoice_number": {
          "type": "string",
          "description": "Human-readable, e.g. INV-2026-0142."
        },
        "transaction_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Linked settled transaction, once paid."
        },
        "session_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Linked checkout."
        },
        "amount": {
          "type": "number",
          "description": "Currency units."
        },
        "currency": {
          "type": "string"
        },
        "payment_token": {
          "type": "string",
          "description": "What the buyer paid (or will pay) with."
        },
        "status": {
          "type": "string",
          "enum": [
            "issued",
            "paid",
            "voided"
          ],
          "description": "issued (created, not yet paid), paid (payment settled), or voided."
        },
        "fiat_amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "EUR/USD equivalent, for stablecoin payments."
        },
        "fiat_currency": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "EUR",
            "USD",
            null
          ]
        },
        "exchange_rate": {
          "type": [
            "number",
            "null"
          ],
          "description": "Rate applied at settlement."
        },
        "exchange_rate_source": {
          "type": [
            "string",
            "null"
          ]
        },
        "tax_rate": {
          "type": [
            "number",
            "null"
          ],
          "description": "Applied rate, e.g. 19 for 19%."
        },
        "tax_amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Currency units."
        },
        "tax_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "e.g. DE VAT."
        },
        "tax_inclusive": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether amount already includes tax."
        },
        "merchant_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Seller name on the document."
        },
        "buyer_email": {
          "type": [
            "string",
            "null"
          ]
        },
        "buyer_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "buyer_company": {
          "type": [
            "string",
            "null"
          ]
        },
        "buyer_country": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO 3166-1 alpha-2."
        },
        "buyer_vat": {
          "type": [
            "string",
            "null"
          ]
        },
        "tx_hash": {
          "type": [
            "string",
            "null"
          ],
          "description": "On-chain hash, for crypto payments."
        },
        "issued_at": {
          "type": "string",
          "format": "date-time"
        },
        "voided_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "invoice_number",
        "transaction_id",
        "session_id",
        "amount",
        "currency",
        "payment_token",
        "status",
        "fiat_amount",
        "fiat_currency",
        "exchange_rate",
        "exchange_rate_source",
        "tax_rate",
        "tax_amount",
        "tax_name",
        "tax_inclusive",
        "merchant_name",
        "buyer_email",
        "buyer_name",
        "buyer_company",
        "buyer_country",
        "buyer_vat",
        "tx_hash",
        "issued_at",
        "voided_at",
        "created_at"
      ]
    }
  }
}