{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/altoviz-com/json-schema/altoviz-com-quote-schema.json",
  "title": "Quote",
  "description": "Quote",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/altoviz-com-openapi.json#/components/schemas/Quote",
  "type": "object",
  "properties": {
    "acceptedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Accepted date",
      "format": "date-time"
    },
    "balance": {
      "type": "number",
      "description": "Balance",
      "format": "double",
      "readOnly": true
    },
    "billingAddress": {
      "$ref": "#/$defs/AddressFields"
    },
    "billingContact": {
      "$ref": "#/$defs/ContactFields"
    },
    "customerElectronicAddress": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer electronic address"
    },
    "customerId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Customer ID",
      "format": "int32"
    },
    "customerName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer name"
    },
    "customerNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer number"
    },
    "customerOrderReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer order reference"
    },
    "customerSiret": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer SIRET"
    },
    "customerType": {
      "$ref": "#/$defs/CustomerType"
    },
    "customerVatNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer VAT number"
    },
    "date": {
      "type": [
        "string",
        "null"
      ],
      "description": "Date",
      "format": "date"
    },
    "deposit": {
      "$ref": "#/$defs/Discount"
    },
    "footerNotes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Footer notes to be print"
    },
    "globalDiscount": {
      "$ref": "#/$defs/Discount"
    },
    "grossTaxExcludedAmount": {
      "type": "number",
      "description": "Gross tax excluded amount",
      "format": "double",
      "readOnly": true
    },
    "headerNotes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Header notes to be print"
    },
    "id": {
      "type": "integer",
      "description": "Invoice ID",
      "format": "int32",
      "readOnly": true
    },
    "internalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID used in your system"
    },
    "internalNotes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Internal notes"
    },
    "liableToVat": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Indicates whether the document is liable to VAT"
    },
    "lines": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/SaleDocumentLine"
      },
      "description": "Invoice lines"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Metadata: free-form key/value pairs carried with the document, 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."
    },
    "number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Number"
    },
    "pdfUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pdf url",
      "readOnly": true
    },
    "publicLink": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public link"
    },
    "refusedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Refused date",
      "format": "date-time"
    },
    "region": {
      "$ref": "#/$defs/VatRegion"
    },
    "sentAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Sent at",
      "format": "date-time",
      "readOnly": true
    },
    "shippingAddress": {
      "$ref": "#/$defs/AddressFields"
    },
    "shippingAmount": {
      "type": "number",
      "description": "Shipping amount",
      "format": "double"
    },
    "shippingContact": {
      "$ref": "#/$defs/ContactFields"
    },
    "shippingVat": {
      "$ref": "#/$defs/Vat"
    },
    "status": {
      "$ref": "#/$defs/QuoteStatus"
    },
    "subject": {
      "type": [
        "string",
        "null"
      ],
      "description": "Subject"
    },
    "taxAmount": {
      "type": "number",
      "description": "Total tax amount",
      "format": "double",
      "readOnly": true
    },
    "taxExcludedAmount": {
      "type": "number",
      "description": "Tax excluded amount (discount included)",
      "format": "double",
      "readOnly": true
    },
    "taxIncludedAmount": {
      "type": "number",
      "description": "Tax included amount",
      "format": "double",
      "readOnly": true
    },
    "useTaxIncludedPrices": {
      "type": "boolean",
      "description": "Indicates whether invoice prices and amount are tax included"
    },
    "validityDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Validity date",
      "format": "date"
    },
    "vatNote": {
      "type": [
        "string",
        "null"
      ],
      "description": "VAT note to print"
    },
    "vatReverseCharge": {
      "type": "boolean",
      "description": "VAT reverse charge"
    },
    "vats": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/VatSummary"
      },
      "description": "Vats",
      "readOnly": true
    },
    "vendorReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Vendor reference to be print"
    }
  },
  "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
    },
    "ContactFields": {
      "type": "object",
      "properties": {
        "cellPhone": {
          "type": [
            "string",
            "null"
          ]
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "firstName": {
          "type": [
            "string",
            "null"
          ]
        },
        "function": {
          "type": [
            "string",
            "null"
          ]
        },
        "invertedDisplayName": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "service": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "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"
    },
    "LineType": {
      "enum": [
        "Empty",
        "Product",
        "Service",
        "Subtotal",
        "Text",
        "NewPage"
      ],
      "type": "string",
      "description": "Line type"
    },
    "Product": {
      "type": "object",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Indicates whether the product is active"
        },
        "defaultQuantity": {
          "type": "number",
          "description": "Default quantity",
          "format": "double"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Description"
        },
        "family": {
          "$ref": "#/$defs/ProductFamily"
        },
        "id": {
          "type": "integer",
          "description": "Product ID",
          "format": "int32",
          "readOnly": true
        },
        "imageUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Gets the product image URL",
          "readOnly": true
        },
        "internalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "ID used in your system"
        },
        "internalNotes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Internal notes"
        },
        "isUnitPriceTaxIncluded": {
          "type": "boolean",
          "description": "<b>Deprecated</b> — always false on read, because `unitPrice` is now always the\n            tax-excluded price. There is nothing left for it to select between.\n            \nOn write it is still honoured: setting it to true means the price you are sending is\n            tax-included, exactly as before. Send `taxIncludedPrice` instead.",
          "deprecated": true
        },
        "margin": {
          "type": "number",
          "description": "Margin per unit, excluding tax: tax-excluded price less purchase price.\n\nDerived by the server on every save; a value sent here is ignored.",
          "format": "double"
        },
        "marginRate": {
          "type": "number",
          "description": "Margin rate: the margin as a percentage of the sale price (FR « taux de marque »).\n\nDerived by the server on every save; a value sent here is ignored.",
          "format": "double"
        },
        "markupRate": {
          "type": "number",
          "description": "Markup rate: the margin as a percentage of the purchase price (FR « taux de marge »).\n\nDerived by the server on every save; a value sent here is ignored.",
          "format": "double"
        },
        "metadata": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "Metadata: free-form key/value pairs carried with the product, 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"
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Number"
        },
        "purchasePrice": {
          "type": "number",
          "description": "Purchase price",
          "format": "double"
        },
        "taxExcludedPrice": {
          "type": "number",
          "description": "Sale price excluding tax.",
          "format": "double"
        },
        "taxIncludedPrice": {
          "type": "number",
          "description": "Sale price including tax.",
          "format": "double"
        },
        "type": {
          "$ref": "#/$defs/ProductType"
        },
        "unit": {
          "$ref": "#/$defs/Unit"
        },
        "unitPrice": {
          "type": "number",
          "description": "<b>Deprecated</b> — use `taxExcludedPrice`. Unit price, excluding tax: the same\n            value as `taxExcludedPrice`.\n            \nStill populated, and still read on write when neither new price field is sent, so no\n            existing integration has to change today.\nIt used to carry whichever half the product was edited in — the tax-included price when\n            `isUnitPriceTaxIncluded` was true — because only one price was stored. Both are stored\n            now, so this always reports the tax-excluded one and `isUnitPriceTaxIncluded` is always\n            false: a client that reads the flag keeps computing the same result.",
          "format": "double",
          "deprecated": true
        },
        "vat": {
          "$ref": "#/$defs/Vat"
        }
      },
      "additionalProperties": false,
      "description": "Product"
    },
    "ProductFamily": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID",
          "format": "int32",
          "readOnly": true
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Label"
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Number"
        }
      },
      "additionalProperties": false,
      "description": "Product family"
    },
    "ProductType": {
      "enum": [
        "Product",
        "Service",
        "Text"
      ],
      "type": "string"
    },
    "QuoteStatus": {
      "enum": [
        "Pending",
        "Accepted",
        "Refused",
        "Closed",
        "Sent",
        "Invoiced"
      ],
      "type": "string"
    },
    "SaleDocumentLine": {
      "type": "object",
      "properties": {
        "classificationId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Classification ID (used if no product is set)",
          "format": "int32"
        },
        "date": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date",
          "format": "date"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Description (can be html)"
        },
        "discount": {
          "$ref": "#/$defs/Discount"
        },
        "id": {
          "type": "integer",
          "description": "Invoice line ID",
          "format": "int32",
          "readOnly": true
        },
        "marginAmount": {
          "type": "number",
          "description": "Margin amount",
          "format": "double"
        },
        "markupRate": {
          "type": "number",
          "description": "Markup rate: the margin as a percentage of the purchase price (FR « taux de marge »).\n\nRenamed from `marginRate`: it has always divided by the purchase price.",
          "format": "double"
        },
        "product": {
          "$ref": "#/$defs/Product"
        },
        "productId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Product ID",
          "format": "int32"
        },
        "productInternalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Product internal ID"
        },
        "productNumber": {
          "type": [
            "string",
            "null"
          ],
          "description": "Product number"
        },
        "purchasePrice": {
          "type": [
            "number",
            "null"
          ],
          "description": "Purchase price",
          "format": "double"
        },
        "quantity": {
          "type": [
            "number",
            "null"
          ],
          "description": "Quantity",
          "format": "double"
        },
        "taxExcludedAmount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Tax excluded amount",
          "format": "double",
          "readOnly": true
        },
        "taxExcludedPrice": {
          "type": [
            "number",
            "null"
          ],
          "description": "Tax excluded price",
          "format": "double"
        },
        "taxIncludedAmount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Tax included amount",
          "format": "double",
          "readOnly": true
        },
        "taxIncludedPrice": {
          "type": [
            "number",
            "null"
          ],
          "description": "Tax included price",
          "format": "double"
        },
        "type": {
          "$ref": "#/$defs/LineType"
        },
        "unit": {
          "$ref": "#/$defs/Unit"
        },
        "vat": {
          "$ref": "#/$defs/Vat"
        }
      },
      "additionalProperties": false,
      "description": "Invoice line"
    },
    "Unit": {
      "type": "object",
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Code"
        },
        "conversion": {
          "type": "number",
          "description": "Conversion",
          "format": "double",
          "readOnly": true
        },
        "decimals": {
          "type": [
            "number",
            "null"
          ],
          "description": "Decimals",
          "format": "double",
          "readOnly": true
        },
        "id": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Unit Id",
          "format": "int32",
          "readOnly": true
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name",
          "readOnly": true
        },
        "type": {
          "$ref": "#/$defs/UnitType"
        }
      },
      "additionalProperties": false,
      "description": "Unit"
    },
    "UnitType": {
      "enum": [
        "Time",
        "Weight",
        "Area",
        "Volume",
        "Dimension",
        "Other"
      ],
      "type": "string"
    },
    "Vat": {
      "type": "object",
      "properties": {
        "default": {
          "type": "boolean",
          "description": "Indicatess if this is the default VAT for the region",
          "readOnly": true
        },
        "id": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Vat ID",
          "format": "int32",
          "readOnly": true
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "description": "Label",
          "readOnly": true
        },
        "rate": {
          "type": [
            "number",
            "null"
          ],
          "description": "Rate",
          "format": "double"
        },
        "region": {
          "$ref": "#/$defs/VatRegion"
        }
      },
      "additionalProperties": false,
      "description": "Vat"
    },
    "VatRegion": {
      "enum": [
        "FR",
        "EU",
        "IE",
        "DOM",
        "Corse",
        "Monaco"
      ],
      "type": "string"
    },
    "VatSummary": {
      "type": "object",
      "properties": {
        "taxExcludedAmount": {
          "type": "number",
          "description": "Tax excluded amount",
          "format": "double"
        },
        "vat": {
          "$ref": "#/$defs/Vat"
        },
        "vatAmount": {
          "type": "number",
          "description": "Vat amount",
          "format": "double"
        }
      },
      "additionalProperties": false,
      "description": "Vat summary"
    }
  }
}