{
  "openapi": "3.1.0",
  "info": {
    "title": "Calibre API",
    "version": "1.0.0",
    "description": "The Calibre API: read understood invoices with per-field confidence and provenance, run accounts-payable workflows, and keep your ERP master data in sync."
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Invoices: Results and corrections"
    },
    {
      "name": "Invoices: Analytics"
    },
    {
      "name": "Accounts payable: Invoice workflow"
    },
    {
      "name": "Accounts payable: Approvals"
    },
    {
      "name": "Accounts payable: Coding and PO matching"
    },
    {
      "name": "Accounts payable: Posting"
    },
    {
      "name": "Accounts payable: Payments"
    },
    {
      "name": "Accounts payable: Comments and vendor messages"
    },
    {
      "name": "Accounts payable: GST compliance"
    },
    {
      "name": "Accounts payable: Activity"
    },
    {
      "name": "Accounts payable: Split and merge"
    },
    {
      "name": "Bootstrap training"
    },
    {
      "name": "Automation"
    },
    {
      "name": "Master data: Companies"
    },
    {
      "name": "Master data: Vendors"
    },
    {
      "name": "Master data: Accounts"
    },
    {
      "name": "Master data: Tax codes"
    },
    {
      "name": "Master data: Payment terms"
    },
    {
      "name": "Master data: Currencies"
    },
    {
      "name": "Master data: Units of measure"
    },
    {
      "name": "Master data: Products"
    },
    {
      "name": "Master data: Purchase orders"
    },
    {
      "name": "Master data: Dimensions"
    }
  ],
  "paths": {
    "/master-data/dimensions/config": {
      "get": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "Retrieve dimension configuration",
        "operationId": "dimension_config_master_data_dimensions_config_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionConfigResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns the dimension types configured for your organisation and the values each one allows.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/companies": {
      "get": {
        "tags": [
          "Master data: Companies"
        ],
        "summary": "List companies",
        "operationId": "list_entities_master_data_companies_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_CompanyRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your companies, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Companies"
        ],
        "summary": "Sync companies",
        "operationId": "sync_master_data_companies_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CompanyUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates companies in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a company, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/companies/{external_id}": {
      "get": {
        "tags": [
          "Master data: Companies"
        ],
        "summary": "Retrieve a company",
        "operationId": "get_entity_master_data_companies__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one company by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Companies"
        ],
        "summary": "Update a company",
        "operationId": "update_entity_master_data_companies__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Companies"
        ],
        "summary": "Delete a company",
        "operationId": "delete_entity_master_data_companies__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the company (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/vendors": {
      "get": {
        "tags": [
          "Master data: Vendors"
        ],
        "summary": "List vendors",
        "operationId": "list_entities_master_data_vendors_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_VendorRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your vendors, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Vendors"
        ],
        "summary": "Sync vendors",
        "operationId": "sync_master_data_vendors_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VendorUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates vendors in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a vendor, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/vendors/{external_id}": {
      "get": {
        "tags": [
          "Master data: Vendors"
        ],
        "summary": "Retrieve a vendor",
        "operationId": "get_entity_master_data_vendors__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one vendor by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Vendors"
        ],
        "summary": "Update a vendor",
        "operationId": "update_entity_master_data_vendors__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Vendors"
        ],
        "summary": "Delete a vendor",
        "operationId": "delete_entity_master_data_vendors__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the vendor (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/accounts": {
      "get": {
        "tags": [
          "Master data: Accounts"
        ],
        "summary": "List accounts",
        "operationId": "list_entities_master_data_accounts_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_AccountRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your accounts, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Accounts"
        ],
        "summary": "Sync accounts",
        "operationId": "sync_master_data_accounts_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AccountUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates accounts in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate an account, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/accounts/{external_id}": {
      "get": {
        "tags": [
          "Master data: Accounts"
        ],
        "summary": "Retrieve an account",
        "operationId": "get_entity_master_data_accounts__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one account by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Accounts"
        ],
        "summary": "Update an account",
        "operationId": "update_entity_master_data_accounts__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Accounts"
        ],
        "summary": "Delete an account",
        "operationId": "delete_entity_master_data_accounts__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the account (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/dimensions": {
      "get": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "List dimensions",
        "operationId": "list_entities_master_data_dimensions_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_DimensionRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your dimensions, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "Sync dimensions",
        "operationId": "sync_master_data_dimensions_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DimensionUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates dimensions in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a dimension, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/dimensions/{external_id}": {
      "get": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "Retrieve a dimension",
        "operationId": "get_entity_master_data_dimensions__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one dimension by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "Update a dimension",
        "operationId": "update_entity_master_data_dimensions__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DimensionUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Dimensions"
        ],
        "summary": "Delete a dimension",
        "operationId": "delete_entity_master_data_dimensions__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the dimension (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/payment-terms": {
      "get": {
        "tags": [
          "Master data: Payment terms"
        ],
        "summary": "List payment terms",
        "operationId": "list_entities_master_data_payment_terms_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PaymentTermRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your payment terms, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Payment terms"
        ],
        "summary": "Sync payment terms",
        "operationId": "sync_master_data_payment_terms_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaymentTermUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates payment terms in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a payment term, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/payment-terms/{external_id}": {
      "get": {
        "tags": [
          "Master data: Payment terms"
        ],
        "summary": "Retrieve a payment term",
        "operationId": "get_entity_master_data_payment_terms__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTermRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one payment term by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Payment terms"
        ],
        "summary": "Update a payment term",
        "operationId": "update_entity_master_data_payment_terms__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentTermUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTermRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Payment terms"
        ],
        "summary": "Delete a payment term",
        "operationId": "delete_entity_master_data_payment_terms__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTermRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the payment term (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/purchase-orders": {
      "get": {
        "tags": [
          "Master data: Purchase orders"
        ],
        "summary": "List purchase orders",
        "operationId": "list_entities_master_data_purchase_orders_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PurchaseOrderRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your purchase orders, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Purchase orders"
        ],
        "summary": "Sync purchase orders",
        "operationId": "sync_master_data_purchase_orders_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PurchaseOrderUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates purchase orders in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a purchase order, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/purchase-orders/{external_id}": {
      "get": {
        "tags": [
          "Master data: Purchase orders"
        ],
        "summary": "Retrieve a purchase order",
        "operationId": "get_entity_master_data_purchase_orders__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one purchase order by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Purchase orders"
        ],
        "summary": "Update a purchase order",
        "operationId": "update_entity_master_data_purchase_orders__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Purchase orders"
        ],
        "summary": "Delete a purchase order",
        "operationId": "delete_entity_master_data_purchase_orders__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the purchase order (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/tax-codes": {
      "get": {
        "tags": [
          "Master data: Tax codes"
        ],
        "summary": "List tax codes",
        "operationId": "list_entities_master_data_tax_codes_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_TaxCodeRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your tax codes, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Tax codes"
        ],
        "summary": "Sync tax codes",
        "operationId": "sync_master_data_tax_codes_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TaxCodeUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates tax codes in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a tax code, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/tax-codes/{external_id}": {
      "get": {
        "tags": [
          "Master data: Tax codes"
        ],
        "summary": "Retrieve a tax code",
        "operationId": "get_entity_master_data_tax_codes__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxCodeRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one tax code by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Tax codes"
        ],
        "summary": "Update a tax code",
        "operationId": "update_entity_master_data_tax_codes__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxCodeUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxCodeRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Tax codes"
        ],
        "summary": "Delete a tax code",
        "operationId": "delete_entity_master_data_tax_codes__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxCodeRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the tax code (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/currencies": {
      "get": {
        "tags": [
          "Master data: Currencies"
        ],
        "summary": "List currencies",
        "operationId": "list_entities_master_data_currencies_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_CurrencyRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your currencies, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Currencies"
        ],
        "summary": "Sync currencies",
        "operationId": "sync_master_data_currencies_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CurrencyUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates currencies in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a currency, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/currencies/{external_id}": {
      "get": {
        "tags": [
          "Master data: Currencies"
        ],
        "summary": "Retrieve a currency",
        "operationId": "get_entity_master_data_currencies__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrencyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one currency by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Currencies"
        ],
        "summary": "Update a currency",
        "operationId": "update_entity_master_data_currencies__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CurrencyUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrencyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Currencies"
        ],
        "summary": "Delete a currency",
        "operationId": "delete_entity_master_data_currencies__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrencyRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the currency (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/unit-of-measures": {
      "get": {
        "tags": [
          "Master data: Units of measure"
        ],
        "summary": "List units of measure",
        "operationId": "list_entities_master_data_unit_of_measures_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_UnitOfMeasureRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your units of measure, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Units of measure"
        ],
        "summary": "Sync units of measure",
        "operationId": "sync_master_data_unit_of_measures_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UnitOfMeasureUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates units of measure in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a unit of measure, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/unit-of-measures/{external_id}": {
      "get": {
        "tags": [
          "Master data: Units of measure"
        ],
        "summary": "Retrieve a unit of measure",
        "operationId": "get_entity_master_data_unit_of_measures__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one unit of measure by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Units of measure"
        ],
        "summary": "Update a unit of measure",
        "operationId": "update_entity_master_data_unit_of_measures__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitOfMeasureUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Units of measure"
        ],
        "summary": "Delete a unit of measure",
        "operationId": "delete_entity_master_data_unit_of_measures__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitOfMeasureRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the unit of measure (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/products": {
      "get": {
        "tags": [
          "Master data: Products"
        ],
        "summary": "List products",
        "operationId": "list_entities_master_data_products_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "active"
            },
            "description": "Which records to return: `active` (the default), `inactive` or `all`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by, in camelCase. Prefix with `-` for descending."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Text to search for. Not case-sensitive. Matches any field of the record unless you set `q_field`."
          },
          {
            "name": "q_field",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search only this field (camelCase), for example `name`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ProductRead_"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns your products, active ones by default. Search with `q`, sort with `sort`, and page with `limit` and `offset`.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Master data: Products"
        ],
        "summary": "Sync products",
        "operationId": "sync_master_data_products_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductUpsert"
                },
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Creates or updates products in bulk. Send an array; each record is matched on its `externalId`. Sending the same payload again changes nothing, and a record with an older `externalUpdatedAt` never overwrites newer data. Send `isActive: false` to deactivate a product, and `true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/master-data/products/{external_id}": {
      "get": {
        "tags": [
          "Master data: Products"
        ],
        "summary": "Retrieve a product",
        "operationId": "get_entity_master_data_products__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns one product by its `externalId`, whether it is active or not.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Master data: Products"
        ],
        "summary": "Update a product",
        "operationId": "update_entity_master_data_products__external_id__put",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Updates the fields you send and leaves the others unchanged.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Master data: Products"
        ],
        "summary": "Delete a product",
        "operationId": "delete_entity_master_data_products__external_id__delete",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your ERP’s ID for the record (its `externalId`)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductRead"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "master_data:write"
        ],
        "description": "Deactivates the product (`isActive: false`) but keeps it, so past invoices still resolve. Sync it with `isActive: true` to restore it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs": {
      "post": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Create a run",
        "operationId": "create_run_bootstrap_runs_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRunRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:write",
          "master_data:write"
        ],
        "description": "Opens a bootstrap training run. Submit your historical invoices to it, watch readiness, then close it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs/{run_id}/invoices": {
      "post": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Submit an invoice",
        "operationId": "submit_invoice_bootstrap_runs__run_id__invoices_post",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bootstrap run’s ID, returned when you create the run."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/SubmitInvoiceForm"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:write",
          "master_data:write"
        ],
        "description": "Uploads one historical invoice: the PDF and the invoice as it was booked in your ERP. Calibre reads the PDF, compares what it read with your ERP, and learns from every difference.\n\nReturns `202`: processing happens in the background. Track it with **Retrieve a run**. Submitting the same PDF again is safe; the response says whether it was a repeat (`idempotent`).",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs/{run_id}": {
      "get": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Retrieve a run",
        "operationId": "get_run_bootstrap_runs__run_id__get",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bootstrap run’s ID, returned when you create the run."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:read",
          "bootstrap:write",
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns the run’s state and counters: invoices submitted, processed, matched to your ERP, unverifiable and failed, and corrections written.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs/{run_id}/readiness": {
      "get": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Get readiness",
        "operationId": "get_readiness_bootstrap_runs__run_id__readiness_get",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bootstrap run’s ID, returned when you create the run."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadinessReport"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:read",
          "bootstrap:write",
          "master_data:read",
          "master_data:write"
        ],
        "description": "Returns readiness for each vendor and the accuracy forecast on held-out invoices: the signal for when to go live.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs/{run_id}/close": {
      "post": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Close a run",
        "operationId": "close_run_bootstrap_runs__run_id__close_post",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bootstrap run’s ID, returned when you create the run."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:write",
          "master_data:write"
        ],
        "description": "Completes the run. Every submitted invoice must have finished processing first.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/bootstrap/runs/{run_id}/cancel": {
      "post": {
        "tags": [
          "Bootstrap training"
        ],
        "summary": "Cancel a run",
        "operationId": "cancel_run_bootstrap_runs__run_id__cancel_post",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bootstrap run’s ID, returned when you create the run."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "bootstrap:write",
          "master_data:write"
        ],
        "description": "Cancels the run and stops invoices that are still processing.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices": {
      "get": {
        "tags": [
          "Invoices: Results and corrections"
        ],
        "summary": "List invoices",
        "operationId": "list_invoices_invoices_get",
        "parameters": [
          {
            "name": "review_status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ReviewStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices with this review status."
          },
          {
            "name": "doc_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only documents of this type: `tax_invoice`, `credit_note`, `debit_note`, `rcm_invoice` or `unknown`."
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only vendors whose name contains this text. Not case-sensitive."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Search vendor names and invoice numbers."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices dated on or after this day (YYYY-MM-DD)."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices dated on or before this day (YYYY-MM-DD)."
          },
          {
            "name": "amount_min",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices whose total is at least this amount."
          },
          {
            "name": "amount_max",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "string",
                  "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices whose total is at most this amount."
          },
          {
            "name": "exceptions_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Only invoices with a hard validation finding, a suspected duplicate or a PO mismatch."
          },
          {
            "name": "assigned_to_user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices assigned to this user."
          },
          {
            "name": "pending_for_me",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Only invoices whose current approval step the caller can decide. The caller is the user the token was issued to."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Field to sort by. Prefix with `-` for descending: `invoice_date`, `total_amount`, `document_confidence`, `vendor_name`, `review_status`, `doc_type` or `created_at`."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns your invoices, newest first unless you choose a `sort`, with vendor names resolved from your master data. Combine the filters below to narrow the list.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/status-counts": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "Count invoices by status",
        "operationId": "status_counts_invoices_aggregate_status_counts_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusCountsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns how many of your invoices are in each review status.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/queue-depth": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "Get the review queue",
        "operationId": "queue_depth_invoices_aggregate_queue_depth_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueDepthResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns how many invoices, and how many individual fields, are waiting for review.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/auto-approve-rate": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "Get the auto-approval rate",
        "operationId": "auto_approve_rate_invoices_aggregate_auto_approve_rate_get",
        "parameters": [
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "day"
            },
            "description": "Bucket size: `day`, `week` or `month`."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices received on or after this time (ISO 8601)."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices received on or before this time (ISO 8601)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoApproveRateResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns the share of invoices approved automatically, per day, week or month.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/spend-by-vendor": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "List top vendors by spend",
        "operationId": "spend_by_vendor_invoices_aggregate_spend_by_vendor_get",
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices dated on or after this day (YYYY-MM-DD)."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only invoices dated on or before this day (YYYY-MM-DD)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 20
            },
            "description": "Maximum number of vendors to return."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpendByVendorResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns the vendors with the highest total invoiced amount, largest first.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/analytics-overview": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "Get the analytics overview",
        "operationId": "analytics_overview_invoices_aggregate_analytics_overview_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsOverviewResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns spend and throughput trends, spend by category, and headline automation rates over a fixed recent period.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/aggregate/vendor-performance": {
      "get": {
        "tags": [
          "Invoices: Analytics"
        ],
        "summary": "Get vendor performance",
        "operationId": "vendor_performance_invoices_aggregate_vendor_performance_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VendorPerformanceRow"
                  },
                  "title": "Response Vendor Performance Invoices Aggregate Vendor Performance Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns one row per vendor: invoice count, total spend, exception rate, duplicates, average confidence, whether the GSTIN is valid and the on-time payment rate.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/{invoice_id}": {
      "get": {
        "tags": [
          "Invoices: Results and corrections"
        ],
        "summary": "Retrieve an invoice",
        "operationId": "get_invoice_invoices__invoice_id__get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceUnderstandingResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns everything Calibre understood from one invoice: each extracted field with its confidence score and provenance (the page, position and method that produced it), the line items and tax, the validation findings and the review decision.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/invoices/{invoice_id}/fields/{field_key}/correct": {
      "post": {
        "tags": [
          "Invoices: Results and corrections"
        ],
        "summary": "Correct a field",
        "operationId": "correct_field_invoices__invoice_id__fields__field_key__correct_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          },
          {
            "name": "field_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The field to correct, for example `invoice_number` or `total_amount`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldCorrectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectionAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:review"
        ],
        "description": "Records a reviewer’s correction to one extracted field. Calibre learns from corrections, so later invoices are read better.\n\nCall it with a user’s token: the correction is recorded against that person.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/automation/verdicts/{invoice_id}": {
      "post": {
        "tags": [
          "Automation"
        ],
        "summary": "Record a QA verdict",
        "operationId": "post_verdict_automation_verdicts__invoice_id__post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerdictRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerdictResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:review"
        ],
        "description": "Records a reviewer’s verdict on an invoice: which critical fields, if any, were wrong. If QA finds too many errors, Calibre raises its confidence threshold so fewer invoices are approved automatically.\n\nCall it with a user’s token: the verdict is recorded against that person.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/automation/state": {
      "get": {
        "tags": [
          "Automation"
        ],
        "summary": "Retrieve automation state",
        "operationId": "get_state_automation_state_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns whether automatic approval is on, the confidence threshold in force, whether Calibre is still warming up, QA results so far and recent threshold changes.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/automation/scorecard": {
      "get": {
        "tags": [
          "Automation"
        ],
        "summary": "Get the weekly scorecard",
        "operationId": "get_scorecard_automation_scorecard_get",
        "parameters": [
          {
            "name": "week",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Any day in the week you want, as YYYY-MM-DD. Weeks run Monday to Sunday."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WeeklyScorecard"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "invoices:read",
          "invoices:review"
        ],
        "description": "Returns the scorecard for one week: straight-through rate, QA precision, correction rates and review time, split by how much history Calibre has with each vendor.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}": {
      "get": {
        "tags": [
          "Accounts payable: Invoice workflow"
        ],
        "summary": "Retrieve an AP invoice",
        "operationId": "get_ap_invoice_ap_invoices__invoice_id__get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApInvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s accounts-payable record: approval and coding status, assignee, and any invoice it replaces or is replaced by. Calibre creates the record the first time it is read.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/assign": {
      "post": {
        "tags": [
          "Accounts payable: Invoice workflow"
        ],
        "summary": "Assign an invoice",
        "operationId": "assign_invoice_ap_invoices__invoice_id__assign_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApInvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Assigns the invoice to a teammate. Send `\"user_id\": null` to unassign it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/approval": {
      "get": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Retrieve an approval",
        "operationId": "get_approval_state_ap_invoices__invoice_id__approval_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalState"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s approval chain, the step it is on and the last decision.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/approval/actions": {
      "post": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Decide an approval step",
        "operationId": "act_on_approval_ap_invoices__invoice_id__approval_actions_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalState"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Approves, rejects, holds or asks for more information on the invoice’s current approval step.\n\nCall it with a user’s token. Calibre checks that this person may decide the step: their role, any delegation, their approval limit and segregation of duties. You cannot name the approver in the request.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/approval-policy": {
      "get": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Retrieve the approval policy",
        "operationId": "get_approval_policy_ap_approval_policy_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPolicy"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns your approval policy: the amount ladder that decides who approves, the amount below which invoices need no approval, and whether segregation of duties and approval limits are enforced.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Replace the approval policy",
        "operationId": "update_approval_policy_ap_approval_policy_put",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalPolicyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPolicy"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Replaces the whole approval policy. Rules you leave out are removed.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/delegations": {
      "get": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "List delegations",
        "operationId": "list_delegations_ap_delegations_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Delegation"
                  },
                  "title": "Response List Delegations Ap Delegations Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns your organisation’s approval delegations.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Create a delegation",
        "operationId": "create_delegation_ap_delegations_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDelegationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delegation"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Lets one person approve on another’s behalf between two times, optionally only up to an amount.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/delegations/{delegation_id}": {
      "delete": {
        "tags": [
          "Accounts payable: Approvals"
        ],
        "summary": "Revoke a delegation",
        "operationId": "revoke_delegation_ap_delegations__delegation_id__delete",
        "parameters": [
          {
            "name": "delegation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The delegation’s ID."
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Ends the delegation. Returns no content.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/posting": {
      "get": {
        "tags": [
          "Accounts payable: Posting"
        ],
        "summary": "Retrieve posting status",
        "operationId": "get_posting_state_ap_invoices__invoice_id__posting_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostingStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns where the invoice stands in posting to your ERP and, once posted, the ERP’s document number.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/post-request": {
      "post": {
        "tags": [
          "Accounts payable: Posting"
        ],
        "summary": "Post to the ERP",
        "operationId": "post_request_ap_invoices__invoice_id__post_request_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequestInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostRequestAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Queues the invoice for posting to your ERP and returns `202` straight away. Check **Retrieve posting status** for the outcome.\n\nCalibre refuses to post when something must change first:\n\n| Status | Error code | Meaning |\n|---|---|---|\n| 409 | `approval_pending`, `held`, `rejected`, `info_requested` | The approval is not complete. |\n| 409 | `already_posted`, `processing` | The invoice is posted or being posted. |\n| 422 | `lines_do_not_reconcile` | The lines do not add up to the invoice amounts. `detail` gives the difference. |\n| 422 | `duplicate`, `review_failed`, `no_erp` | A suspected duplicate, a failed review, or no ERP connection. |",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/activity": {
      "get": {
        "tags": [
          "Accounts payable: Activity"
        ],
        "summary": "List an invoice’s activity",
        "operationId": "get_invoice_activity_ap_invoices__invoice_id__activity_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActivityEvent"
                  },
                  "title": "Response Get Invoice Activity Ap Invoices  Invoice Id  Activity Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s audit trail, newest first.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/activity": {
      "get": {
        "tags": [
          "Accounts payable: Activity"
        ],
        "summary": "List recent activity",
        "operationId": "list_recent_activity_ap_activity_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns recent activity across all your invoices.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/coding": {
      "get": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Retrieve the coding",
        "operationId": "get_invoice_coding_ap_invoices__invoice_id__coding_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCoding"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s GL coding lines. The first time it is read, Calibre suggests a split based on the vendor’s past invoices.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Replace the coding",
        "operationId": "update_invoice_coding_ap_invoices__invoice_id__coding_put",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CodingLineInput"
                },
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCoding"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Replaces all of the invoice’s GL coding lines with the ones you send.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/lines": {
      "get": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "List invoice lines",
        "operationId": "get_invoice_lines_ap_invoices__invoice_id__lines_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLinesResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s editable expense and item lines. Each item line is compared with its purchase-order line.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Update invoice lines",
        "operationId": "update_invoice_lines_ap_invoices__invoice_id__lines_put",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceLinesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLinesResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Saves edited expense and item lines. When item lines change, Calibre matches them against the PO again. Send `\"rematch\": false` to save without re-matching; the match is then marked stale until you re-run it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/purchase-orders/{po_external_id}/line-matches": {
      "get": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "List PO line matches",
        "operationId": "get_po_line_matches_ap_purchase_orders__po_external_id__line_matches_get",
        "parameters": [
          {
            "name": "po_external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The purchase order’s `externalId` in your master data."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoLineMatchesResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "For each line of a purchase order, returns the invoices matched to it and the quantities ordered, billed in the ERP, matched but not yet posted, and still open.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/dimension-settings": {
      "get": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Retrieve dimension settings",
        "operationId": "get_dimension_settings_ap_dimension_settings_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionSettingsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Lists the ERP dimension types synced into your master data, each with whether invoices use it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Update dimension settings",
        "operationId": "update_dimension_settings_ap_dimension_settings_put",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDimensionSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionSettingsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Switches dimension types on or off for invoices. Only types synced from your ERP are accepted.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/dimensions": {
      "put": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Set header dimensions",
        "operationId": "update_invoice_dimensions_ap_invoices__invoice_id__dimensions_put",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceDimensionsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLinesResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Sets or clears the invoice’s header-level ERP dimensions, such as cost centre or project. Only dimension types switched on in dimension settings are accepted.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/po-header": {
      "put": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Change the vendor or PO",
        "operationId": "update_invoice_po_header_ap_invoices__invoice_id__po_header_put",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePoHeaderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLinesResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Links the invoice to a different vendor or purchase order from your master data, then matches the lines again. Send `\"rematch\": false` to skip re-matching.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/rematch": {
      "post": {
        "tags": [
          "Accounts payable: Coding and PO matching"
        ],
        "summary": "Re-run PO matching",
        "operationId": "rematch_invoice_po_ap_invoices__invoice_id__rematch_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLinesResult"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Matches the invoice’s item lines against its purchase order again, using the current master data.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/payments": {
      "get": {
        "tags": [
          "Accounts payable: Payments"
        ],
        "summary": "List payments",
        "operationId": "list_payments_ap_payments_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Only payments with this status, such as `scheduled`, `partially_paid`, `paid` or `overdue`."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50
            },
            "description": "Maximum number of items to return."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of items to skip before the first one returned. Use with `limit` to page through results."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns payment status for your invoices, one row per invoice. Calibre tracks payments; it does not move money.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/aging-report": {
      "get": {
        "tags": [
          "Accounts payable: Payments"
        ],
        "summary": "Get the aging report",
        "operationId": "get_aging_report_ap_aging_report_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgingReport"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns what you owe in aging buckets (current, 1–30, 31–60, 61–90 and over 90 days), in total and by vendor.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/payment": {
      "get": {
        "tags": [
          "Accounts payable: Payments"
        ],
        "summary": "Retrieve payment status",
        "operationId": "get_payment_ap_invoices__invoice_id__payment_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s payment status, the amount paid so far and the amount still due.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/payment/schedule": {
      "post": {
        "tags": [
          "Accounts payable: Payments"
        ],
        "summary": "Schedule a payment",
        "operationId": "schedule_payment_ap_invoices__invoice_id__payment_schedule_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePaymentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Records the date and method you plan to pay the invoice. Calibre tracks the plan; your bank or ERP makes the payment.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/payment/record": {
      "post": {
        "tags": [
          "Accounts payable: Payments"
        ],
        "summary": "Record a payment",
        "operationId": "record_payment_ap_invoices__invoice_id__payment_record_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordPaymentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Records a payment made against the invoice. Partial payments are supported: each recorded payment adds to the amount paid.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/comments": {
      "get": {
        "tags": [
          "Accounts payable: Comments and vendor messages"
        ],
        "summary": "List comments",
        "operationId": "list_comments_ap_invoices__invoice_id__comments_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Comment"
                  },
                  "title": "Response List Comments Ap Invoices  Invoice Id  Comments Get"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Returns the invoice’s comment thread, oldest first.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Accounts payable: Comments and vendor messages"
        ],
        "summary": "Add a comment",
        "operationId": "add_comment_ap_invoices__invoice_id__comments_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCommentInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Adds a comment to the invoice. @-mentions are matched to people in your approver directory.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/vendor-messages": {
      "post": {
        "tags": [
          "Accounts payable: Comments and vendor messages"
        ],
        "summary": "Email the vendor",
        "operationId": "send_vendor_message_ap_invoices__invoice_id__vendor_messages_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendVendorMessageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorMessage"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Sends an email about this invoice to the vendor. Calibre takes the vendor’s address from your master data, so the request never carries it.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/gst/reconciliation": {
      "get": {
        "tags": [
          "Accounts payable: GST compliance"
        ],
        "summary": "Get the GSTR-2B reconciliation",
        "operationId": "get_gst_reconciliation_ap_gst_reconciliation_get",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The return period, as `YYYY-MM`."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GstReconSummary"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Compares the GST on your invoices with GSTR-2B for one return period, by vendor: matched, mismatched, and missing on either side, with the input tax credit at risk.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/gst/gstin/{gstin}/validate": {
      "get": {
        "tags": [
          "Accounts payable: GST compliance"
        ],
        "summary": "Validate a GSTIN",
        "operationId": "validate_gstin_route_ap_gst_gstin__gstin__validate_get",
        "parameters": [
          {
            "name": "gstin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The 15-character GSTIN to check."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GstinValidation"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:read",
          "ap:write"
        ],
        "description": "Checks a GSTIN’s format, check digit and state code. The check runs inside Calibre and does not contact the GST portal.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/gst/irn/validate": {
      "post": {
        "tags": [
          "Accounts payable: GST compliance"
        ],
        "summary": "Validate an IRN",
        "operationId": "validate_irn_route_ap_gst_irn_validate_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateIrnRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IrnValidation"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Checks an e-invoice’s IRN with the Invoice Registration Portal and stores the acknowledgement number and date.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/invoices/{invoice_id}/split-request": {
      "post": {
        "tags": [
          "Accounts payable: Split and merge"
        ],
        "summary": "Split a document",
        "operationId": "request_split_ap_invoices__invoice_id__split_request_post",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The invoice’s Calibre ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRequestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SplitRequestAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Asks Calibre to split a document that holds several invoices into separate invoices. Processing happens in the background.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ap/merge-request": {
      "post": {
        "tags": [
          "Accounts payable: Split and merge"
        ],
        "summary": "Merge documents",
        "operationId": "request_merge_ap_merge_request_post",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeRequestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeRequestAcceptedResponse"
                }
              }
            }
          },
          "401": {
            "description": "The token is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The token holds none of the scopes this endpoint accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request failed validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "description": "Asks Calibre to merge several documents into one invoice. Processing happens in the background.",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "accountType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accounttype"
          },
          "parentAccountExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentaccountexternalid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "AccountRead",
        "description": "A GL account, as the API returns it."
      },
      "AccountUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "accountType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accounttype"
          },
          "parentAccountExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentaccountexternalid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AccountUpsert",
        "description": "A GL account, as you send it to sync or update."
      },
      "ActivityEvent": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "actor_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor User Id"
          },
          "actor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Name"
          },
          "before": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Before"
          },
          "after": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "After"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "invoice_id",
          "event_type",
          "at"
        ],
        "title": "ActivityEvent",
        "description": "One entry in an invoice’s activity trail. `event_type` is a dot-notation value such as `approval.decided`."
      },
      "ActivityListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ActivityEvent"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ActivityListResponse"
      },
      "AddCommentInput": {
        "properties": {
          "body": {
            "type": "string",
            "title": "Body",
            "description": "The comment. Mention a teammate with @."
          }
        },
        "type": "object",
        "required": [
          "body"
        ],
        "title": "AddCommentInput"
      },
      "AgingBucket": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "from_days": {
            "type": "integer",
            "title": "From Days"
          },
          "to_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "To Days"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          }
        },
        "type": "object",
        "required": [
          "label",
          "from_days",
          "count",
          "amount"
        ],
        "title": "AgingBucket"
      },
      "AgingReport": {
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date-time",
            "title": "As Of"
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/AgingBucket"
            },
            "type": "array",
            "title": "Buckets"
          },
          "total_outstanding": {
            "type": "string",
            "title": "Total Outstanding"
          },
          "by_vendor": {
            "items": {
              "$ref": "#/components/schemas/AgingVendorRollup"
            },
            "type": "array",
            "title": "By Vendor"
          }
        },
        "type": "object",
        "required": [
          "as_of",
          "buckets",
          "total_outstanding",
          "by_vendor"
        ],
        "title": "AgingReport"
      },
      "AgingVendorRollup": {
        "properties": {
          "vendor_external_id": {
            "type": "string",
            "title": "Vendor External Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "outstanding": {
            "type": "string",
            "title": "Outstanding"
          },
          "overdue": {
            "type": "string",
            "title": "Overdue"
          }
        },
        "type": "object",
        "required": [
          "vendor_external_id",
          "outstanding",
          "overdue"
        ],
        "title": "AgingVendorRollup"
      },
      "AnalyticsOverviewResponse": {
        "properties": {
          "period": {
            "type": "string",
            "title": "Period"
          },
          "total_spend": {
            "type": "string",
            "title": "Total Spend"
          },
          "invoice_count": {
            "type": "integer",
            "title": "Invoice Count"
          },
          "auto_approval_rate": {
            "type": "number",
            "title": "Auto Approval Rate"
          },
          "touchless_rate": {
            "type": "number",
            "title": "Touchless Rate"
          },
          "avg_turnaround_hours": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Turnaround Hours"
          },
          "exception_rate": {
            "type": "number",
            "title": "Exception Rate"
          },
          "spend_trend": {
            "items": {
              "$ref": "#/components/schemas/TimeseriesPoint"
            },
            "type": "array",
            "title": "Spend Trend"
          },
          "throughput_trend": {
            "items": {
              "$ref": "#/components/schemas/TimeseriesPoint"
            },
            "type": "array",
            "title": "Throughput Trend"
          },
          "spend_by_vendor": {
            "items": {
              "$ref": "#/components/schemas/SpendByDimension"
            },
            "type": "array",
            "title": "Spend By Vendor"
          },
          "spend_by_category": {
            "items": {
              "$ref": "#/components/schemas/SpendByDimension"
            },
            "type": "array",
            "title": "Spend By Category"
          }
        },
        "type": "object",
        "required": [
          "period",
          "total_spend",
          "invoice_count",
          "auto_approval_rate",
          "touchless_rate",
          "avg_turnaround_hours",
          "exception_rate",
          "spend_trend",
          "throughput_trend",
          "spend_by_vendor",
          "spend_by_category"
        ],
        "title": "AnalyticsOverviewResponse",
        "description": "Spend and throughput trends, spend by category, and headline rates. `period` is a fixed trailing window."
      },
      "ApInvoiceResponse": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "tenant_id": {
            "type": "string",
            "title": "Tenant Id"
          },
          "approval_status": {
            "type": "string",
            "title": "Approval Status"
          },
          "coding_status": {
            "type": "string",
            "title": "Coding Status"
          },
          "assignee_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee User Id"
          },
          "superseded": {
            "type": "boolean",
            "title": "Superseded",
            "default": false
          },
          "superseded_by": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Superseded By",
            "default": []
          },
          "supersedes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Supersedes",
            "default": []
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "tenant_id",
          "approval_status",
          "coding_status",
          "created_at",
          "updated_at"
        ],
        "title": "ApInvoiceResponse"
      },
      "ApprovalActionRequest": {
        "properties": {
          "decision": {
            "type": "string",
            "title": "Decision",
            "description": "One of `approve`, `reject`, `hold` or `request_info`.",
            "example": "approve"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "Why, in a few words. Recorded in the activity trail.",
            "example": "Matches the PO and the goods receipt"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment",
            "description": "An optional comment.",
            "example": "Approved against PO-2026-0187."
          }
        },
        "type": "object",
        "required": [
          "decision"
        ],
        "title": "ApprovalActionRequest"
      },
      "ApprovalPolicy": {
        "properties": {
          "enforce_segregation_of_duties": {
            "type": "boolean",
            "title": "Enforce Segregation Of Duties"
          },
          "enforce_approval_limits": {
            "type": "boolean",
            "title": "Enforce Approval Limits"
          },
          "auto_approve_below_amount": {
            "type": "string",
            "title": "Auto Approve Below Amount"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/ApprovalRule"
            },
            "type": "array",
            "title": "Rules"
          }
        },
        "type": "object",
        "required": [
          "enforce_segregation_of_duties",
          "enforce_approval_limits",
          "auto_approve_below_amount",
          "rules"
        ],
        "title": "ApprovalPolicy"
      },
      "ApprovalPolicyInput": {
        "properties": {
          "enforce_segregation_of_duties": {
            "type": "boolean",
            "title": "Enforce Segregation Of Duties",
            "description": "When `true`, people who uploaded or corrected an invoice cannot approve it."
          },
          "enforce_approval_limits": {
            "type": "boolean",
            "title": "Enforce Approval Limits",
            "description": "When `true`, approvers can only approve invoices up to their own limit."
          },
          "auto_approve_below_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Auto Approve Below Amount",
            "description": "Invoices with a total below this amount need no approval.",
            "example": "5000.00"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/ApprovalRuleInput"
            },
            "type": "array",
            "title": "Rules",
            "description": "The approval ladder: which role approves at which amount."
          }
        },
        "type": "object",
        "required": [
          "enforce_segregation_of_duties",
          "enforce_approval_limits",
          "auto_approve_below_amount",
          "rules"
        ],
        "title": "ApprovalPolicyInput"
      },
      "ApprovalRule": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "basis": {
            "type": "string",
            "title": "Basis"
          },
          "amount_threshold": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Threshold"
          },
          "approver_role_chain": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Approver Role Chain"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "id",
          "basis",
          "approver_role_chain",
          "description",
          "active"
        ],
        "title": "ApprovalRule"
      },
      "ApprovalRuleInput": {
        "properties": {
          "basis": {
            "type": "string",
            "title": "Basis"
          },
          "amount_threshold": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Threshold"
          },
          "approver_role_chain": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Approver Role Chain"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "basis",
          "approver_role_chain"
        ],
        "title": "ApprovalRuleInput"
      },
      "ApprovalState": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "chain": {
            "items": {
              "$ref": "#/components/schemas/ApprovalStep"
            },
            "type": "array",
            "title": "Chain"
          },
          "current_step_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Step Index"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted At"
          },
          "posted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted By"
          },
          "last_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Reason"
          }
        },
        "type": "object",
        "required": [
          "status",
          "chain",
          "current_step_index"
        ],
        "title": "ApprovalState"
      },
      "ApprovalStep": {
        "properties": {
          "order": {
            "type": "integer",
            "title": "Order"
          },
          "approver_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver User Id"
          },
          "approver_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approver Name"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "decided_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decided At"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          }
        },
        "type": "object",
        "required": [
          "order",
          "approver_user_id",
          "approver_name",
          "reason",
          "status"
        ],
        "title": "ApprovalStep"
      },
      "AssignInvoiceRequest": {
        "properties": {
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id",
            "description": "The teammate to assign the invoice to. `null` unassigns it."
          }
        },
        "type": "object",
        "title": "AssignInvoiceRequest"
      },
      "AutoApproveBucket": {
        "properties": {
          "bucket": {
            "type": "string",
            "format": "date-time",
            "title": "Bucket"
          },
          "auto_approved": {
            "type": "integer",
            "title": "Auto Approved"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "rate": {
            "type": "number",
            "title": "Rate"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "auto_approved",
          "total",
          "rate"
        ],
        "title": "AutoApproveBucket",
        "description": "One time bucket of the auto-approve-rate series."
      },
      "AutoApproveDecision": {
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "auto_approved",
              "review"
            ],
            "title": "Decision"
          },
          "blocked_by": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Blocked By"
          },
          "tau": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tau"
          },
          "threshold": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "tau",
                  "tau_cold"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold"
          },
          "p_document": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "P Document"
          },
          "qa_sample": {
            "type": "boolean",
            "title": "Qa Sample",
            "default": false
          },
          "qa_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "first_n",
                  "random"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Reason"
          },
          "bank": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "match",
                  "changed",
                  "unverified",
                  "not_read"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank"
          },
          "bank_fingerprint": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Fingerprint"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "decision"
        ],
        "title": "AutoApproveDecision",
        "description": "Added in schema 1.7.0. Whether Calibre approved this invoice automatically. `decision` is `auto_approved` or `review`; with `review`, `blocked_by` lists the codes that stopped automatic approval."
      },
      "AutoApproveRateResponse": {
        "properties": {
          "granularity": {
            "type": "string",
            "title": "Granularity"
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/AutoApproveBucket"
            },
            "type": "array",
            "title": "Buckets"
          }
        },
        "type": "object",
        "required": [
          "granularity",
          "buckets"
        ],
        "title": "AutoApproveRateResponse",
        "description": "The auto-approval rate over time."
      },
      "AutomationEvent": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "tau_before": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tau Before"
          },
          "tau_after": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tau After"
          },
          "qa_samples": {
            "type": "integer",
            "title": "Qa Samples"
          },
          "qa_failures": {
            "type": "integer",
            "title": "Qa Failures"
          },
          "lower_bound": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lower Bound"
          },
          "actor": {
            "type": "string",
            "title": "Actor"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "tau_before",
          "tau_after",
          "qa_samples",
          "qa_failures",
          "lower_bound",
          "actor",
          "reason",
          "created_at"
        ],
        "title": "AutomationEvent"
      },
      "AutomationStateResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "day_one": {
            "type": "boolean",
            "title": "Day One"
          },
          "tau_in_force": {
            "type": "number",
            "title": "Tau In Force"
          },
          "threshold": {
            "type": "string",
            "enum": [
              "tau",
              "tau_cold"
            ],
            "title": "Threshold"
          },
          "warming_up": {
            "type": "boolean",
            "title": "Warming Up"
          },
          "tau_floor": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tau Floor"
          },
          "auto_approved": {
            "type": "integer",
            "title": "Auto Approved"
          },
          "verified": {
            "type": "integer",
            "title": "Verified"
          },
          "ece": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ece"
          },
          "qa_target": {
            "type": "number",
            "title": "Qa Target"
          },
          "qa_samples": {
            "type": "integer",
            "title": "Qa Samples"
          },
          "qa_failures": {
            "type": "integer",
            "title": "Qa Failures"
          },
          "qa_lower_bound": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Lower Bound"
          },
          "qa_samples_to_certify": {
            "type": "integer",
            "title": "Qa Samples To Certify"
          },
          "qa_open": {
            "type": "integer",
            "title": "Qa Open"
          },
          "breaches": {
            "type": "integer",
            "title": "Breaches"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/AutomationEvent"
            },
            "type": "array",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "day_one",
          "tau_in_force",
          "threshold",
          "warming_up",
          "tau_floor",
          "auto_approved",
          "verified",
          "ece",
          "qa_target",
          "qa_samples",
          "qa_failures",
          "qa_lower_bound",
          "qa_samples_to_certify",
          "qa_open",
          "breaches",
          "events"
        ],
        "title": "AutomationStateResponse"
      },
      "BBox": {
        "properties": {
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "x0": {
            "type": "number",
            "title": "X0"
          },
          "y0": {
            "type": "number",
            "title": "Y0"
          },
          "x1": {
            "type": "number",
            "title": "X1"
          },
          "y1": {
            "type": "number",
            "title": "Y1"
          }
        },
        "type": "object",
        "required": [
          "page",
          "x0",
          "y0",
          "x1",
          "y1"
        ],
        "title": "BBox",
        "description": "A box on a page, in PDF points (1 pt = 1/72 inch), with the origin at the top-left of the page and y growing downward."
      },
      "BlockerRow": {
        "properties": {
          "cause": {
            "type": "string",
            "title": "Cause"
          },
          "invoices": {
            "type": "integer",
            "title": "Invoices",
            "default": 0
          },
          "sole_blocker": {
            "type": "integer",
            "title": "Sole Blocker",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "cause"
        ],
        "title": "BlockerRow",
        "description": "One reason a vendor’s invoices are not approved automatically. `invoices` counts the invoices it affects; `sole_blocker` counts those it alone holds back, so fixing it would approve exactly those."
      },
      "CalibrationSummary": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "calibrator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibrator"
          },
          "bundle_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Id"
          },
          "feature_set": {
            "type": "string",
            "title": "Feature Set"
          },
          "vendor_history_depth": {
            "type": "string",
            "title": "Vendor History Depth"
          },
          "p_document": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "P Document"
          },
          "p_fields": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "P Fields"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "feature_set",
          "vendor_history_depth"
        ],
        "title": "CalibrationSummary",
        "description": "Added in schema 1.7.0. The calibrated probability that this reading is right. `status` is `ok` with `p_document` set, or a code saying why there is no probability. Without one, the invoice is not approved automatically."
      },
      "ClassificationResult": {
        "properties": {
          "doc_type": {
            "$ref": "#/components/schemas/DocType"
          },
          "doc_subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doc Subtype"
          },
          "is_einvoice": {
            "type": "boolean",
            "title": "Is Einvoice",
            "default": false
          },
          "has_irn": {
            "type": "boolean",
            "title": "Has Irn",
            "default": false
          },
          "supply_state_hint": {
            "type": "string",
            "enum": [
              "intra",
              "inter",
              "unknown"
            ],
            "title": "Supply State Hint",
            "default": "unknown"
          },
          "language_hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language Hint"
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "default": 0
          },
          "features": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Features"
          }
        },
        "type": "object",
        "required": [
          "doc_type"
        ],
        "title": "ClassificationResult"
      },
      "CodingLine": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          },
          "account_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account External Id"
          },
          "account_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Name"
          },
          "cost_centre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Centre"
          },
          "project": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project"
          },
          "tax_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Code"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "account_source": {
            "type": "string",
            "enum": [
              "model",
              "vendor_history",
              "none"
            ],
            "title": "Account Source",
            "default": "none"
          },
          "account_confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Confidence"
          }
        },
        "type": "object",
        "required": [
          "id",
          "amount"
        ],
        "title": "CodingLine"
      },
      "CodingLineInput": {
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Amount"
          },
          "account_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account External Id"
          },
          "cost_centre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Centre"
          },
          "project": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project"
          },
          "tax_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Code"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "CodingLineInput"
      },
      "CohortRow": {
        "properties": {
          "cohort": {
            "type": "string",
            "title": "Cohort"
          },
          "invoices": {
            "type": "integer",
            "title": "Invoices"
          },
          "verified": {
            "type": "integer",
            "title": "Verified"
          },
          "correction_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Correction Rate"
          },
          "qa_samples": {
            "type": "integer",
            "title": "Qa Samples"
          },
          "qa_precision": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Precision"
          },
          "qa_lower_bound": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Lower Bound"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "cohort",
          "invoices",
          "verified",
          "correction_rate",
          "qa_samples",
          "qa_precision",
          "qa_lower_bound"
        ],
        "title": "CohortRow",
        "description": "One week’s results for vendors with a similar amount of history in Calibre."
      },
      "Comment": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "author_user_id": {
            "type": "string",
            "title": "Author User Id"
          },
          "author_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author Name"
          },
          "body": {
            "type": "string",
            "title": "Body"
          },
          "mentions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Mentions"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "invoice_id",
          "author_user_id",
          "body",
          "mentions",
          "created_at"
        ],
        "title": "Comment"
      },
      "CompanyRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "countryCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countrycode"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "pan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pan"
          },
          "vatNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vatnumber"
          },
          "ein": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ein"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "CompanyRead",
        "description": "A company, as the API returns it."
      },
      "CompanyUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "countryCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countrycode"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "pan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pan"
          },
          "vatNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vatnumber"
          },
          "ein": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ein"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CompanyUpsert",
        "description": "A company, as you send it to sync or update."
      },
      "ConfidenceBreakdown": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field"
          },
          "components": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Components"
          },
          "weights": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Weights"
          },
          "raw": {
            "type": "number",
            "title": "Raw"
          },
          "gated": {
            "type": "number",
            "title": "Gated"
          },
          "value": {
            "type": "number",
            "maximum": 0.99,
            "minimum": 0,
            "title": "Value"
          },
          "gate_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Gate Reasons"
          }
        },
        "type": "object",
        "required": [
          "field",
          "components",
          "weights",
          "raw",
          "gated",
          "value"
        ],
        "title": "ConfidenceBreakdown",
        "description": "How a field’s confidence score was built. `components` holds each input (method, OCR, layout, resolution and validation) from 0 to 1, or `null` where it does not apply. `raw` is their weighted sum, `gated` the score after hard checks, and `value` the final score. Calibre’s own scores stop at 0.99; 1.0 means a person verified the value."
      },
      "CorrectionAcceptedResponse": {
        "properties": {
          "accepted": {
            "type": "boolean",
            "title": "Accepted",
            "default": true
          }
        },
        "type": "object",
        "title": "CorrectionAcceptedResponse",
        "description": "Confirms the correction was saved."
      },
      "CreateDelegationRequest": {
        "properties": {
          "from_user_id": {
            "type": "string",
            "title": "From User Id",
            "description": "The approver whose authority is delegated."
          },
          "to_user_id": {
            "type": "string",
            "title": "To User Id",
            "description": "The person who may approve on their behalf."
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "title": "Starts At",
            "description": "When the delegation starts (ISO 8601)."
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "title": "Ends At",
            "description": "When the delegation ends (ISO 8601)."
          },
          "amount_cap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Cap",
            "description": "Invoices above this total are not covered. `null` covers any amount.",
            "example": "50000.00"
          }
        },
        "type": "object",
        "required": [
          "from_user_id",
          "to_user_id",
          "starts_at",
          "ends_at"
        ],
        "title": "CreateDelegationRequest"
      },
      "CreateRunRequest": {
        "properties": {
          "created_by": {
            "type": "string",
            "title": "Created By",
            "description": "The ID of the person opening the run."
          },
          "notes": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Notes",
            "description": "Optional notes, as text keys and values, stored with the run.",
            "example": {
              "source": "Purchase register, FY 2025-26"
            }
          }
        },
        "type": "object",
        "required": [
          "created_by"
        ],
        "title": "CreateRunRequest",
        "description": "Opens a bootstrap training run."
      },
      "CurrencyRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "CurrencyRead",
        "description": "A currency, as the API returns it."
      },
      "CurrencyUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CurrencyUpsert",
        "description": "A currency, as you send it to sync or update."
      },
      "Delegation": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "from_user_id": {
            "type": "string",
            "title": "From User Id"
          },
          "from_user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From User Name"
          },
          "to_user_id": {
            "type": "string",
            "title": "To User Id"
          },
          "to_user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To User Name"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "title": "Starts At"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "title": "Ends At"
          },
          "amount_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Cap"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "id",
          "from_user_id",
          "from_user_name",
          "to_user_id",
          "to_user_name",
          "starts_at",
          "ends_at",
          "active"
        ],
        "title": "Delegation"
      },
      "DimensionConfigResponse": {
        "properties": {
          "knownTypes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Knowntypes"
          },
          "dimensions": {
            "items": {
              "$ref": "#/components/schemas/DimensionTypeConfig"
            },
            "type": "array",
            "title": "Dimensions"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "knownTypes",
          "dimensions"
        ],
        "title": "DimensionConfigResponse",
        "description": "The configured dimension types and the values each one allows."
      },
      "DimensionRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "shortName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shortname"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "typeName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typename"
          },
          "typeExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typeexternalid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "DimensionRead",
        "description": "A dimension, as the API returns it."
      },
      "DimensionSetting": {
        "properties": {
          "dimension_type": {
            "type": "string",
            "title": "Dimension Type"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "value_count": {
            "type": "integer",
            "title": "Value Count"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "dimension_type",
          "label",
          "value_count",
          "enabled"
        ],
        "title": "DimensionSetting",
        "description": "One ERP dimension type synced into master data, and whether your invoices use it."
      },
      "DimensionSettingsResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DimensionSetting"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "DimensionSettingsResponse"
      },
      "DimensionTypeConfig": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type"
          },
          "typeName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typename"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "default": false
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/DimensionValue"
            },
            "type": "array",
            "title": "Values"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "count",
          "values"
        ],
        "title": "DimensionTypeConfig",
        "description": "One configured dimension type + its allowed values (values may be capped)."
      },
      "DimensionUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "shortName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shortname"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "typeName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typename"
          },
          "typeExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typeexternalid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DimensionUpsert",
        "description": "A dimension, as you send it to sync or update."
      },
      "DimensionValue": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "shortName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shortname"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId"
        ],
        "title": "DimensionValue",
        "description": "One allowed value of a dimension type."
      },
      "DocType": {
        "type": "string",
        "enum": [
          "tax_invoice",
          "credit_note",
          "debit_note",
          "rcm_invoice",
          "unknown"
        ],
        "title": "DocType",
        "description": "Document classification."
      },
      "Error": {
        "title": "Error",
        "type": "object",
        "required": [
          "error"
        ],
        "description": "The error envelope. Branch on `error`, which is stable; `detail` is written for people.",
        "properties": {
          "error": {
            "type": "string",
            "description": "A stable, machine-readable code, for example `invalid_token`."
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "More detail, when there is any."
          }
        }
      },
      "ExtractionMethod": {
        "type": "string",
        "enum": [
          "template_anchor",
          "ruled_table_cell",
          "kv_block",
          "anchor_regex",
          "regex_only",
          "ml_crf",
          "ml_ranker",
          "derived",
          "master_data",
          "structural",
          "llm_reader",
          "llm_escalation",
          "structured_payload",
          "absent"
        ],
        "title": "ExtractionMethod",
        "description": "How a field's value was obtained."
      },
      "FieldCorrectionRequest": {
        "properties": {
          "new_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Value",
            "description": "The correct value, as text."
          }
        },
        "type": "object",
        "title": "FieldCorrectionRequest",
        "description": "The corrected value of one field."
      },
      "FieldKey": {
        "type": "string",
        "enum": [
          "vendor_name",
          "vendor_gstin",
          "vendor_vat_id",
          "invoice_number",
          "invoice_date",
          "due_date",
          "po_number",
          "payment_terms",
          "taxable_amount",
          "cgst",
          "sgst",
          "igst",
          "sales_tax",
          "vat",
          "total_amount"
        ],
        "title": "FieldKey",
        "description": "Canonical header / tax field names.\n\nLine-item sub-fields are addressed as the string `\"line_items[i].<sub>\"`\n(not enumerated here)."
      },
      "FieldResult": {
        "properties": {
          "key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FieldKey"
              },
              {
                "type": "string"
              }
            ],
            "title": "Key"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "raw": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw"
          },
          "confidence": {
            "type": "number",
            "maximum": 0.99,
            "minimum": 0,
            "title": "Confidence",
            "default": 0
          },
          "provenance": {
            "$ref": "#/components/schemas/Provenance"
          },
          "needs_review": {
            "type": "boolean",
            "title": "Needs Review",
            "default": false
          },
          "review_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Review Reasons"
          },
          "ml_margin": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ml Margin"
          },
          "calibrated_confidence": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 0.99,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibrated Confidence"
          },
          "alternatives": {
            "items": {
              "$ref": "#/components/schemas/FieldResult"
            },
            "type": "array",
            "title": "Alternatives"
          }
        },
        "type": "object",
        "required": [
          "key",
          "value",
          "provenance"
        ],
        "title": "FieldResult",
        "description": "The final, scored value of one field. Every field carries its `provenance`."
      },
      "GstinValidation": {
        "properties": {
          "gstin": {
            "type": "string",
            "title": "Gstin"
          },
          "valid": {
            "type": "boolean",
            "title": "Valid"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "state_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State Code"
          },
          "state_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State Name"
          }
        },
        "type": "object",
        "required": [
          "gstin",
          "valid"
        ],
        "title": "GstinValidation"
      },
      "GstReconRow": {
        "properties": {
          "invoice_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "vendor_gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Gstin"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Number"
          },
          "invoice_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Date"
          },
          "tax_in_books": {
            "type": "string",
            "title": "Tax In Books"
          },
          "tax_in_2b": {
            "type": "string",
            "title": "Tax In 2B"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "vendor_name",
          "vendor_gstin",
          "invoice_number",
          "invoice_date",
          "tax_in_books",
          "tax_in_2b",
          "status"
        ],
        "title": "GstReconRow"
      },
      "GstReconSummary": {
        "properties": {
          "period": {
            "type": "string",
            "title": "Period"
          },
          "matched_count": {
            "type": "integer",
            "title": "Matched Count"
          },
          "mismatch_count": {
            "type": "integer",
            "title": "Mismatch Count"
          },
          "missing_in_2b_count": {
            "type": "integer",
            "title": "Missing In 2B Count"
          },
          "missing_in_books_count": {
            "type": "integer",
            "title": "Missing In Books Count"
          },
          "total_credit_at_risk": {
            "type": "string",
            "title": "Total Credit At Risk"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/GstReconRow"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "period",
          "matched_count",
          "mismatch_count",
          "missing_in_2b_count",
          "missing_in_books_count",
          "total_credit_at_risk",
          "rows"
        ],
        "title": "GstReconSummary"
      },
      "HoldoutReport": {
        "properties": {
          "invoices": {
            "type": "integer",
            "title": "Invoices",
            "default": 0
          },
          "predicted_live_accuracy": {
            "type": "number",
            "title": "Predicted Live Accuracy",
            "default": 0
          },
          "predicted_auto_approve_rate": {
            "type": "number",
            "title": "Predicted Auto Approve Rate",
            "default": 0
          },
          "field_accuracy": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Field Accuracy"
          },
          "measured": {
            "type": "boolean",
            "title": "Measured",
            "default": false
          }
        },
        "type": "object",
        "title": "HoldoutReport",
        "description": "What the held-out invoices predict for live use. `predicted_live_accuracy` is measured only on invoices Calibre did not learn from, so it is a fair forecast. The per-vendor readiness rows answer a different question: how well Calibre reads the invoices it trained on."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "IntakeResponse": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "ocr_job_id": {
            "type": "string",
            "title": "Ocr Job Id"
          },
          "pdf_content_hash": {
            "type": "string",
            "title": "Pdf Content Hash"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "idempotent": {
            "type": "boolean",
            "title": "Idempotent"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "invoice_id",
          "ocr_job_id",
          "pdf_content_hash",
          "state",
          "idempotent"
        ],
        "title": "IntakeResponse",
        "description": "Result of submitting one historical invoice for training."
      },
      "InvoiceCoding": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/CodingLine"
            },
            "type": "array",
            "title": "Lines"
          },
          "complete": {
            "type": "boolean",
            "title": "Complete"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "lines",
          "complete"
        ],
        "title": "InvoiceCoding"
      },
      "InvoiceLine": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "line_amount": {
            "type": "string",
            "title": "Line Amount"
          },
          "tax_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Code"
          },
          "item_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Item Id"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unit_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Price"
          },
          "po_line_comparison": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PoLineComparison"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account External Id"
          },
          "account_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Name"
          },
          "dimensions": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Dimensions"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "line_amount"
        ],
        "title": "InvoiceLine"
      },
      "InvoiceLineInput": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "line_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Line Amount"
          },
          "tax_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Code"
          },
          "item_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Item Id"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unit_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Price"
          },
          "account_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account External Id"
          },
          "cost_centre": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Centre"
          },
          "project": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project"
          },
          "dimensions": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          }
        },
        "type": "object",
        "required": [
          "line_amount"
        ],
        "title": "InvoiceLineInput"
      },
      "InvoiceLinesResult": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "vendor_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor External Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "po_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Number"
          },
          "po_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po External Id"
          },
          "po_match_status": {
            "type": "string",
            "title": "Po Match Status"
          },
          "expenses": {
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            },
            "type": "array",
            "title": "Expenses"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            },
            "type": "array",
            "title": "Items"
          },
          "dimensions": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Dimensions"
          },
          "reconciliation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinesReconciliation"
              },
              {
                "type": "null"
              }
            ]
          },
          "duplicate_of_invoice_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duplicate Of Invoice Id"
          },
          "duplicate_of_invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duplicate Of Invoice Number"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "po_match_status",
          "expenses",
          "items"
        ],
        "title": "InvoiceLinesResult"
      },
      "InvoiceListItem": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "review_status": {
            "$ref": "#/components/schemas/ReviewStatus"
          },
          "document_confidence": {
            "type": "number",
            "title": "Document Confidence"
          },
          "doc_type": {
            "type": "string",
            "title": "Doc Type"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Number"
          },
          "invoice_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Date"
          },
          "total_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Amount"
          },
          "posting_status": {
            "type": "string",
            "title": "Posting Status",
            "default": "not_posted"
          },
          "erp_document_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp Document Number"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted At"
          },
          "posting_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posting Error"
          },
          "po_linked": {
            "type": "boolean",
            "title": "Po Linked",
            "default": false
          },
          "linked_po_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked Po Number"
          },
          "vendor_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor External Id"
          },
          "has_duplicate": {
            "type": "boolean",
            "title": "Has Duplicate",
            "default": false
          },
          "has_hard_finding": {
            "type": "boolean",
            "title": "Has Hard Finding",
            "default": false
          },
          "has_po_mismatch": {
            "type": "boolean",
            "title": "Has Po Mismatch",
            "default": false
          },
          "lines_mismatch": {
            "type": "boolean",
            "title": "Lines Mismatch",
            "default": false
          },
          "lines_total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lines Total"
          },
          "lines_expected": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lines Expected"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "vendor_name",
          "review_status",
          "document_confidence",
          "doc_type",
          "created_at"
        ],
        "title": "InvoiceListItem",
        "description": "One invoice in a list."
      },
      "InvoiceListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceListItem"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "InvoiceListResponse",
        "description": "A page of invoices."
      },
      "InvoiceUnderstandingResult": {
        "properties": {
          "schema_version": {
            "type": "string",
            "title": "Schema Version"
          },
          "pipeline_version": {
            "type": "string",
            "title": "Pipeline Version"
          },
          "anchor_pack_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor Pack Version"
          },
          "tenant_id": {
            "type": "string",
            "title": "Tenant Id"
          },
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "ocr_result_id": {
            "type": "string",
            "title": "Ocr Result Id"
          },
          "content_hash": {
            "type": "string",
            "title": "Content Hash"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "classification": {
            "$ref": "#/components/schemas/ClassificationResult"
          },
          "vendor_identity": {
            "$ref": "#/components/schemas/VendorIdentity"
          },
          "cluster_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cluster Id"
          },
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/FieldResult"
            },
            "type": "object",
            "title": "Fields"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/LineItem"
            },
            "type": "array",
            "title": "Line Items"
          },
          "resolution": {
            "$ref": "#/components/schemas/ResolutionResult"
          },
          "validation": {
            "$ref": "#/components/schemas/ValidationResult"
          },
          "confidence": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ConfidenceBreakdown"
            },
            "type": "object",
            "title": "Confidence"
          },
          "document_confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Document Confidence",
            "default": 0
          },
          "review_status": {
            "$ref": "#/components/schemas/ReviewStatus"
          },
          "flagged_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Flagged Fields"
          },
          "field_resolved_ids": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Field Resolved Ids"
          },
          "is_po_invoice": {
            "type": "boolean",
            "title": "Is Po Invoice",
            "default": false
          },
          "po_matches": {
            "items": {
              "$ref": "#/components/schemas/POMatchResult"
            },
            "type": "array",
            "title": "Po Matches"
          },
          "master_data_overrides": {
            "items": {
              "$ref": "#/components/schemas/MasterDataOverride"
            },
            "type": "array",
            "title": "Master Data Overrides"
          },
          "reader": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReaderSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "integrity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResultIntegrity"
              },
              {
                "type": "null"
              }
            ]
          },
          "calibration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CalibrationSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_approve": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutoApproveDecision"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxable_bases": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaxableBases"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "schema_version",
          "pipeline_version",
          "tenant_id",
          "invoice_id",
          "ocr_result_id",
          "content_hash",
          "created_at",
          "classification",
          "vendor_identity",
          "resolution",
          "validation",
          "review_status"
        ],
        "title": "InvoiceUnderstandingResult",
        "description": "The full understanding result for a single invoice: every extracted field with its confidence and provenance, line items, tax, validation findings and the review decision. Money values are strings."
      },
      "IrnValidation": {
        "properties": {
          "irn": {
            "type": "string",
            "title": "Irn"
          },
          "valid": {
            "type": "boolean",
            "title": "Valid"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "ack_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ack No"
          },
          "ack_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ack Date"
          }
        },
        "type": "object",
        "required": [
          "irn",
          "valid"
        ],
        "title": "IrnValidation"
      },
      "LearningCoverage": {
        "properties": {
          "invoices": {
            "type": "integer",
            "title": "Invoices",
            "default": 0
          },
          "healthy": {
            "type": "boolean",
            "title": "Healthy",
            "default": true
          },
          "diagnosis": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Diagnosis"
          },
          "template_coverage": {
            "type": "number",
            "title": "Template Coverage",
            "default": 0
          },
          "vendor_template_coverage": {
            "type": "number",
            "title": "Vendor Template Coverage",
            "default": 0
          },
          "unverifiable_rate": {
            "type": "number",
            "title": "Unverifiable Rate",
            "default": 0
          },
          "unverifiable_by_field": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Unverifiable By Field"
          },
          "lookup_gap_rate": {
            "type": "number",
            "title": "Lookup Gap Rate",
            "default": 0
          },
          "mean_clusters_per_vendor": {
            "type": "number",
            "title": "Mean Clusters Per Vendor",
            "default": 0
          },
          "clusters_total": {
            "type": "integer",
            "title": "Clusters Total",
            "default": 0
          },
          "clusters_below_floor": {
            "type": "integer",
            "title": "Clusters Below Floor",
            "default": 0
          },
          "support_floor": {
            "type": "integer",
            "title": "Support Floor",
            "default": 0
          },
          "corrections_by_pass": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Corrections By Pass"
          },
          "relaxation_profile": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "integer"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Relaxation Profile"
          }
        },
        "type": "object",
        "title": "LearningCoverage",
        "description": "Whether the run taught Calibre anything and, if not, what stopped it. An empty `diagnosis` means the run is healthy; otherwise each entry explains a problem in plain words."
      },
      "LineItem": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "description": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "hsn_sac": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "quantity": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "unit_price": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "line_tax": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "line_amount": {
            "$ref": "#/components/schemas/FieldResult"
          },
          "confidence": {
            "type": "number",
            "maximum": 0.99,
            "minimum": 0,
            "title": "Confidence",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "index",
          "description",
          "hsn_sac",
          "quantity",
          "unit_price",
          "line_tax",
          "line_amount"
        ],
        "title": "LineItem",
        "description": "One row of a line-item table; each sub-field is a FieldResult."
      },
      "LinesReconciliation": {
        "properties": {
          "lines_total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lines Total"
          },
          "expected": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected"
          },
          "basis": {
            "type": "string",
            "title": "Basis"
          },
          "difference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Difference"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          }
        },
        "type": "object",
        "required": [
          "lines_total",
          "basis",
          "ok"
        ],
        "title": "LinesReconciliation",
        "description": "Whether the invoice’s lines add up to its header amounts. Lines are pre-tax, so they are compared with the pre-tax subtotal (`taxable_amount`) when one was read; otherwise with the total less any tax read (CGST, SGST, IGST, sales tax or VAT); otherwise with the total. A tolerance of 1 or 0.5%, whichever is larger, absorbs rounding. When `ok` is `false`, the invoice cannot be posted to the ERP."
      },
      "MasterDataOverride": {
        "properties": {
          "field_key": {
            "type": "string",
            "title": "Field Key"
          },
          "extracted_value": {
            "type": "string",
            "title": "Extracted Value"
          },
          "extracted_provenance": {
            "$ref": "#/components/schemas/Provenance"
          },
          "master_value": {
            "type": "string",
            "title": "Master Value"
          },
          "master_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Master External Id"
          }
        },
        "type": "object",
        "required": [
          "field_key",
          "extracted_value",
          "extracted_provenance",
          "master_value"
        ],
        "title": "MasterDataOverride",
        "description": "A field where your ERP data overruled what the invoice page said. Both values are kept so a reviewer can see them side by side, for example *the invoice says Net 60; the vendor record in the ERP says Net 30*. `extracted_provenance` points at the token on the page that carried the other value."
      },
      "MergeRequestAcceptedResponse": {
        "properties": {
          "invoice_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Invoice Ids"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "invoice_ids",
          "status"
        ],
        "title": "MergeRequestAcceptedResponse"
      },
      "MergeRequestInput": {
        "properties": {
          "invoice_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Invoice Ids",
            "description": "The Calibre IDs of the documents to merge.",
            "example": [
              "3f0c1b52-7d1e-4c43-9b1a-6a1f6f1d2c10",
              "8b7e2d41-2c9a-4f0e-a6d3-1e5b9c7f4a22"
            ]
          }
        },
        "type": "object",
        "required": [
          "invoice_ids"
        ],
        "title": "MergeRequestInput"
      },
      "Page_AccountRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AccountRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[AccountRead]"
      },
      "Page_CompanyRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CompanyRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[CompanyRead]"
      },
      "Page_CurrencyRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CurrencyRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[CurrencyRead]"
      },
      "Page_DimensionRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DimensionRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[DimensionRead]"
      },
      "Page_PaymentTermRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PaymentTermRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[PaymentTermRead]"
      },
      "Page_ProductRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProductRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[ProductRead]"
      },
      "Page_PurchaseOrderRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[PurchaseOrderRead]"
      },
      "Page_TaxCodeRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TaxCodeRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[TaxCodeRead]"
      },
      "Page_UnitOfMeasureRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UnitOfMeasureRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[UnitOfMeasureRead]"
      },
      "Page_VendorRead_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VendorRead"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "Page[VendorRead]"
      },
      "Payment": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "amount_due": {
            "type": "string",
            "title": "Amount Due"
          },
          "amount_paid": {
            "type": "string",
            "title": "Amount Paid"
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "scheduled_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Date"
          },
          "paid_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paid Date"
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount"
          },
          "discount_deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Deadline"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "status",
          "amount_due",
          "amount_paid"
        ],
        "title": "Payment"
      },
      "PaymentListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Payment"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "PaymentListResponse"
      },
      "PaymentTermRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "daysToPay": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daystopay"
          },
          "discountDays": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discountdays"
          },
          "discountPercentage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discountpercentage"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "PaymentTermRead",
        "description": "A payment term, as the API returns it."
      },
      "PaymentTermUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "daysToPay": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daystopay"
          },
          "discountDays": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discountdays"
          },
          "discountPercentage": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discountpercentage"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PaymentTermUpsert",
        "description": "A payment term, as you send it to sync or update."
      },
      "PoFieldComparison": {
        "properties": {
          "invoice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice"
          },
          "po": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po"
          },
          "ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ok"
          }
        },
        "type": "object",
        "title": "PoFieldComparison"
      },
      "PoLineComparison": {
        "properties": {
          "po_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Number"
          },
          "po_line_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Line Number"
          },
          "quantity": {
            "$ref": "#/components/schemas/PoFieldComparison"
          },
          "unit_price": {
            "$ref": "#/components/schemas/PoFieldComparison"
          },
          "line_amount": {
            "$ref": "#/components/schemas/PoFieldComparison"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "quantity_open": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Open"
          },
          "quantity_remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Remaining"
          },
          "partial_quantity": {
            "type": "boolean",
            "title": "Partial Quantity",
            "default": false
          },
          "po_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po External Id"
          },
          "po_line_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Line External Id"
          },
          "po_product_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Product Number"
          },
          "po_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Description"
          },
          "po_unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Unit Of Measure"
          },
          "po_quantity_ordered": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Quantity Ordered"
          },
          "po_quantity_billed": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Quantity Billed"
          }
        },
        "type": "object",
        "required": [
          "quantity",
          "unit_price",
          "line_amount",
          "status"
        ],
        "title": "PoLineComparison"
      },
      "PoLineInvoiceMatch": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Number"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "line_amount": {
            "type": "string",
            "title": "Line Amount"
          },
          "posting_status": {
            "type": "string",
            "title": "Posting Status"
          },
          "match_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Match Status"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "line_amount",
          "posting_status"
        ],
        "title": "PoLineInvoiceMatch",
        "description": "One invoice item line matched to a PO line."
      },
      "POLineMatch": {
        "properties": {
          "invoice_line_index": {
            "type": "integer",
            "title": "Invoice Line Index"
          },
          "po_line_external_id": {
            "type": "string",
            "title": "Po Line External Id"
          },
          "match_basis": {
            "type": "string",
            "enum": [
              "product_code",
              "description_fuzzy",
              "price_quantity"
            ],
            "title": "Match Basis"
          },
          "match_score": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Match Score"
          },
          "quantity_ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Ok"
          },
          "unit_price_ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Price Ok"
          },
          "line_amount_ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line Amount Ok"
          },
          "quantity_open": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Open"
          },
          "quantity_remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Remaining"
          },
          "partial_quantity": {
            "type": "boolean",
            "title": "Partial Quantity",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "invoice_line_index",
          "po_line_external_id",
          "match_basis",
          "match_score"
        ],
        "title": "POLineMatch",
        "description": "One invoice line matched to one PO line."
      },
      "PoLineMatchesResponse": {
        "properties": {
          "po_external_id": {
            "type": "string",
            "title": "Po External Id"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/PoLineMatchSummary"
            },
            "type": "array",
            "title": "Lines"
          }
        },
        "type": "object",
        "required": [
          "po_external_id",
          "lines"
        ],
        "title": "PoLineMatchesResponse"
      },
      "PoLineMatchSummary": {
        "properties": {
          "po_line_external_id": {
            "type": "string",
            "title": "Po Line External Id"
          },
          "line_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Line Number"
          },
          "quantity_ordered": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Ordered"
          },
          "quantity_billed_in_erp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Billed In Erp"
          },
          "quantity_matched_pending": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Matched Pending"
          },
          "quantity_open": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Open"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/PoLineInvoiceMatch"
            },
            "type": "array",
            "title": "Invoices"
          }
        },
        "type": "object",
        "required": [
          "po_line_external_id",
          "quantity_matched_pending",
          "invoices"
        ],
        "title": "PoLineMatchSummary",
        "description": "A PO line’s quantities: ordered, billed in the ERP, matched on invoices in Calibre, and still open."
      },
      "POMatchResult": {
        "properties": {
          "po_external_id": {
            "type": "string",
            "title": "Po External Id"
          },
          "po_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Number"
          },
          "header_status": {
            "type": "string",
            "enum": [
              "ok",
              "closed",
              "not_found",
              "vendor_mismatch",
              "matching_not_required"
            ],
            "title": "Header Status",
            "default": "ok"
          },
          "match_status": {
            "type": "string",
            "enum": [
              "full",
              "partial",
              "none"
            ],
            "title": "Match Status",
            "default": "none"
          },
          "line_matches": {
            "items": {
              "$ref": "#/components/schemas/POLineMatch"
            },
            "type": "array",
            "title": "Line Matches"
          },
          "unmatched_invoice_line_indexes": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Unmatched Invoice Line Indexes"
          },
          "unmatched_po_line_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unmatched Po Line Ids"
          }
        },
        "type": "object",
        "required": [
          "po_external_id"
        ],
        "title": "POMatchResult",
        "description": "Match readiness for one resolved PO against the invoice's line items."
      },
      "PostingStateResponse": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "posting_status": {
            "type": "string",
            "title": "Posting Status"
          },
          "erp_connection_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp Connection Id"
          },
          "erp_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp Type"
          },
          "erp_document_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp Document Number"
          },
          "erp_internal_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp Internal Id"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted At"
          },
          "posting_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posting Error"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "posting_status"
        ],
        "title": "PostingStateResponse"
      },
      "PostRequestAcceptedResponse": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "posting_status": {
            "type": "string",
            "title": "Posting Status"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "posting_status"
        ],
        "title": "PostRequestAcceptedResponse",
        "description": "Confirms the posting request was accepted. Posting has not happened yet: check the invoice’s posting status or activity for the outcome."
      },
      "PostRequestInput": {
        "properties": {
          "connection_id": {
            "type": "string",
            "title": "Connection Id",
            "description": "The ERP connection to post through."
          }
        },
        "type": "object",
        "required": [
          "connection_id"
        ],
        "title": "PostRequestInput",
        "description": "Which ERP connection to post through."
      },
      "ProductRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hsn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hsn"
          },
          "unitPrice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitprice"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "ProductRead",
        "description": "A catalogue product, as the API returns it."
      },
      "ProductUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "hsn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hsn"
          },
          "unitPrice": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitprice"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ProductUpsert",
        "description": "A catalogue product, as you send it to sync or update."
      },
      "Provenance": {
        "properties": {
          "source_method": {
            "$ref": "#/components/schemas/ExtractionMethod"
          },
          "page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page"
          },
          "bboxes": {
            "items": {
              "$ref": "#/components/schemas/BBox"
            },
            "type": "array",
            "title": "Bboxes"
          },
          "token_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Token Ids"
          },
          "anchor_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor Text"
          },
          "template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "template_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Version"
          },
          "model_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Name"
          },
          "model_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Version"
          },
          "candidate_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Rank"
          },
          "derived_from": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/FieldKey"
                },
                {
                  "type": "string"
                }
              ]
            },
            "type": "array",
            "title": "Derived From"
          },
          "anchor_pack_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor Pack Version"
          },
          "extractor_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extractor Version"
          }
        },
        "type": "object",
        "required": [
          "source_method"
        ],
        "title": "Provenance",
        "description": "How a field was extracted: where on the page, the anchor text, and the method, model and version that produced it."
      },
      "PurchaseOrderLineRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "poExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Poexternalid"
          },
          "lineNumber": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linenumber"
          },
          "productNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Productnumber"
          },
          "productDescription": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Productdescription"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unitOfMeasure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitofmeasure"
          },
          "unitAmount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitamount"
          },
          "lineItemTotal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lineitemtotal"
          },
          "accountExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accountexternalid"
          },
          "dimensions": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          },
          "matchingType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matchingtype"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "PurchaseOrderLineRead",
        "description": "One line of a purchase order, as the API returns it."
      },
      "PurchaseOrderLineUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "lineNumber": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linenumber"
          },
          "productNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Productnumber"
          },
          "productDescription": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Productdescription"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unitOfMeasure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitofmeasure"
          },
          "unitAmount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unitamount"
          },
          "lineItemTotal": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lineitemtotal"
          },
          "accountExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accountexternalid"
          },
          "dimensions": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          },
          "matchingType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matchingtype"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PurchaseOrderLineUpsert",
        "description": "One line of a purchase order, sent inside the purchase order. Its `externalId` identifies the line. Leave `poExternalId` out: it comes from the parent purchase order."
      },
      "PurchaseOrderRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "poNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ponumber"
          },
          "vendorExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorexternalid"
          },
          "vendorName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorname"
          },
          "issuedOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuedon"
          },
          "deliverOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deliveron"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "paymentTermExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paymenttermexternalid"
          },
          "matchingType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matchingtype"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderLineRead"
            },
            "type": "array",
            "title": "Lineitems"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "PurchaseOrderRead",
        "description": "A purchase order with its lines, as the API returns it."
      },
      "PurchaseOrderUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "poNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ponumber"
          },
          "vendorExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorexternalid"
          },
          "vendorName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorname"
          },
          "issuedOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuedon"
          },
          "deliverOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deliveron"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "paymentTermExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paymenttermexternalid"
          },
          "matchingType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matchingtype"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderLineUpsert"
            },
            "type": "array",
            "title": "Lineitems"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PurchaseOrderUpsert",
        "description": "A purchase order, as you send it to sync or update."
      },
      "QueueDepthResponse": {
        "properties": {
          "needs_review_invoices": {
            "type": "integer",
            "title": "Needs Review Invoices"
          },
          "open_field_items": {
            "type": "integer",
            "title": "Open Field Items"
          }
        },
        "type": "object",
        "required": [
          "needs_review_invoices",
          "open_field_items"
        ],
        "title": "QueueDepthResponse",
        "description": "How much review work is waiting."
      },
      "ReaderSummary": {
        "properties": {
          "bundle_id": {
            "type": "string",
            "title": "Bundle Id"
          },
          "route": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Route"
          },
          "tiers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tiers"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "prompt_tokens": {
            "type": "integer",
            "minimum": 0,
            "title": "Prompt Tokens",
            "default": 0
          },
          "completion_tokens": {
            "type": "integer",
            "minimum": 0,
            "title": "Completion Tokens",
            "default": 0
          },
          "total_ms": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Ms"
          },
          "cache_hit": {
            "type": "boolean",
            "title": "Cache Hit",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "bundle_id",
          "status"
        ],
        "title": "ReaderSummary",
        "description": "Added in schema 1.5.0. The Reader model’s part in this result: which model bundle read the invoice, how long it took, and whether its values were used (`status`). Counts and IDs only."
      },
      "ReadinessReport": {
        "properties": {
          "schema_version": {
            "type": "string",
            "title": "Schema Version",
            "default": "1.3.0"
          },
          "vendors": {
            "items": {
              "$ref": "#/components/schemas/VendorReadinessRow"
            },
            "type": "array",
            "title": "Vendors"
          },
          "holdout": {
            "$ref": "#/components/schemas/HoldoutReport"
          },
          "blockers": {
            "items": {
              "$ref": "#/components/schemas/VendorBlockers"
            },
            "type": "array",
            "title": "Blockers"
          },
          "leverage": {
            "items": {
              "$ref": "#/components/schemas/BlockerRow"
            },
            "type": "array",
            "title": "Leverage"
          },
          "coverage": {
            "$ref": "#/components/schemas/LearningCoverage"
          }
        },
        "type": "object",
        "title": "ReadinessReport",
        "description": "The go-live signal: readiness for each vendor, with the forecast from held-out invoices beside it."
      },
      "RecordPaymentInput": {
        "properties": {
          "paid_date": {
            "type": "string",
            "format": "date-time",
            "title": "Paid Date",
            "description": "When the payment was made (ISO 8601)."
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Amount",
            "description": "The amount paid. May be less than the amount due."
          },
          "method": {
            "type": "string",
            "title": "Method",
            "description": "How it was paid, for example `bank_transfer`."
          },
          "reference": {
            "type": "string",
            "title": "Reference",
            "description": "Your reference for the payment, such as the bank’s UTR number."
          }
        },
        "type": "object",
        "required": [
          "paid_date",
          "amount",
          "method",
          "reference"
        ],
        "title": "RecordPaymentInput"
      },
      "ResolutionResult": {
        "properties": {
          "vendor": {
            "$ref": "#/components/schemas/ResolvedRef"
          },
          "pos": {
            "items": {
              "$ref": "#/components/schemas/ResolvedRef"
            },
            "type": "array",
            "title": "Pos"
          },
          "gl": {
            "items": {
              "$ref": "#/components/schemas/ResolvedRef"
            },
            "type": "array",
            "title": "Gl"
          },
          "payment_terms": {
            "$ref": "#/components/schemas/ResolvedRef"
          },
          "tax_codes": {
            "items": {
              "$ref": "#/components/schemas/ResolvedRef"
            },
            "type": "array",
            "title": "Tax Codes"
          },
          "dimensions": {
            "items": {
              "$ref": "#/components/schemas/ResolvedRef"
            },
            "type": "array",
            "title": "Dimensions"
          }
        },
        "type": "object",
        "title": "ResolutionResult"
      },
      "ResolvedRef": {
        "properties": {
          "resolved": {
            "type": "boolean",
            "title": "Resolved"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "match_basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Match Basis"
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "default": 0
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "detail_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail Code"
          }
        },
        "type": "object",
        "required": [
          "resolved"
        ],
        "title": "ResolvedRef"
      },
      "ResultIntegrity": {
        "properties": {
          "algorithm": {
            "type": "string",
            "const": "sha256/canonical-json-v1",
            "title": "Algorithm",
            "default": "sha256/canonical-json-v1"
          },
          "output_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "title": "Output Hash"
          },
          "signature": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signature"
          },
          "signing_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signing Key Id"
          },
          "signing_algorithm": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ECDSA_SHA_256",
                  "RSASSA_PSS_SHA_256"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Signing Algorithm"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "output_hash"
        ],
        "title": "ResultIntegrity",
        "description": "Added in schema 1.6.0. Proof that a stored result is exactly what Calibre produced. `output_hash` is the SHA-256 of the result’s canonical JSON (keys sorted, no insignificant whitespace), computed without this block; `algorithm` names the method. When signing is enabled, `signature` is a signature over that hash (base64), with the key and algorithm that made it."
      },
      "ReviewStatus": {
        "type": "string",
        "enum": [
          "auto_approved",
          "needs_review",
          "failed"
        ],
        "title": "ReviewStatus",
        "description": "Final routing decision for a document."
      },
      "RunResponse": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "total_invoices": {
            "type": "integer",
            "title": "Total Invoices"
          },
          "processed_invoices": {
            "type": "integer",
            "title": "Processed Invoices"
          },
          "matched_invoices": {
            "type": "integer",
            "title": "Matched Invoices"
          },
          "unverifiable_invoices": {
            "type": "integer",
            "title": "Unverifiable Invoices"
          },
          "failed_invoices": {
            "type": "integer",
            "title": "Failed Invoices"
          },
          "corrections_written": {
            "type": "integer",
            "title": "Corrections Written"
          },
          "jobs_by_state": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Jobs By State"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "state",
          "total_invoices",
          "processed_invoices",
          "matched_invoices",
          "unverifiable_invoices",
          "failed_invoices",
          "corrections_written"
        ],
        "title": "RunResponse",
        "description": "A bootstrap run’s state and counters."
      },
      "SchedulePaymentInput": {
        "properties": {
          "scheduled_date": {
            "type": "string",
            "format": "date-time",
            "title": "Scheduled Date",
            "description": "When you plan to pay (ISO 8601)."
          },
          "method": {
            "type": "string",
            "title": "Method",
            "description": "How you plan to pay, for example `bank_transfer`."
          }
        },
        "type": "object",
        "required": [
          "scheduled_date",
          "method"
        ],
        "title": "SchedulePaymentInput"
      },
      "SendVendorMessageInput": {
        "properties": {
          "subject": {
            "type": "string",
            "title": "Subject",
            "description": "The email subject."
          },
          "body": {
            "type": "string",
            "title": "Body",
            "description": "The email body."
          }
        },
        "type": "object",
        "required": [
          "subject",
          "body"
        ],
        "title": "SendVendorMessageInput"
      },
      "SpendByDimension": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "key",
          "label",
          "amount",
          "count"
        ],
        "title": "SpendByDimension",
        "description": "One row of a spend breakdown."
      },
      "SpendByVendorResponse": {
        "properties": {
          "vendors": {
            "items": {
              "$ref": "#/components/schemas/SpendByVendorRow"
            },
            "type": "array",
            "title": "Vendors"
          }
        },
        "type": "object",
        "required": [
          "vendors"
        ],
        "title": "SpendByVendorResponse",
        "description": "The vendors with the highest spend."
      },
      "SpendByVendorRow": {
        "properties": {
          "vendor_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "total_amount": {
            "type": "string",
            "title": "Total Amount"
          },
          "invoice_count": {
            "type": "integer",
            "title": "Invoice Count"
          }
        },
        "type": "object",
        "required": [
          "vendor_id",
          "vendor_name",
          "total_amount",
          "invoice_count"
        ],
        "title": "SpendByVendorRow",
        "description": "One vendor's total spend over the requested window."
      },
      "SplitRequestAcceptedResponse": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "parts": {
            "type": "integer",
            "title": "Parts"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "parts",
          "status"
        ],
        "title": "SplitRequestAcceptedResponse"
      },
      "SplitRequestInput": {
        "properties": {
          "parts": {
            "type": "integer",
            "title": "Parts",
            "description": "How many invoices the document holds.",
            "example": 2
          }
        },
        "type": "object",
        "required": [
          "parts"
        ],
        "title": "SplitRequestInput"
      },
      "StatusCountsResponse": {
        "properties": {
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "counts",
          "total"
        ],
        "title": "StatusCountsResponse",
        "description": "Invoice counts by review status."
      },
      "SubmitInvoiceForm": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File",
            "description": "The invoice PDF."
          },
          "truth": {
            "type": "string",
            "title": "Truth",
            "description": "The invoice as booked in your ERP, as a JSON string."
          }
        },
        "type": "object",
        "required": [
          "file",
          "truth"
        ],
        "title": "SubmitInvoiceForm",
        "description": "The multipart form for submitting one historical invoice."
      },
      "SyncResult": {
        "properties": {
          "received": {
            "type": "integer",
            "title": "Received"
          },
          "inserted": {
            "type": "integer",
            "title": "Inserted"
          },
          "updated": {
            "type": "integer",
            "title": "Updated"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "received",
          "inserted",
          "updated"
        ],
        "title": "SyncResult",
        "description": "How many records a sync received, created and updated."
      },
      "TaxableBases": {
        "properties": {
          "page": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page"
          },
          "total_minus_taxes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Minus Taxes"
          },
          "subtotal_plus_charges": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtotal Plus Charges"
          },
          "total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "applied": {
            "type": "string",
            "enum": [
              "vendor",
              "tenant",
              "page"
            ],
            "title": "Applied",
            "default": "page"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TaxableBases",
        "description": "Added in schema 1.7.0. Candidate taxable amounts for this invoice, from values found on the page. Each is `null` when it cannot be worked out.\n\n* `page`: the subtotal printed on the page.\n* `total_minus_taxes`: the total less every tax found.\n* `subtotal_plus_charges`: the page subtotal plus charges, less discounts.\n* `total`: the whole total, for ERPs that book no tax separately."
      },
      "TaxCodeRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "taxType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxtype"
          },
          "cgstRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cgstrate"
          },
          "sgstRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sgstrate"
          },
          "igstRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Igstrate"
          },
          "cessRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cessrate"
          },
          "rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate"
          },
          "tdsApplicable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tdsapplicable"
          },
          "isRecoverable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isrecoverable"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "TaxCodeRead",
        "description": "A tax code, as the API returns it."
      },
      "TaxCodeUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "taxType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxtype"
          },
          "cgstRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cgstrate"
          },
          "sgstRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sgstrate"
          },
          "igstRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Igstrate"
          },
          "cessRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cessrate"
          },
          "rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate"
          },
          "tdsApplicable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tdsapplicable"
          },
          "isRecoverable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isrecoverable"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TaxCodeUpsert",
        "description": "A tax code, as you send it to sync or update."
      },
      "TimeseriesPoint": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "value": {
            "type": "number",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "date",
          "value"
        ],
        "title": "TimeseriesPoint"
      },
      "UnitOfMeasureRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "shortName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shortname"
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Symbol"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "UnitOfMeasureRead",
        "description": "A unit of measure, as the API returns it."
      },
      "UnitOfMeasureUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "shortName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shortname"
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Symbol"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UnitOfMeasureUpsert",
        "description": "A unit of measure, as you send it to sync or update."
      },
      "UpdateDimensionSettingsInput": {
        "properties": {
          "enabled": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object",
            "title": "Enabled",
            "description": "Dimension types to switch on (`true`) or off (`false`), keyed by type. Only types synced from your ERP are accepted.",
            "example": {
              "COST_CENTRE": true,
              "PROJECT": false
            }
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "UpdateDimensionSettingsInput",
        "description": "Dimension types to switch on or off, keyed by type."
      },
      "UpdateInvoiceDimensionsInput": {
        "properties": {
          "dimensions": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Dimensions",
            "description": "The header dimensions to set, keyed by dimension type.",
            "example": {
              "COST_CENTRE": "CC-100",
              "PROJECT": null
            }
          }
        },
        "type": "object",
        "required": [
          "dimensions"
        ],
        "title": "UpdateInvoiceDimensionsInput",
        "description": "Header dimensions to set, keyed by dimension type. `null` clears one."
      },
      "UpdateInvoiceLinesInput": {
        "properties": {
          "expenses": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/InvoiceLineInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expenses",
            "description": "The expense lines. Omit to leave them unchanged."
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/InvoiceLineInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Items",
            "description": "The item lines. Omit to leave them unchanged."
          },
          "rematch": {
            "type": "boolean",
            "title": "Rematch",
            "default": true,
            "description": "Match item lines against the PO after saving. With `false`, the match is marked stale until you re-run it."
          }
        },
        "type": "object",
        "title": "UpdateInvoiceLinesInput"
      },
      "UpdatePoHeaderInput": {
        "properties": {
          "vendor_external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor External Id",
            "description": "The vendor’s `externalId` in your master data."
          },
          "po_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Po Number",
            "description": "The purchase order number, from your master data."
          },
          "rematch": {
            "type": "boolean",
            "title": "Rematch",
            "default": true,
            "description": "Match the lines again after the change. With `false`, the match is marked stale until you re-run it."
          }
        },
        "type": "object",
        "title": "UpdatePoHeaderInput"
      },
      "ValidateIrnRequest": {
        "properties": {
          "irn": {
            "type": "string",
            "title": "Irn",
            "description": "The e-invoice’s 64-character Invoice Reference Number."
          }
        },
        "type": "object",
        "required": [
          "irn"
        ],
        "title": "ValidateIrnRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "ValidationFinding": {
        "properties": {
          "tier": {
            "type": "integer",
            "enum": [
              1,
              2,
              3,
              4
            ],
            "title": "Tier"
          },
          "code": {
            "type": "string",
            "title": "Code"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "hard"
            ],
            "title": "Severity"
          },
          "field_keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Field Keys"
          },
          "detail_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail Code"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "code",
          "severity"
        ],
        "title": "ValidationFinding"
      },
      "ValidationResult": {
        "properties": {
          "findings": {
            "items": {
              "$ref": "#/components/schemas/ValidationFinding"
            },
            "type": "array",
            "title": "Findings"
          },
          "tier_pass": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object",
            "title": "Tier Pass"
          },
          "hard_fail": {
            "type": "boolean",
            "title": "Hard Fail",
            "default": false
          }
        },
        "type": "object",
        "title": "ValidationResult"
      },
      "VendorBankAccount": {
        "properties": {
          "accountNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accountnumber"
          },
          "ifsc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ifsc"
          },
          "iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iban"
          },
          "bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bic"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VendorBankAccount",
        "description": "One payee bank account as your ERP holds it: an IBAN, or an account number with its IFSC. A record that names no account is refused with 422."
      },
      "VendorBlockers": {
        "properties": {
          "vendor_key": {
            "type": "string",
            "title": "Vendor Key"
          },
          "invoices": {
            "type": "integer",
            "title": "Invoices",
            "default": 0
          },
          "auto_approved": {
            "type": "integer",
            "title": "Auto Approved",
            "default": 0
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/BlockerRow"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "vendor_key"
        ],
        "title": "VendorBlockers",
        "description": "Why one vendor’s invoices are not approved automatically, most fixable cause first."
      },
      "VendorIdentity": {
        "properties": {
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "pan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pan"
          },
          "name_norm": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name Norm"
          },
          "role": {
            "type": "string",
            "enum": [
              "supplier",
              "buyer",
              "unknown"
            ],
            "title": "Role",
            "default": "unknown"
          },
          "source_method": {
            "$ref": "#/components/schemas/ExtractionMethod",
            "default": "absent"
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "default": 0
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Provenance"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "VendorIdentity",
        "description": "Who the invoice says the vendor is."
      },
      "VendorMessage": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "to_email": {
            "type": "string",
            "title": "To Email"
          },
          "subject": {
            "type": "string",
            "title": "Subject"
          },
          "body": {
            "type": "string",
            "title": "Body"
          },
          "sent_by_user_id": {
            "type": "string",
            "title": "Sent By User Id"
          },
          "sent_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent By Name"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "title": "Sent At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "invoice_id",
          "to_email",
          "subject",
          "body",
          "sent_by_user_id",
          "sent_at"
        ],
        "title": "VendorMessage"
      },
      "VendorPerformanceRow": {
        "properties": {
          "vendor_external_id": {
            "type": "string",
            "title": "Vendor External Id"
          },
          "vendor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendor Name"
          },
          "invoice_count": {
            "type": "integer",
            "title": "Invoice Count"
          },
          "total_spend": {
            "type": "string",
            "title": "Total Spend"
          },
          "exception_rate": {
            "type": "number",
            "title": "Exception Rate"
          },
          "duplicate_count": {
            "type": "integer",
            "title": "Duplicate Count"
          },
          "avg_confidence": {
            "type": "number",
            "title": "Avg Confidence"
          },
          "gstin_valid": {
            "type": "boolean",
            "title": "Gstin Valid"
          },
          "on_time_rate": {
            "type": "number",
            "title": "On Time Rate"
          }
        },
        "type": "object",
        "required": [
          "vendor_external_id",
          "vendor_name",
          "invoice_count",
          "total_spend",
          "exception_rate",
          "duplicate_count",
          "avg_confidence",
          "gstin_valid",
          "on_time_rate"
        ],
        "title": "VendorPerformanceRow"
      },
      "VendorRead": {
        "properties": {
          "externalId": {
            "type": "string",
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive"
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletedat"
          },
          "companyExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Companyexternalid"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "street1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street1"
          },
          "street2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street2"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postalcode"
          },
          "countryCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countrycode"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "paymentTermExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paymenttermexternalid"
          },
          "vendorGroupExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorgroupexternalid"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "pan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pan"
          },
          "tan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tan"
          },
          "cin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cin"
          },
          "msmeNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Msmenumber"
          },
          "taxId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxid"
          },
          "taxIdType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxidtype"
          },
          "vatNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vatnumber"
          },
          "ein": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ein"
          },
          "isCompositionDealer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iscompositiondealer"
          },
          "isSez": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issez"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "externalId",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "title": "VendorRead",
        "description": "A vendor, as the API returns it."
      },
      "VendorReadinessRow": {
        "properties": {
          "vendor_key": {
            "type": "string",
            "title": "Vendor Key"
          },
          "invoices_processed": {
            "type": "integer",
            "title": "Invoices Processed"
          },
          "auto_approve_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Approve Rate"
          },
          "critical_field_accuracy": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Critical Field Accuracy"
          },
          "weak_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Weak Fields"
          },
          "template_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Status"
          },
          "ready_for_production": {
            "type": "boolean",
            "title": "Ready For Production",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "vendor_key",
          "invoices_processed",
          "auto_approve_rate"
        ],
        "title": "VendorReadinessRow",
        "description": "One vendor's readiness summary in the readiness report."
      },
      "VendorUpsert": {
        "properties": {
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalid"
          },
          "externalUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Externalupdatedat"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "externalData": {
            "additionalProperties": true,
            "type": "object",
            "title": "Externaldata"
          },
          "companyExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Companyexternalid"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "street1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street1"
          },
          "street2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street2"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "State"
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postalcode"
          },
          "countryCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Countrycode"
          },
          "currencyCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currencycode"
          },
          "paymentTermExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paymenttermexternalid"
          },
          "vendorGroupExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vendorgroupexternalid"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "pan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pan"
          },
          "tan": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tan"
          },
          "cin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cin"
          },
          "msmeNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Msmenumber"
          },
          "taxId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxid"
          },
          "taxIdType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxidtype"
          },
          "vatNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vatnumber"
          },
          "ein": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ein"
          },
          "isCompositionDealer": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iscompositiondealer"
          },
          "isSez": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issez"
          },
          "bankAccounts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/VendorBankAccount"
                },
                "type": "array",
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Bankaccounts"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VendorUpsert",
        "description": "A vendor, as you send it to sync or update. `bank_accounts` is write-only: a sync replaces the vendor’s known accounts with the ones you send (none, if you send none), and an update changes them only when you include them. Calibre keeps fingerprints of the accounts, never the numbers."
      },
      "VerdictRequest": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "qa",
              "review"
            ],
            "title": "Kind",
            "description": "`qa` for a QA sample of an automatically approved invoice, `review` for an invoice a person reviewed.",
            "example": "qa"
          },
          "wrong_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 16,
            "title": "Wrong Fields",
            "description": "The critical fields that were wrong. Empty when every critical field was right. At most 16.",
            "example": [
              "total_amount"
            ]
          },
          "review_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 86400,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Seconds",
            "description": "How long the review took, in seconds, if you measured it."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind"
        ],
        "title": "VerdictRequest",
        "description": "A reviewer's verdict on one invoice."
      },
      "VerdictResponse": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "state": {
            "type": "string",
            "enum": [
              "passed",
              "failed"
            ],
            "title": "State"
          },
          "wrong_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Wrong Fields"
          },
          "qa_samples": {
            "type": "integer",
            "title": "Qa Samples"
          },
          "qa_failures": {
            "type": "integer",
            "title": "Qa Failures"
          },
          "qa_lower_bound": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Lower Bound"
          },
          "breach": {
            "type": "boolean",
            "title": "Breach"
          },
          "tau_floor": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tau Floor"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "state",
          "wrong_fields",
          "qa_samples",
          "qa_failures",
          "qa_lower_bound",
          "breach",
          "tau_floor"
        ],
        "title": "VerdictResponse"
      },
      "WeeklyScorecard": {
        "properties": {
          "schema_version": {
            "type": "string",
            "const": "1.0.0",
            "title": "Schema Version",
            "default": "1.0.0"
          },
          "tenant_id": {
            "type": "string",
            "title": "Tenant Id"
          },
          "week_start": {
            "type": "string",
            "format": "date",
            "title": "Week Start"
          },
          "week_end": {
            "type": "string",
            "format": "date",
            "title": "Week End"
          },
          "invoices": {
            "type": "integer",
            "title": "Invoices"
          },
          "stp": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stp"
          },
          "qa_samples": {
            "type": "integer",
            "title": "Qa Samples"
          },
          "qa_failures": {
            "type": "integer",
            "title": "Qa Failures"
          },
          "qa_precision": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Precision"
          },
          "qa_lower_bound": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qa Lower Bound"
          },
          "verified": {
            "type": "integer",
            "title": "Verified"
          },
          "correction_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Correction Rate"
          },
          "field_correction_rate": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Field Correction Rate"
          },
          "median_review_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Median Review Seconds"
          },
          "cpci_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpci Seconds"
          },
          "first_invoice_of_vendor_verified": {
            "type": "integer",
            "title": "First Invoice Of Vendor Verified"
          },
          "first_invoice_of_vendor_accuracy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Invoice Of Vendor Accuracy"
          },
          "active_bundle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Bundle"
          },
          "active_bundle_gate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Bundle Gate"
          },
          "frozen_set_accuracy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frozen Set Accuracy"
          },
          "cohorts": {
            "items": {
              "$ref": "#/components/schemas/CohortRow"
            },
            "type": "array",
            "title": "Cohorts"
          },
          "cold_start_slope": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cold Start Slope"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tenant_id",
          "week_start",
          "week_end",
          "invoices",
          "stp",
          "qa_samples",
          "qa_failures",
          "qa_precision",
          "qa_lower_bound",
          "verified",
          "correction_rate",
          "field_correction_rate",
          "median_review_seconds",
          "cpci_seconds",
          "first_invoice_of_vendor_verified",
          "first_invoice_of_vendor_accuracy",
          "active_bundle",
          "active_bundle_gate",
          "frozen_set_accuracy",
          "cohorts",
          "cold_start_slope"
        ],
        "title": "WeeklyScorecard",
        "description": "One week of automation results for your organisation."
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from the client-credentials grant. See Authentication."
      }
    }
  }
}