{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/altoviz-com/json-schema/altoviz-com-customer-schema.json",
  "title": "Customer",
  "description": "Customer",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/altoviz-com-customers-api-openapi.yml#/components/schemas/Customer",
  "type": "object",
  "properties": {
    "active": {
      "type": "boolean",
      "description": "Active"
    },
    "billingAddress": {
      "$ref": "#/$defs/AddressFields"
    },
    "billingOptions": {
      "$ref": "#/$defs/BillingOptions"
    },
    "cellPhone": {
      "type": [
        "string",
        "null"
      ],
      "description": "Cell phone number"
    },
    "companyInformations": {
      "$ref": "#/$defs/CompanyInfo"
    },
    "companyName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Company name"
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "description": "Email"
    },
    "family": {
      "$ref": "#/$defs/CustomerFamily"
    },
    "firstName": {
      "type": [
        "string",
        "null"
      ],
      "description": "First name"
    },
    "id": {
      "type": "integer",
      "description": "Customer ID",
      "format": "int32",
      "readOnly": true
    },
    "internalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID used in information system"
    },
    "internalNotes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Internal notes"
    },
    "lastName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Last name"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Metadata: free-form key/value pairs carried with the customer, for an integration to keep\nits own identifiers and flags against it.\n\nSent as a PATCH, not a replacement: keys you send are added or updated, keys you leave out\nkeep whatever they held, and a key is removed only when you send it as `null`. Omitting\nthe property entirely leaves the whole bag untouched, and `\"\"` stores an empty value\nrather than removing the key."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name",
      "readOnly": true
    },
    "number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Number"
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "Phone number"
    },
    "shippingAddress": {
      "$ref": "#/$defs/AddressFields"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Title"
    },
    "type": {
      "$ref": "#/$defs/CustomerType"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AddressFields": {
      "type": "object",
      "properties": {
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryIso": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryName": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "formattedAddress": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "inlineAddress": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "street": {
          "type": [
            "string",
            "null"
          ]
        },
        "zipcode": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "BillingOptions": {
      "type": "object",
      "properties": {
        "allowed": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Allowed"
        },
        "bankAccountId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Bank account ID",
          "format": "int32"
        },
        "buyerReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "Buyer reference"
        },
        "colleagueId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Colleague ID",
          "format": "int32"
        },
        "discount": {
          "$ref": "#/$defs/Discount"
        },
        "initialCommitmentAmount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Intial commitment amount",
          "format": "double"
        },
        "initialCommitmentDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "Initial commitment date",
          "format": "date"
        },
        "initialCommitmentStatus": {
          "$ref": "#/$defs/CommitmentStatus"
        },
        "liableToVat": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Indicates whether the document is liable to VAT"
        },
        "paymentMethod": {
          "$ref": "#/$defs/PaymentMethod"
        },
        "sendDocumentAsAttachment": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Send document as attachment"
        },
        "settlementTermId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Settlement term ID",
          "format": "int32"
        },
        "useTaxIncludedPrices": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Use tax included prices"
        },
        "vatReverseCharge": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Indicates VAT should be included in sales"
        },
        "vendorReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "Vendor reference. Used to be print on sales"
        }
      },
      "additionalProperties": false,
      "description": "Billing options"
    },
    "CommitmentStatus": {
      "enum": [
        "Unpaid",
        "Paid",
        "PartiallyPaid",
        "Balanced"
      ],
      "type": "string"
    },
    "CompanyInfo": {
      "type": "object",
      "properties": {
        "effectiveElectronicAddress": {
          "type": [
            "string",
            "null"
          ]
        },
        "electronicAddress": {
          "type": [
            "string",
            "null"
          ]
        },
        "siret": {
          "type": [
            "string",
            "null"
          ]
        },
        "vatNumber": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CustomerFamily": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID",
          "format": "int32",
          "readOnly": true
        },
        "internalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Internal ID"
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Label"
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Number"
        }
      },
      "additionalProperties": false,
      "description": "Customer family"
    },
    "CustomerType": {
      "enum": [
        "Business",
        "Consumer",
        "Government"
      ],
      "type": "string"
    },
    "Discount": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/DiscountType"
        },
        "value": {
          "type": "number",
          "format": "double"
        }
      },
      "additionalProperties": false
    },
    "DiscountType": {
      "enum": [
        "Percent",
        "Fixed"
      ],
      "type": "string"
    },
    "PaymentMethod": {
      "enum": [
        "Transfer",
        "Order",
        "Check",
        "Cash",
        "Card",
        "Bill",
        "Usec",
        "Other"
      ],
      "type": "string"
    }
  }
}