{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lumabill-ch/json-schema/lumabill-ch-profile-update-schema.json",
  "title": "ProfileUpdate",
  "description": "Partial update for PUT /profiles/{id}. Every property is optional; anything omitted stays as is. Same keys as `Profile` minus the read-only ones (`id`, `isDefault`, `createdAt`, `updatedAt`).\n",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lumabill-ch-openapi.yaml#/components/schemas/ProfileUpdate",
  "type": "object",
  "properties": {
    "companyName": {
      "type": "string"
    },
    "street": {
      "type": "string"
    },
    "addressLine": {
      "type": "string",
      "description": "Second address line"
    },
    "zip": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "countryCode": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "contactPerson": {
      "type": "string"
    },
    "uid": {
      "type": "string"
    },
    "legalForm": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "einzelfirma",
        "kollektivgesellschaft",
        "kommanditgesellschaft",
        "ag",
        "gmbh",
        "genossenschaft",
        "verein",
        "stiftung",
        "other"
      ]
    },
    "shareCapital": {
      "type": [
        "number",
        "null"
      ]
    },
    "registeredOffice": {
      "type": [
        "string",
        "null"
      ]
    },
    "governingPersons": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GoverningPerson"
      }
    },
    "auditOptingOut": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "vatRegistered": {
      "type": "boolean"
    },
    "defaultTaxRate": {
      "type": "number"
    },
    "paymentDeadlineDays": {
      "type": "integer"
    },
    "defaultCurrency": {
      "allOf": [
        {
          "$ref": "#/$defs/Currency"
        }
      ],
      "description": "Seeds new documents; a code outside the list answers 400 UNSUPPORTED_CURRENCY (with `currency`)"
    },
    "baseCurrency": {
      "allOf": [
        {
          "$ref": "#/$defs/Currency"
        }
      ],
      "description": "Rejected with 400 once journal entries exist"
    },
    "defaultLanguage": {
      "type": "string",
      "enum": [
        "de",
        "fr",
        "it",
        "en"
      ]
    },
    "defaultInvoiceFooter": {
      "type": "string"
    },
    "invoiceNumberPrefix": {
      "type": "string"
    },
    "invoiceCount": {
      "type": "integer"
    },
    "offerNumberPrefix": {
      "type": "string"
    },
    "offerCount": {
      "type": "integer"
    },
    "creditNotePrefix": {
      "type": "string"
    },
    "creditNoteCount": {
      "type": "integer"
    },
    "clientNumberPrefix": {
      "type": "string"
    },
    "clientCount": {
      "type": "integer"
    },
    "productNumberPrefix": {
      "type": "string"
    },
    "productCount": {
      "type": "integer"
    },
    "defaultRevenueAccountCode": {
      "type": "string"
    },
    "roundTotalTo": {
      "type": "number"
    },
    "hideZeroTax": {
      "type": "boolean"
    },
    "logoUrl": {
      "type": "string"
    },
    "currencyDefaults": {
      "type": "object",
      "additionalProperties": true
    },
    "fxGainAccountId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "An active income / expense account of this profile in the base currency (400 INVALID_FX_ACCOUNT); null = 6960 Kursdifferenzen\n"
    },
    "fxLossAccountId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Same rules as fxGainAccountId, for exchange losses"
    },
    "fxValuationPolicy": {
      "type": "string",
      "enum": [
        "stichtag",
        "niederstwert"
      ],
      "description": "400 INVALID_FX_VALUATION_POLICY for any other value"
    },
    "fxVatRateMethod": {
      "type": [
        "object",
        "null"
      ],
      "description": "Replaces the stored map; null clears it (daily everywhere). Keys YYYY, values daily / monthly (400 INVALID_FX_VAT_RATE_METHOD). Art. 45 Abs. 5 MWSTV: the method in force can only change for a year without foreign-currency documents yet, else 409 FX_VAT_RATE_METHOD_LOCKED with `years`.\n",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "daily",
          "monthly"
        ]
      }
    }
  },
  "$defs": {
    "Currency": {
      "type": "string",
      "description": "ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.\n",
      "enum": [
        "CHF",
        "EUR",
        "USD",
        "GBP",
        "JPY",
        "CAD",
        "AUD",
        "SEK",
        "NOK",
        "DKK",
        "HUF"
      ]
    },
    "GoverningPerson": {
      "type": "object",
      "required": [
        "name",
        "role",
        "signing"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "vr_praesident",
            "vr_mitglied",
            "geschaeftsfuehrer",
            "gesellschafter",
            "aktionaer",
            "inhaber",
            "vorstand"
          ]
        },
        "signing": {
          "type": "boolean",
          "description": "Signs the annual financial statements and the GV documents"
        },
        "sharesHeld": {
          "type": [
            "number",
            "null"
          ],
          "description": "Shares or capital contributions held (Universalversammlung protocol)"
        }
      }
    }
  }
}