{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/leaseweb/main/json-schema/leaseweb-get-invoice-result-schema.json",
  "title": "getInvoiceResult",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/leaseweb-invoice-openapi.yml#/components/schemas/getInvoiceResult",
  "properties": {
    "id": {
      "description": "The unique id of the invoice",
      "type": "string"
    },
    "date": {
      "description": "The date the invoice was issued",
      "type": "string"
    },
    "dueDate": {
      "description": "The date the invoice is due for payment",
      "type": "string"
    },
    "taxAmount": {
      "description": "The tax amount of the invoice",
      "format": "float",
      "type": "number"
    },
    "total": {
      "description": "The total amount of the invoice",
      "format": "float",
      "type": "number"
    },
    "netAmount": {
      "description": "The total amount of the invoice without the tax amount included",
      "format": "float",
      "type": "number"
    },
    "openAmount": {
      "description": "The open amount of the invoice",
      "format": "float",
      "type": "number"
    },
    "currency": {
      "description": "The currency of the service price",
      "enum": [
        "EUR",
        "GBP",
        "USD",
        "SGD",
        "AUD",
        "HKD"
      ],
      "type": "string"
    },
    "isPartialPaymentAllowed": {
      "description": "The invoice can be paid partially",
      "type": "boolean"
    },
    "status": {
      "description": "The status of the invoice.",
      "enum": [
        "OPEN",
        "PAID",
        "OVERDUE",
        "CANCELLED"
      ],
      "type": "string"
    },
    "credits": {
      "description": "Array of Credits",
      "items": {
        "$ref": "#/$defs/credit"
      },
      "type": "array"
    },
    "lineItems": {
      "description": "All the line items attached to the invoice",
      "items": {
        "$ref": "#/$defs/lineItem"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "credit": {
      "properties": {
        "id": {
          "description": "The unique id of the credit",
          "type": "string"
        },
        "date": {
          "description": "The date the credit was issued (UTC)",
          "type": "string"
        },
        "taxAmount": {
          "description": "The amount of tax on the credit",
          "format": "float",
          "type": "number"
        },
        "netAmount": {
          "description": "The total amount of the credit without the tax amount included",
          "format": "float",
          "type": "number"
        },
        "total": {
          "description": "The total amount of the credit",
          "format": "float",
          "type": "number"
        }
      },
      "title": "credit",
      "type": "object"
    },
    "lineItem": {
      "properties": {
        "product": {
          "description": "A string to indicate what kind of product this is",
          "type": "string"
        },
        "unitAmount": {
          "description": "The amount it cost for a single product unit.",
          "format": "float",
          "type": "number"
        },
        "totalAmount": {
          "description": "The total amount of the product",
          "format": "float",
          "type": "number"
        },
        "fromDate": {
          "description": "The product start date (UTC)",
          "type": "string"
        },
        "toDate": {
          "description": "The product end date (UTC)",
          "type": "string"
        },
        "equipmentId": {
          "description": "The id of the equipment",
          "type": "string"
        },
        "contractId": {
          "description": "The id of the contract",
          "type": "string"
        },
        "quantity": {
          "description": "The quantity of a product",
          "type": "integer"
        }
      },
      "title": "lineItem",
      "type": "object"
    }
  }
}