{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/billingengine/main/json-schema/billingengine-customer-schema.json",
  "title": "Customer",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/billingengine-openapi.json#/components/schemas/Customer",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "number": {
      "type": [
        "string",
        "integer",
        "null"
      ]
    },
    "name": {
      "type": "string",
      "description": "Company, or first and last name."
    },
    "company": {
      "type": [
        "string",
        "null"
      ]
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "vat_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "buyer_reference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Buyer reference (BT-10), for example a Leitweg-ID."
    },
    "address": {
      "oneOf": [
        {
          "$ref": "#/$defs/Address"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "line_1": {
          "type": "string"
        },
        "line_2": {
          "type": [
            "string",
            "null"
          ]
        },
        "postal_code": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "region": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": "string",
          "description": "ISO country code such as DE."
        }
      }
    }
  }
}