{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/forwardai/main/json-schema/forwardai-invoice-by-id-schema.json",
  "title": "InvoiceById",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/forwardai-precise-api-openapi.yml#/components/schemas/InvoiceById",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "refNumber": {
      "type": "string"
    },
    "contact": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "dueDate": {
      "type": "string",
      "format": "date"
    },
    "lineItems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "lineNumber": {
            "type": "integer",
            "format": "int32"
          },
          "item": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "unitPrice": {
            "type": "number"
          },
          "lineAmount": {
            "type": "number"
          },
          "discountAmount": {
            "type": "number"
          },
          "taxCode": {
            "type": "string"
          }
        }
      }
    },
    "memo": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "exchangeRate": {
      "type": "number"
    },
    "amount": {
      "type": "number"
    },
    "totalDiscount": {
      "type": "number"
    },
    "totalTax": {
      "type": "number"
    },
    "balance": {
      "type": "number"
    },
    "paidStatus": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "amount": {
            "type": "number"
          }
        }
      }
    },
    "createdAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string"
    }
  }
}