{
  "openapi": "3.0.1",
  "info": {
    "title": "Self Learning Automation API (Sandbox Version)",
    "description": "Offer your customers automation of data entry from financial documents and categorization of incoming files.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.azora.one/sandbox/v1"
    }
  ],
  "paths": {
    "/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Retrieve all companies",
        "description": "Last updated: 2025-07-01\n\n<p>A GET request to this endpoint returns a list of all companies created in AzoraOne, including both active and inactive companies.</p>\n\n<p>The operation is highly flexible, allowing you to sort, paginate, and filter the results using query parameters. You can optionally request metrics (<code>metrics=true</code>) to include per-company file-processing statistics.</p>\n\n<p>This operation is ideal for dashboards, reporting tools, or support consoles that need a full view of all companies and their processing metrics.</p>\n\n<p><b>Note:</b> you cannot fetch all companies with metrics in a single call — if you need metrics for every company, you must page through the result set (<code>pageNumber</code>, <code>pageSize</code>) with <code>metrics=true</code> on each request. <code>pageSize</code> cannot exceed 30.</p>",
        "operationId": "retrieve-all-companies",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filters to only active (true) or only inactive (false) companies. Omit to include both."
          },
          {
            "name": "companyProxy",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filters to companies with this exact <code>companyProxy</code> value."
          },
          {
            "name": "countryOfOrigin",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filters to companies with this exact <code>countryOfOrigin</code> value. Must be formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>."
          },
          {
            "name": "createdFrom",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filters to companies created on or after this date. Formatted as yyyy-MM-dd HH:mm:ss. Must be earlier than <code>createdTo</code> if both are supplied."
          },
          {
            "name": "createdTo",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filters to companies created on or before this date. Formatted as yyyy-MM-dd HH:mm:ss. Must be later than <code>createdFrom</code> if both are supplied."
          },
          {
            "name": "metrics",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "When true, populates per-company metrics (<code>data.companies[].metrics</code>) — see the <a href=\"#response-schema\">response schema below</a> for its shape. Requires <code>pageNumber</code> and <code>pageSize</code> to also be supplied. Defaults to false."
          },
          {
            "name": "conformityFilters",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the conformity calculation used for each company's <code>metrics.files.types[].averageConformity</code> to a specific set of fields. Only takes effect when <code>metrics=true</code> — otherwise it has no effect. Accepts a comma-separated list of field names, chosen from: for receipts — <code>receiptDate</code>, <code>description</code>, <code>accounts</code>; for supplier invoices — <code>supplier</code>, <code>description</code>, <code>invoiceDate</code>, <code>dueDate</code>, <code>invoiceNumber</code>, <code>ocrNumber</code>, <code>refNumber</code>, <code>orderNumber</code>, <code>ourRef</code>, <code>yourRef</code>, <code>totalSum</code>, <code>vat</code>, <code>accounts</code>."
          },
          {
            "name": "fileCreatedFrom",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the files included in each company's metrics aggregation to those created on or after this date. Only takes effect when <code>metrics=true</code> — otherwise it is ignored. Formatted as yyyy-MM-dd HH:mm:ss."
          },
          {
            "name": "fileCreatedTo",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the files included in each company's metrics aggregation to those created on or before this date. Only takes effect when <code>metrics=true</code> — otherwise it is ignored. Formatted as yyyy-MM-dd HH:mm:ss."
          },
          {
            "name": "fileFormat",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "jpg",
                "png",
                "xml"
              ]
            },
            "description": "Restricts the files included in each company's metrics aggregation to a specific file format. Only takes effect when <code>metrics=true</code> — otherwise it is ignored."
          },
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1-based page index. Required together with <code>pageSize</code> when <code>metrics=true</code>; if either <code>pageNumber</code> or <code>pageSize</code> is supplied, both are required."
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Items per page. Cannot exceed 30. Required together with <code>pageNumber</code> when <code>metrics=true</code>; if either <code>pageNumber</code> or <code>pageSize</code> is supplied, both are required."
          },
          {
            "name": "sortField",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "companyName",
                "companyID",
                "companyProxy",
                "createdDateUTC",
                "countryOfOrigin",
                "supplierInvoiceConformity",
                "receiptConformity",
                "uploadedCount",
                "completeCount"
              ]
            },
            "description": "Field to sort by. When <code>metrics=false</code> (default), one of <code>companyName</code>, <code>companyID</code>, <code>companyProxy</code>, <code>createdDateUTC</code>, <code>countryOfOrigin</code>. When <code>metrics=true</code>, additionally accepts <code>supplierInvoiceConformity</code>, <code>receiptConformity</code>, <code>uploadedCount</code>, <code>completeCount</code>. Defaults to createdDateUTC if omitted."
          },
          {
            "name": "sortDirection",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Sort direction: <code>asc</code> or <code>desc</code>. Defaults to <code>asc</code>."
          },
          {
            "name": "companyName",
            "in": "query",
            "description": "Filters to companies whose name contains this text (case-insensitive, partial match).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filesAvailable",
            "in": "query",
            "description": "Filters to companies that do (true) or don't (false) have at least one file matching <code>fileCreatedFrom</code>/<code>fileCreatedTo</code>/<code>fileFormat</code>. Requires <code>metrics=true</code> — supplying this without <code>metrics=true</code> returns a 400 error.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyListResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "companies": [
                      {
                        "companyID": "1",
                        "companyName": "SmallCorp",
                        "companyProxy": "Account Group Inc",
                        "active": true,
                        "precognition": {
                          "active": false
                        },
                        "corporateIdentityNumber": "",
                        "bankAccountNumber": "",
                        "plusGiroNumber": "",
                        "iban": "",
                        "vatNumber": "",
                        "countryOfOrigin": "",
                        "createdDate": "2024-01-02 05:49:07",
                        "metrics": null
                      },
                      {
                        "companyID": "4",
                        "companyName": "SmallCorp",
                        "companyProxy": "Account Group Inc",
                        "active": true,
                        "precognition": {
                          "active": false
                        },
                        "corporateIdentityNumber": "",
                        "bankAccountNumber": "",
                        "plusGiroNumber": "",
                        "iban": "",
                        "vatNumber": "",
                        "countryOfOrigin": "",
                        "createdDate": "2024-01-02 07:07:22",
                        "metrics": null
                      }
                    ]
                  },
                  "extended": "",
                  "meta": {
                    "pagination": {
                      "pageNumber": 1,
                      "pageSize": 5,
                      "totalItems": 15,
                      "totalPages": 3
                    },
                    "updated": "2026-08-05 09:20:12"
                  },
                  "origin": "",
                  "time": "2026-08-05 09:20:30"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 101151,
                      "message": "Missing required query parameter",
                      "details": "pageNumber is required when metrics=true",
                      "element": "PageNumber"
                    },
                    {
                      "code": 101151,
                      "message": "Missing required query parameter",
                      "details": "pageSize is required when metrics=true",
                      "element": "PageSize"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:45:42"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-22 06:40:59"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Companies"
        ],
        "summary": "Add a company",
        "description": "Last updated: 2025-04-02\n\n<img style=\"width:100%; max-width:800px;\"\nsrc=\"https://apimgmtstmczul04oe76zn3s.blob.core.windows.net/content/e95e0bd6-9029-214b-a813-d70f2809566f\">\n\n<p>Adding a company is the one-time initial step. Once it exists, the file workflow — add a file, extract data, bookkeep data — repeats against it.</p>\n\n<p>A company acts as a container for accumulated knowledge. It will separate accumulated knowledge so that company-specific preferences will not spill over to other companies. To inherit knowledge between companies, you will need to use progenitors.</p>\n\n<p>You will need to add a company in order to:</p>\n<ul>\n    <li>Add files</li>\n    <li>Add suppliers</li>\n    <li>Add progenitors</li>\n    <li>Extract data from documents</li>\n    <li>Bookkeep data to documents</li>\n</ul>\n\n<p>We recommend that you implement formatting rules on the input fields in your application to help your users achieve more consistent data and better extraction results. We apply very light or no formatting rules on values associated with some country codes, and may add or tighten formatting rules on individual parameters where it benefits the service. See the request schema below for the formatting and validation rules for each field.</p>",
        "operationId": "add-a-company",
        "parameters": [
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyItem"
              },
              "example": {
                "companyID": "1",
                "companyName": "SmallCorp",
                "companyProxy": "Account Group Inc",
                "active": true,
                "precognition": {
                  "active": false
                },
                "corporateIdentityNumber": "556754-9273",
                "bankAccountNumber": "310-6093",
                "plusGiroNumber": "477451-9",
                "iban": "",
                "vatNumber": "SE556754927301",
                "countryOfOrigin": "SE"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "companyID": "1",
                    "companyName": "SmallCorp",
                    "companyProxy": "Account Group Inc",
                    "active": true,
                    "precognition": {
                      "active": false
                    },
                    "corporateIdentityNumber": "556754-9273",
                    "bankAccountNumber": "310-6093",
                    "plusGiroNumber": "477451-9",
                    "iban": "",
                    "vatNumber": "SE556754927301",
                    "countryOfOrigin": "SE",
                    "createdDate": "",
                    "metrics": null
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-10-26 11:35:54"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    },
                    {
                      "code": 113102,
                      "message": "Corporate identity number is not valid.",
                      "details": "",
                      "element": "corporateIdentityNumber"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:45:42"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:40:59"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Retrieve a company",
        "description": "Last updated: 2025-04-02\n\n<p>In order to retrieve a company that has been added to AzoraOne, send a GET request to this endpoint.</p>\n\n<p>The request URL must include the <code>companyID</code> of the company you want to retrieve. If successful, the request returns a 200 response with the company in the <code>data</code> object.</p>",
        "operationId": "retrieve-a-company",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "When set to true, the response's <code>data.metrics</code> object is populated with aggregated processing statistics for the company — see the <a href=\"#response-schema\">response schema below</a> for its shape. Defaults to false."
          },
          {
            "name": "conformityFilters",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the conformity calculation used for <code>data.metrics.files.types[].averageConformity</code> to a specific set of fields. Only takes effect when <code>metrics=true</code> — otherwise it has no effect. Accepts a comma-separated list of field names, chosen from: for receipts — <code>receiptDate</code>, <code>description</code>, <code>accounts</code>; for supplier invoices — <code>supplier</code>, <code>description</code>, <code>invoiceDate</code>, <code>dueDate</code>, <code>invoiceNumber</code>, <code>ocrNumber</code>, <code>refNumber</code>, <code>orderNumber</code>, <code>ourRef</code>, <code>yourRef</code>, <code>totalSum</code>, <code>vat</code>, <code>accounts</code>."
          },
          {
            "name": "fileCreatedFrom",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the files included in the metrics aggregation to those created on or after this date. Only takes effect when <code>metrics=true</code> — otherwise it is ignored. Formatted as yyyy-MM-dd HH:mm:ss."
          },
          {
            "name": "fileCreatedTo",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restricts the files included in the metrics aggregation to those created on or before this date. Only takes effect when <code>metrics=true</code> — otherwise it is ignored. Formatted as yyyy-MM-dd HH:mm:ss."
          },
          {
            "name": "fileFormat",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "jpg",
                "png",
                "xml"
              ]
            },
            "description": "Restricts the files included in the metrics aggregation to a specific file format. Only takes effect when <code>metrics=true</code> — otherwise it is ignored."
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDetailResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "companyID": "1",
                    "companyName": "SmallCorp",
                    "companyProxy": "Account Group Inc",
                    "active": true,
                    "precognition": {
                      "active": false
                    },
                    "corporateIdentityNumber": "556754-9273",
                    "bankAccountNumber": "310-6093",
                    "plusGiroNumber": "477451-9",
                    "iban": "",
                    "vatNumber": "SE556754927301",
                    "countryOfOrigin": "SE",
                    "metrics": {
                      "files": {
                        "uploadedCount": 1582,
                        "extractedCount": 1566,
                        "bookedCount": 1396,
                        "extractedAndBookedCount": 1393,
                        "extractedByBricksCount": 51,
                        "averageConformity": 80.87,
                        "types": [
                          {
                            "type": "SupplierInvoice",
                            "averageConformity": 89.97,
                            "extractedCount": 355,
                            "bookedCount": 296,
                            "extractedAndBookedCount": 296
                          },
                          {
                            "type": "Receipt",
                            "averageConformity": 78.23,
                            "extractedCount": 1211,
                            "bookedCount": 1100,
                            "extractedAndBookedCount": 1097
                          }
                        ]
                      },
                      "bricks": null
                    }
                  },
                  "extended": "",
                  "meta": {
                    "created": "2026-08-05 08:37:45",
                    "subscriptionStart": "2026-08-05 08:37:46",
                    "lastActivated": "2026-08-05 08:37:46",
                    "lastDeactivated": "",
                    "cycleLength": "0100",
                    "cycleEnd": "2026-09-05 08:37:46",
                    "lastDebited": "",
                    "debitable": true,
                    "pagination": null,
                    "updated": "2026-08-05 08:38:32"
                  },
                  "origin": "",
                  "time": "2020-10-30 11:37:36"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:45:42"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:44:18"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-22 06:52:33"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Companies"
        ],
        "summary": "Update a company",
        "description": "Last updated: 2025-04-02\n\n<p><b>Note:</b> when updating a resource, new information overwrites the existing information — this is a full replace, not a partial update. The <code>companyID</code> in the request URL must match the <code>companyID</code> in the request body.</p>\n\n<p>If none of the values you send differ from the company's current values, no database write occurs — the operation still returns 200 with your submitted data.</p>\n\n<p>Changing <code>active</code> also updates the company's subscription/billing metadata (see the <code>meta</code> object on Retrieve a company) — for example, reactivating a company after its billing cycle has ended starts a new subscription period.</p>\n\n<p>See the request schema below for the formatting and validation rules for each field.</p>",
        "operationId": "update-a-company",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyItem"
              },
              "example": {
                "companyID": "1",
                "companyName": "SmallCorp",
                "companyProxy": "Account Group Inc",
                "active": true,
                "precognition": {
                  "active": false
                },
                "corporateIdentityNumber": "556754-9273",
                "bankAccountNumber": "310-6093",
                "plusGiroNumber": "477451-9",
                "iban": "",
                "vatNumber": "SE556754927301",
                "countryOfOrigin": "SE"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "companyID": "1",
                    "companyName": "SmallCorp",
                    "companyProxy": "Account Group Inc",
                    "active": true,
                    "precognition": {
                      "active": false
                    },
                    "corporateIdentityNumber": "556754-9273",
                    "bankAccountNumber": "310-6093",
                    "plusGiroNumber": "477451-9",
                    "iban": "",
                    "vatNumber": "SE556754927301",
                    "countryOfOrigin": "SE",
                    "createdDate": "",
                    "metrics": null
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-05 09:39:21"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    },
                    {
                      "code": 113102,
                      "message": "Corporate identity number is not valid.",
                      "details": "",
                      "element": "corporateIdentityNumber"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:45:42"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 06:44:18"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-22 06:52:33"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files/{fileID}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Retrieve a file",
        "description": "Last updated: 2026-08-05\n\n<div class=\"description\">\n  <p>In order to retrieve the file object of a file that has been uploaded to AzoraOne, send a GET request to this operation.</p>\n  <p>The request URL must include the <i>companyID</i> of the company that the file was added to and the <i>fileID</i> of the file that you want to retrieve.</p>\n  <p>If successful, the request will return a 200 HTTP response with the file object included in the response body. See the Response schema below for its exact fields.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> Note:\n    <p>The file object doesn't include the actual file data (for example, a PDF or image). To retrieve its contents, call the <a href=\"/docs/files/retrieve-file-details\">Retrieve file details</a> operation.</p>\n  </div>\n</div>",
        "operationId": "retrieve-a-file",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "conformity",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>conformity</code> field is populated — see <a href=\"#response-schema\">ConformityItem</a> and the Quality &amp; Performance documentation for the calculation logic. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "conformityFilters",
            "in": "query",
            "description": "Restricts the conformity calculation to specific fields. Allowed only together with <code>conformity=true</code>; supplying it without <code>conformity=true</code> results in 400 response. Accepts a comma-separated list of field names: for receipts, <code>receiptDate</code>, <code>description</code> or <code>accounts</code>; for supplier invoices, <code>supplier</code>, <code>description</code>, <code>invoiceDate</code>, <code>dueDate</code>, <code>invoiceNumber</code>, <code>ocrNumber</code>, <code>refNumber</code>, <code>orderNumber</code>, <code>ourRef</code>, <code>yourRef</code>, <code>totalSum</code>, <code>vat</code> or <code>accounts</code>. See the Quality &amp; Performance and Field Filtering documentation for full details.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "summary",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>summary</code> field is populated with the file's most recent extraction and booking events — see <a href=\"#response-schema\">SummaryItem</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "fileID": "100",
                    "fileName": "telavox.pdf",
                    "status": "WAITING",
                    "type": "",
                    "verificationSeries": "",
                    "createdDate": "2025-06-02 06:01:04",
                    "conformity": {
                      "value": 71.43
                    },
                    "summary": {
                      "latestExtraction": {
                        "eventDate": "2025-06-02 06:03:38",
                        "type": "SupplierInvoice",
                        "supplierID": "",
                        "ancestor": "None"
                      },
                      "latestBooking": {
                        "eventDate": "2025-06-02 06:04:29",
                        "type": "SupplierInvoice",
                        "supplierID": "f79bf884-be9f-4829-a4ed-b1df0062af68"
                      }
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-30 07:54:49"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211402,
                      "message": "File ID is not valid.",
                      "details": "",
                      "element": "fileID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-30 08:04:02"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Files"
        ],
        "summary": "Update a file",
        "description": "Last updated: 2026-08-05\n\n<div class=\"description\">\n  <p>The update a file operation is optional and can be used to teach AzoraOne how to sort incoming files. For example, when the user moves a file from one view or verification series to another in your application, you can let AzoraOne know by updating the <i>files</i> resource. This allows for the sorting to be expanded into a third type (named Other) and eliminates the need for implementing the Bookkeep operation in order to learn AzoraOne how a file should be categorized.</p>\n  <p>Generally, in the AzoraOne API, when using PUT, it is assumed that you are sending the complete object, and that complete object replaces any existing object at that URI. However, the files resource allows the use of the HTTP method PATCH in order to modify, or \"patch\", only a selection of parameters in the existing object. For now, the AzoraOne API allows for patching of the <i>type</i> and <i>verificationSeries</i> parameters only. Upon patching of one or both parameters, AzoraOne will instantly be given feedback on, and learn, how the file should be categorized from now on.</p>\n  <p>In order to update an existing file with new values, send a PATCH request to this operation.</p>\n  <p>The request URL must include a unique identifier (i.e. <i>fileID</i>). Include new values for the <i>type</i> and/or <i>verificationSeries</i> parameter in the request body — see the <a href=\"#request-schema\">Request schema below</a>. Since PATCH only updates the fields that are supplied, you only need to supply values for the parameters you want to change. Parameters not included will be left unchanged in the API.</p>\n  <p>The request will update the file object with new values for the <i>type</i> and/or <i>verificationSeries</i> parameters. If successful, the request will return a 200 HTTP response with the updated file object included in the response body — see the <a href=\"#response-schema\">Response schema below</a>.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> Note:\n    <p>A file can only be patched once its <i>status</i> has reached <code>READY</code> or later (READY, EXTRACTED, BOOKED or COMPLETE). Patching a file that is still <code>WAITING</code> returns a 412 response; patching a file that could not be processed returns a 400 response. See the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation for the full set of status values.</p>\n  </div>\n</div>\n\n<b>NOTE:</b> When updating a resource, new information will overwrite the existing information.",
        "operationId": "update-a-file",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileMoveInput"
              },
              "example": {
                "type": "Receipt",
                "verificationSeries": "A"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUpdateResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "fileID": "100",
                    "fileName": "telavox.pdf",
                    "status": "READY",
                    "type": "Receipt",
                    "verificationSeries": "A",
                    "createdDate": "2025-06-02 06:01:04",
                    "conformity": null,
                    "summary": null
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-30 07:54:49"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211101,
                      "message": "All parameters are missing.",
                      "details": "At least destination Type or destination Series must be given.",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-05-29 08:35:17"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-05-29 08:35:17"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files/{fileID}/supplierInvoices": {
      "get": {
        "tags": [
          "Supplier invoices"
        ],
        "summary": "Extract data from an invoice",
        "description": "Last updated: 2025-04-02\n\n<div class=\"description\">\n  <img style=\"width:100%; max-width:800px;\"\nsrc=\"https://apimgmtstmczul04oe76zn3s.blob.core.windows.net/content/27d44aba-8dd1-a5b9-2c96-6d3d7bbfa1d5\">\n  <p>A GET request to the <i>supplierInvoices</i> endpoint is used to extract data from a supplier invoice (or other files that matches the supplierInvoices representation). Supply the unique file ID from your file upload request, and AzoraOne will return extracted data from the supplier invoice:</p>\n <p>By adding the verification series (if known) as a query parameter, you will decrease the time for extraction and potentially improve the accuracy of the result since faulty positives from other series will not interfere with the result.</p>\n <p>If successful, the request will return a 200 HTTP response with the supplier invoice object included in the response body.</p>\n  <p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can also mean the file could not be processed — its extraction status has moved past the point where it can still be extracted from.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>fileID</i> itself wasn't found.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>\n  <p>Provided that a supplier invoice has previously been uploaded and bookkept, the user can begin to reap the benefits of self-learning automation. From now on, your application can offer extraction of data from every single invoice that is uploaded to AzoraOne.</p>\n <h5>The extended supplier invoice object</h5>\n  <p>In addition to traditional bookkeeping data, you can choose to extract additional information from a supplier invoice.</p>\n  <p>The extended data do not feature any feedback mechanism (as opposed to the values in the original data object). Thus, you should not expect the accuracy of the values to increase with use. Nevertheless, the extended feature can provide you with additional insight into the files that your users upload to the AzoraOne API service.</p>\n\t   <p>In order to obtain the values from the parameters of the extended object, you will need to set the query parameter <i>extended</i> to true when sending a GET request to the <i>supplierInvoices</i> endpoint. If the parameter is not set, it will be interpreted as false and you will not receive any extended data.</p>\n  <p>See the <a href=\"#response-schema\">response schema below</a> for the full list of extended fields and their formats.</p>\n <h5>The origin supplier invoice object</h5>\n  <p>In addition to extended data, you can choose to extract origin data from a supplier invoice — see the <a href=\"#response-schema\">response schema below</a> for the ancestorType/companyID fields and what each ancestorType value means.</p>\n  <p>We will add new parameters over time, if you have any suggestions of what you would like to see in the future, get in touch with us!</p>\n</div>",
        "operationId": "extract-data-from-an-invoice",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2"
            }
          },
          {
            "name": "verificationSeries",
            "in": "query",
            "description": "Restricts extraction to a specific verification series. Decreases extraction time and can improve accuracy, since false positives from other series won't interfere with the result. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>; an invalid value returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "A"
            }
          },
          {
            "name": "extended",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>extended</code> field is populated with additional, non-feedback-corrected data extracted from the invoice — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "origin",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>origin</code> field is populated with information on what model generated the extraction result — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoiceResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "supplierID": "1",
                    "description": "Telavox invoice",
                    "verificationSeries": "A",
                    "invoiceDate": "2020-05-03",
                    "dueDate": "",
                    "invoiceNumber": "",
                    "ocrNumber": "707902514856",
                    "referenceNumber": "12345",
                    "orderNumber": "12345",
                    "ourRef": "Emma Example",
                    "yourRef": "Tony Test",
                    "totalSum": "3119,00",
                    "vat": "623,82",
                    "accounts": [
                      {
                        "account": "1790",
                        "periodicity": {
                          "offsetAccount": "6210",
                          "startDate": "2020-05-01",
                          "endDate": "2021-04-30"
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "2495,29",
                        "credit": "0,00"
                      },
                      {
                        "account": "3740",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "0,11"
                      }
                    ]
                  },
                  "extended": {
                    "dates": [
                      "2020-05-03",
                      "2020-05-01",
                      "2021-04-30"
                    ],
                    "times": [
                      "2026-08-04"
                    ],
                    "emails": [
                      "info@arkimera.se"
                    ],
                    "currencies": [
                      "SEK"
                    ],
                    "creditCardNumbers": [],
                    "corporateIdentityNumbers": [
                      "556600-7786"
                    ],
                    "bankAccountNumbers": [
                      "5677-6487"
                    ],
                    "plusGiroNumbers": [],
                    "ibans": [
                      "SE1150000000056241002716",
                      "NL91ABNA0417164300"
                    ],
                    "bic": [
                      "ESSESESS"
                    ],
                    "vatNumbersByCountry": {
                      "SE": [
                        "SE556600778601",
                        "SE559108741501"
                      ],
                      "NL": [
                        "NL001234567B01"
                      ]
                    },
                    "corporateIdentityNumbersByCountry": {
                      "SE": [
                        "5566007786",
                        "5020765649"
                      ],
                      "NL": [
                        "12345678"
                      ]
                    },
                    "countryOfOrigin": "SE"
                  },
                  "meta": "",
                  "origin": {
                    "ancestor": {
                      "ancestorType": "None",
                      "companyID": "23"
                    }
                  },
                  "time": "2020-07-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:39:34"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:41:59"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Supplier invoices"
        ],
        "summary": "Bookkeep an invoice",
        "description": "Last updated: 2025-04-02\n\n<div class=\"description\">\n  <img style=\"width:100%; max-width:800px;\"\nsrc=\"https://apimgmtstmczul04oe76zn3s.blob.core.windows.net/content/be0c49a4-aefa-5597-18af-4af26e7db2e7\">\n  <p>An integral part of AzoraOne is the built-in self-learning capability. In order to learn, AzoraOne must have the correct input data. We think the user, be it the small business owner or a professional accountant, knows the company best. Consequently, we use the data generated by the user upon bookkeeping as our learning data. To enable this, send a PUT request to the <i>supplierInvoices</i> endpoint when the user presses the bookkeep button in your application.</p>\n  <p>The request will update the supplier invoice object with the correct values. </p>\n  <p>If successful, the request will return a 200 HTTP response with the supplier invoice object included in the response body. As a side effect, the file's status is always advanced to <code>BOOKED</code> once bookkeeping succeeds, regardless of what its status was before.</p>\n  <p><b>Note on the 400 response:</b> most causes are field-level validation failures — see the <a href=\"#request-schema\">request schema below</a> for each field's rules. The two other causes are the file itself being unprocessable, and <code>totalSum</code>, <code>vat</code> and the account rows' <code>debit</code>/<code>credit</code> failing to balance: <code>totalSum</code> must equal <code>vat</code> plus the sum of every row's <code>debit</code> minus the sum of every row's <code>credit</code> (tolerance ±0.001) — otherwise the request returns \"Debit and credit do not balance.\"</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>fileID</i> wasn't found, or that a non-empty <i>supplierID</i> you submitted doesn't resolve to an existing supplier.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>\n  <h5>Self-learning sorting of files </h5>\n  <p>As an added benefit, the request works as a determiner of document type (i.e. supplier invoice), thus enabling AzoraOne to categorize all future uploaded documents of similar look, layout and origin into the same type.</p>\n  <p>Moreover, by supplying the <i>verificationSeries</i> parameter in the request body, AzoraOne will learn how to sort uploaded files not only into type but into preferred verification series as well. This enables you to prearrange all uploaded documents in verification series in your application, thus offering self-learning sorting of documents to your customer. In turn, helps to reduce one of the largest thresholds to digitalization of the bookkeeping process: The user who uploads the file does not have to keep more than one mail address in memory and does not need to decide to which verification series or type the document belongs to. Furthermore, bookkeeping one series at a time is enabled, thus allowing for optimal workflow for professional accountants.</p>\n  <p>Two prerequisites must be fulfilled in order to teach AzoraOne to sort documents using the Bookkeep operation: </p>\n  <ol>\n    <li>Your application must allow for the user to move documents from one view or series to another. </li>\n    <li>The Bookkeep operation must be implemented in the actual view. </li>\n  </ol>\n  <p>The first prerequisite is necessary in order for the user to be able to move the verification to where it belongs. The second prerequisite is necessary in order to teach AzoraOne that the receipt incorrectly categorized as a receipt actually is a supplier invoice. Without these prerequisites in place, a verification incorrectly categorized as a receipt by AzoraOne will not be possible to bookkeep as a supplier invoice. Consequently, AzoraOne will not learn that the user wants to handle the verification as a supplier invoice. In turn, means that AzoraOne will categorize the verification as a receipt over and over again, regardless of how many times the user uploads the verification.</p>\n  <p>Provided that the Bookkeep operation has been implemented and your application allows for moving verifications, AzoraOne can be taught to categorize files into either receipts or supplier invoices and verification series therein.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> New feature:\n    <p>If you want a more flexible sorting you can use the <a href=\"/docs/files/update-a-file#request-schema\">Update a file</a> operation. With this operation, you can teach AzoraOne to categorize files into types other than receipts or supplier invoices, and you do not need to implement the Bookkeep operation in order to teach AzoraOne. </p>\n  </div>\n  <p>In order to take advantage of the acquired knowledge and sort uploaded files for your user, you have two options. Either you can retrieve the values for the <i>type</i> and <i>verificationSeries</i> parameters by sending a GET request to the <i>files</i> endpoint, or you can use webhooks for Files. In the latter case, when AzoraOne has preprocessed an uploaded file, a webhook will be sent to your callback URL with information on suggested type and verification series. Although not a requirement, using webhooks presents several advantages over retrieving the files object, you can read more about them <a href=\"/documentation/webhooks\" target=\"blank\">here</a>.</p>\n</div>\n\n<p>See the <a href=\"#request-schema\">request schema below</a> for validation rules on every field.</p>",
        "operationId": "bookkeep-an-invoice",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierInvoiceItem"
              },
              "example": {
                "supplierID": "1",
                "description": "Telavox invoice",
                "verificationSeries": "A",
                "invoiceDate": "2020-05-03",
                "dueDate": "",
                "invoiceNumber": "",
                "ocrNumber": "707902514856",
                "referenceNumber": "12345",
                "orderNumber": "12345",
                "ourRef": "Emma Example",
                "yourRef": "Tony Test",
                "totalSum": "3119,00",
                "vat": "623,82",
                "accounts": [
                  {
                    "account": "1790",
                    "periodicity": {
                      "offsetAccount": "6210",
                      "startDate": "2020-05-01",
                      "endDate": "2021-04-30"
                    },
                    "project": {
                      "targetValue": "P657588"
                    },
                    "costBearer": {
                      "targetValue": "10"
                    },
                    "resultsCentre": {
                      "targetValue": "20"
                    },
                    "debit": "2495,29",
                    "credit": "0,00"
                  },
                  {
                    "account": "3740",
                    "periodicity": {
                      "offsetAccount": "",
                      "startDate": "",
                      "endDate": ""
                    },
                    "project": {
                      "targetValue": ""
                    },
                    "costBearer": {
                      "targetValue": ""
                    },
                    "resultsCentre": {
                      "targetValue": ""
                    },
                    "debit": "0,00",
                    "credit": "0,11"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierInvoiceBookkeepResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "supplierID": "1",
                    "description": "Telavox invoice",
                    "verificationSeries": "A",
                    "invoiceDate": "2020-05-03",
                    "dueDate": "",
                    "invoiceNumber": "",
                    "ocrNumber": "707902514856",
                    "referenceNumber": "12345",
                    "orderNumber": "12345",
                    "ourRef": "Emma Example",
                    "yourRef": "Tony Test",
                    "totalSum": "3119,00",
                    "vat": "623,82",
                    "accounts": [
                      {
                        "account": "1790",
                        "periodicity": {
                          "offsetAccount": "6210",
                          "startDate": "2020-05-01",
                          "endDate": "2021-04-30"
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "2495,29",
                        "credit": "0,00"
                      },
                      {
                        "account": "3740",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "0,11"
                      }
                    ]
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-03-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 311602,
                      "message": "Date is not valid.",
                      "details": "",
                      "element": "invoiceDate"
                    },
                    {
                      "code": 315492,
                      "message": "Debit and credit do not balance.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-01 07:59:59"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:41:59"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/suppliers": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Retrieve all suppliers",
        "description": "Last updated: 2025-04-02\n\n<p>In order to retrieve the supplier objects of all suppliers that have been added to a company, send a GET request to this operation.</p>\n\n<p>The request URL must include the <i>companyID</i> of the company that the suppliers have been added to.</p>\n\n<p>If successful, the request will return a 200 HTTP response with a list of the supplier objects included in the response body.</p>",
        "operationId": "retrieve-all-suppliers",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierListResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "suppliers": [
                      {
                        "supplierID": "1",
                        "supplierName": "Telavox",
                        "corporateIdentityNumber": "556600-7786",
                        "bankAccountNumber": "5677-6487",
                        "plusGiroNumber": "",
                        "iban": "SE1150000000056241002716",
                        "vatNumber": "SE556600778601",
                        "countryOfOrigin": "SE",
                        "supplierTags": {
                          "supplierTag1": "+46712345678",
                          "supplierTag2": "example@email.com",
                          "supplierTag3": "",
                          "supplierTag4": "",
                          "supplierTag5": "",
                          "supplierTag6": ""
                        }
                      },
                      {
                        "supplierID": "2",
                        "supplierName": "Telenor",
                        "corporateIdentityNumber": "556421-0309",
                        "bankAccountNumber": "5331-1338",
                        "plusGiroNumber": "4792603-5",
                        "iban": "SE2195000099603447926035",
                        "vatNumber": "SE556421030901",
                        "countryOfOrigin": ""
                      },
                      {
                        "supplierID": "3",
                        "supplierName": "Dutch Supplier B.V.",
                        "corporateIdentityNumber": "12345678",
                        "bankAccountNumber": "",
                        "plusGiroNumber": "",
                        "iban": "NL91ABNA0417164300",
                        "vatNumber": "NL987654321B01",
                        "countryOfOrigin": "NL",
                        "supplierTags": {
                          "supplierTag1": "+31207654321",
                          "supplierTag2": "contact@dutchsupplier.nl",
                          "supplierTag3": "",
                          "supplierTag4": "",
                          "supplierTag5": "",
                          "supplierTag6": ""
                        }
                      }
                    ]
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 08:20:33"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:39:34"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Add a supplier",
        "description": "Last updated: 2025-04-02\n\n<p>Identifying the correct supplier on an extraction request is critical for a frictionless customer experience. AzoraOne provides a robust, rule-based mechanism for selecting a supplier by matching values in the supplier list against data found on the extracted document.</p>\n\n<p>You will need to create a supplier in order to:</p>\n<ul>\n    <li>Help locate a <i>supplierID</i> from the supplier list when extracting a supplier invoice.</li>\n    <li>Bookkeep the <i>supplierID</i> parameter to supplier invoices.</li>\n</ul>\n\n<p>To secure correct and consistent identification of suppliers, make sure POST requests contain correctly formatted values that are unique to the actual supplier, either as single entities or in combination with each other. See the <a href=\"#request-schema\">request schema below</a> for the formatting and validation rules for each field.</p>\n\n<p><b>At least one identifying field is required:</b> one of <code>corporateIdentityNumber</code>, <code>bankAccountNumber</code>, <code>plusGiroNumber</code>, <code>iban</code>, <code>vatNumber</code> or a <code>supplierTag</code> must have a value — <code>countryOfOrigin</code> alone does not count. Leaving all of them empty returns 400 (code 611101).</p>\n\n<p><b>Note on the 400 response:</b> as well as a field failing its own format check (see the request schema below), a 400 can mean the <code>supplierID</code> you submitted already belongs to another supplier in this company, a supplier tag exceeds 100 characters (code 617102), or that every identifying field above was left empty.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "add-a-supplier",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierItem"
              },
              "example": {
                "supplierID": "1",
                "supplierName": "Telavox",
                "corporateIdentityNumber": "556600-7786",
                "bankAccountNumber": "5677-6487",
                "plusGiroNumber": "",
                "iban": "SE1150000000056241002716",
                "vatNumber": "SE556600778601",
                "countryOfOrigin": "SE",
                "supplierTags": {
                  "supplierTag1": "+46712345678",
                  "supplierTag2": "example@email.com",
                  "supplierTag3": "",
                  "supplierTag4": "",
                  "supplierTag5": "",
                  "supplierTag6": ""
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "supplierID": "1",
                    "supplierName": "Telavox",
                    "corporateIdentityNumber": "556600-7786",
                    "bankAccountNumber": "5677-6487",
                    "plusGiroNumber": "",
                    "iban": "SE1150000000056241002716",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "supplierTags": {
                      "supplierTag1": "+46712345678",
                      "supplierTag2": "example@email.com",
                      "supplierTag3": "",
                      "supplierTag4": "",
                      "supplierTag5": "",
                      "supplierTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-03-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 611101,
                      "message": "All supplier specific parameters are either missing or invalid.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 09:28:35"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/suppliers/multiple": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Add a supplier list",
        "description": "Last updated: 2025-04-02\n\n<p>To streamline the process of supplier onboarding, this operation allows you to submit a list of suppliers in a single POST request.</p>\n\n<p>This is especially useful when initializing the supplier list for a company or syncing from an external database.</p>\n\n<p>Each supplier in the list follows the same structure and validation rules as an <a href=\"/docs/suppliers/add-a-supplier\">individual supplier creation request</a> — see the request schema below for the formatting and validation rules for each field. Accurate supplier information is essential for identifying the correct supplier when extracting and booking supplier invoices.</p>\n\n<p>The system uses a rule-based mechanism to identify suppliers based on unique parameter values found in the extracted documents. To ensure reliable identification, at least one valid base parameter or one valid supplier tag must be provided per supplier.</p>\n\n<p><b>Note on the 400 response:</b> a <code>400 Bad Request</code> can mean two different things here. If the request itself is malformed (an invalid <code>companyID</code>, a missing body, or an empty <code>suppliers</code> array), you'll get the standard error envelope shown in the 400 example below. But if the request was well-formed and every supplier in the list individually failed validation, you'll instead get the same per-supplier result list shape as the 200/409 responses — just with a 400 status instead. Check the shape of the body (does it have an <code>objectList</code>?), not just the status code, to tell these apart.</p>",
        "operationId": "add-a-supplier-list",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierList"
              },
              "example": {
                "suppliers": [
                  {
                    "supplierID": "1",
                    "supplierName": "Telavox",
                    "corporateIdentityNumber": "556600-7786",
                    "bankAccountNumber": "5677-6487",
                    "plusGiroNumber": "",
                    "iban": "SE1150000000056241002716",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "supplierTags": {
                      "supplierTag1": "+46712345678",
                      "supplierTag2": "example@email.com",
                      "supplierTag3": "",
                      "supplierTag4": "",
                      "supplierTag5": "",
                      "supplierTag6": ""
                    }
                  },
                  {
                    "supplierID": "2",
                    "supplierName": "Telenor",
                    "corporateIdentityNumber": "556421-0309",
                    "bankAccountNumber": "5331-1338",
                    "plusGiroNumber": "4792603-5",
                    "iban": "SE2195000099603447926035",
                    "vatNumber": "SE556421030901",
                    "countryOfOrigin": ""
                  },
                  {
                    "supplierID": "3",
                    "supplierName": "Dutch Supplier B.V.",
                    "corporateIdentityNumber": "12345678",
                    "bankAccountNumber": "",
                    "plusGiroNumber": "",
                    "iban": "NL91ABNA0417164300",
                    "vatNumber": "NL987654321B01",
                    "countryOfOrigin": "NL",
                    "supplierTags": {
                      "supplierTag1": "+31207654321",
                      "supplierTag2": "contact@dutchsupplier.nl",
                      "supplierTag3": "",
                      "supplierTag4": "",
                      "supplierTag5": "",
                      "supplierTag6": ""
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": true,
                      "data": {
                        "supplierID": "1",
                        "supplierName": "Telavox",
                        "corporateIdentityNumber": "556600-7786",
                        "bankAccountNumber": "5677-6487",
                        "plusGiroNumber": "SE1150000000056241002716",
                        "iban": "",
                        "vatNumber": "SE556600778601",
                        "countryOfOrigin": "SE",
                        "supplierTags": {
                          "supplierTag1": "+46712345678",
                          "supplierTag2": "example@email.com",
                          "supplierTag3": "",
                          "supplierTag4": "",
                          "supplierTag5": "",
                          "supplierTag6": ""
                        }
                      },
                      "objectID": "1"
                    },
                    {
                      "success": true,
                      "data": {
                        "supplierID": "2",
                        "supplierName": "Telenor",
                        "corporateIdentityNumber": "556421-0309",
                        "bankAccountNumber": "5331-1338",
                        "plusGiroNumber": "4792603-5",
                        "iban": "SE2195000099603447926035",
                        "vatNumber": "SE556421030901",
                        "countryOfOrigin": ""
                      },
                      "objectID": "2"
                    },
                    {
                      "success": true,
                      "data": {
                        "supplierID": "3",
                        "supplierName": "Dutch Supplier B.V.",
                        "corporateIdentityNumber": "12345678",
                        "bankAccountNumber": "",
                        "plusGiroNumber": "",
                        "iban": "NL91ABNA0417164300",
                        "vatNumber": "NL987654321B01",
                        "countryOfOrigin": "NL",
                        "supplierTags": {
                          "supplierTag1": "+31207654321",
                          "supplierTag2": "contact@dutchsupplier.nl",
                          "supplierTag3": "",
                          "supplierTag4": "",
                          "supplierTag5": "",
                          "supplierTag6": ""
                        },
                        "objectID": "3"
                      }
                    }
                  ],
                  "time": "2020-03-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:39:34"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": false,
                      "data": [
                        {
                          "code": 611401,
                          "message": "Supplier ID not found.",
                          "details": "",
                          "element": "supplierID"
                        },
                        {
                          "code": 611101,
                          "message": "All supplier specific parameters are either missing or invalid.",
                          "details": "",
                          "element": ""
                        }
                      ],
                      "objectID": "1"
                    },
                    {
                      "success": true,
                      "data": [
                        {
                          "supplierID": "2",
                          "supplierName": "Telenor",
                          "corporateIdentityNumber": "556421-0309",
                          "bankAccountNumber": "5331-1338",
                          "plusGiroNumber": "4792603-5",
                          "iban": "SE2195000099603447926035",
                          "vatNumber": "SE556421030901",
                          "countryOfOrigin": ""
                        }
                      ],
                      "objectID": "2"
                    },
                    {
                      "success": true,
                      "data": [
                        {
                          "supplierID": "3",
                          "supplierName": "Dutch Supplier B.V.",
                          "corporateIdentityNumber": "12345678",
                          "bankAccountNumber": "",
                          "plusGiroNumber": "",
                          "iban": "NL91ABNA0417164300",
                          "vatNumber": "NL987654321B01",
                          "countryOfOrigin": "NL",
                          "supplierTags": {
                            "supplierTag1": "+31207654321",
                            "supplierTag2": "contact@dutchsupplier.nl",
                            "supplierTag3": "",
                            "supplierTag4": "",
                            "supplierTag5": "",
                            "supplierTag6": ""
                          }
                        }
                      ],
                      "objectID": "3"
                    }
                  ],
                  "time": "2020-03-17 07:10:46"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/suppliers/{supplierID}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Retrieve a supplier",
        "description": "Last updated: 2025-04-02\n\n<p>In order to retrieve the supplier object of a supplier that has been added to a company, send a GET request to this operation.</p>\n\n<p>The request URL must include the <i>companyID</i> of the company that the supplier has been added to and the <i>supplierID</i> of the supplier that you want to retrieve.</p>\n\n<p>If successful, the request will return a 200 HTTP response with the supplier object included in the response body.</p>",
        "operationId": "retrieve-a-supplier",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "supplierID",
            "in": "path",
            "description": "The supplier's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "supplierID": "1",
                    "supplierName": "Telavoxii",
                    "corporateIdentityNumber": "556600-7786",
                    "bankAccountNumber": "5677-6487",
                    "plusGiroNumber": "",
                    "iban": "SE1150000000056241002716",
                    "vatNumber": "",
                    "countryOfOrigin": "",
                    "supplierTags": {
                      "supplierTag1": "",
                      "supplierTag2": "",
                      "supplierTag3": "",
                      "supplierTag4": "",
                      "supplierTag5": "",
                      "supplierTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-05 09:22:35"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:39:34"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 611401,
                      "message": "Supplier ID not found.",
                      "details": "",
                      "element": "supplierID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Update a supplier",
        "description": "Last updated: 2025-04-02\n\n<p><b>NOTE:</b> When updating a resource, new information overwrites the existing information — this is a full replace, not a partial update. Any field you leave empty is cleared, not left unchanged.</p>\n\n<p>Unlike creating a supplier, updating one does <b>not</b> require at least one base parameter or supplier tag to be set — every field, including all supplier tags, may be left empty. This lets you clear a supplier's details while keeping the record itself (and its history) in place. See the request schema below for the formatting rules that still apply to any field you do set.</p>\n\n<p>The <code>supplierID</code> in the request body must match the <code>supplierID</code> in the URL — a mismatch returns a <code>400 Bad Request</code>.</p>",
        "operationId": "update-a-supplier",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "supplierID",
            "in": "path",
            "description": "The supplier's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierItem"
              },
              "example": {
                "supplierID": "1",
                "supplierName": "Telavox",
                "corporateIdentityNumber": "556600-7786",
                "bankAccountNumber": "5677-6487",
                "plusGiroNumber": "",
                "iban": "SE1150000000056241002716",
                "vatNumber": "SE556600778601",
                "countryOfOrigin": "SE",
                "supplierTags": {
                  "supplierTag1": "+46712345678",
                  "supplierTag2": "example@email.com",
                  "supplierTag3": "",
                  "supplierTag4": "",
                  "supplierTag5": "",
                  "supplierTag6": ""
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "supplierID": "1",
                    "supplierName": "Telavox",
                    "corporateIdentityNumber": "556600-7786",
                    "bankAccountNumber": "5677-6487",
                    "plusGiroNumber": "",
                    "iban": "",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "supplierTags": {
                      "supplierTag1": "+46712345678",
                      "supplierTag2": "example@email.com",
                      "supplierTag3": "",
                      "supplierTag4": "",
                      "supplierTag5": "",
                      "supplierTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-03-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 611402,
                      "message": "Supplier ID is not valid.",
                      "details": "SupplierID parameter and SupplierID in Body mismatch.",
                      "element": "supplierID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 09:28:35"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 611401,
                      "message": "Supplier ID not found.",
                      "details": "",
                      "element": "supplierID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Suppliers"
        ],
        "summary": "Delete a supplier",
        "description": "Last updated: 2023-10-16\n\n<p>You can delete a supplier resource by using this operation.</p>\n\n<p>The request URL must include both <i>companyID</i> and <i>supplierID</i>.</p>\n\n<p>If successful, the request will return a 200 HTTP response with an empty data object in the body.</p>",
        "operationId": "delete-a-supplier",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "supplierID",
            "in": "path",
            "description": "The supplier's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierDeleteResponse"
                },
                "example": {
                  "success": true,
                  "data": {},
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-03-28 11:41:02"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:39:34"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 611401,
                      "message": "Supplier ID not found.",
                      "details": "",
                      "element": "supplierID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/progenitors": {
      "post": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Add a progenitor",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>The <i>progenitors</i> resource lets one company (the <i>child</i>) inherit another company's (the <i>progenitor</i>'s) learned extraction patterns. Send a POST request to this operation to add a progenitor relationship for the company in the URL.</p>\n  <p>The request URL must include the <i>companyID</i> of the company that will inherit knowledge (the child). The request body's <i>progenitorID</i> must be the <i>companyID</i> of an existing company to inherit from — it is validated as a real company at creation time, not just as a well-formed string.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> Note:\n    <p>The progenitor relationship is scoped to this one company pair — the same company can be added as a progenitor by many different companies at once, and there is no service-wide uniqueness requirement on <i>progenitorID</i>. A company also cannot be its own progenitor.</p>\n  </div>\n  <p>If successful, the request will return a 200 HTTP response with the created progenitor object included in the response body. Inheritance takes effect immediately — the next matching extraction request for the child company will consider the progenitor's patterns.</p>\n  <p><b>Important:</b> <i>startDateTime</i>/<i>stopDateTime</i> do not describe when the relationship itself is active — the relationship is simply active or inactive (see the note on removing a progenitor below). Instead, they restrict inheritance to only those progenitor patterns that were <b>created</b> within this window; a pattern created before <i>startDateTime</i> or after <i>stopDateTime</i> is not inherited, even while the relationship remains active. Leaving either empty leaves that side of the window unbounded.</p>\n  <p>Re-adding a progenitor that was previously removed reactivates the same underlying relationship (with the fields you submit this time) rather than creating a separate one or returning an error.</p>\n  <p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid or malformed <i>progenitorID</i>, submitting your own <i>companyID</i> as the <i>progenitorID</i>, an invalid/malformed date, <i>stopDateTime</i> earlier than <i>startDateTime</i>, or a progenitor relationship that already exists between these two companies.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 also means the <i>progenitorID</i> you submitted doesn't resolve to an existing company.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>\n</div>",
        "operationId": "add-a-progenitor",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgenitorItem"
              },
              "example": {
                "progenitorID": "c1",
                "startDateTime": "2020-01-01 00:00:00",
                "stopDateTime": "2020-12-31 23:59:59",
                "supplierInvoices": true,
                "customerInvoices": true,
                "receipts": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "progenitorID": "c1",
                    "startDateTime": "2020-01-01 00:00:00",
                    "stopDateTime": "2020-12-31 23:59:59",
                    "supplierInvoices": true,
                    "customerInvoices": true,
                    "receipts": true
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:50:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "progenitorID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:50:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:51:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:51:30"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Retrieve all progenitors",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>Retrieve every active <a href=\"/docs/progenitors/add-a-progenitor\">progenitor relationship</a> for a company — send a GET request with the <i>companyID</i> of the company in question.</p>\n  <p>If successful, the request will return a 200 HTTP response with a list of the progenitor objects included in the response body. There is no pagination — every active relationship is returned in one call, sorted by the donor company's <code>companyID</code>. A company with no progenitors returns 200 with an empty list, not a 404.</p>\n  <p>A relationship that's been removed via <a href=\"/docs/progenitors/delete-a-progenitor\">Delete a progenitor</a> is soft-deleted, not erased — it never appears in this list again unless re-added, which reactivates it rather than creating a new one.</p>\n</div>",
        "operationId": "retrieve-all-progenitors",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorListResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "progenitors": [
                      {
                        "progenitorID": "1",
                        "startDateTime": "2020-01-01 00:00:00",
                        "stopDateTime": "2020-12-31 23:59:59",
                        "supplierInvoices": true,
                        "customerInvoices": true,
                        "receipts": true,
                        "created": "2020-01-01 00:05:12"
                      },
                      {
                        "progenitorID": "2",
                        "startDateTime": "2020-01-01 00:00:00",
                        "stopDateTime": "",
                        "supplierInvoices": true,
                        "customerInvoices": false,
                        "receipts": false,
                        "created": "2020-02-14 09:30:00"
                      }
                    ]
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:00:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:00:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:01:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:01:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/progenitors/{progenitorID}": {
      "put": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Update a progenitor",
        "description": "Last updated: 2026-08-06\n\n<p><b>NOTE:</b> When updating a resource, new information overwrites the existing information — this is a full replace, not a partial update. Any field you leave empty is cleared, not left unchanged; any boolean field you omit is written using its own default (<code>supplierInvoices</code>/<code>receipts</code> default to <code>true</code>, <code>customerInvoices</code> defaults to <code>false</code>) rather than preserving whatever was previously stored. See the request schema below for the formatting rules that still apply to any field you do set.</p>\n\n<p>The <code>progenitorID</code> in the request body must match the <code>progenitorID</code> in the URL — a mismatch returns a <code>400 Bad Request</code>.</p>\n\n<p><b>Important:</b> this operation can only update a relationship that is currently active. Unlike <a href=\"/docs/progenitors/add-a-progenitor\">Add a progenitor</a>, it cannot reactivate a relationship that's been <a href=\"/docs/progenitors/delete-a-progenitor\">removed</a> — attempting to update a removed (or never-existing) relationship returns a 404, indistinguishable from each other. To bring a removed relationship back, use Add a progenitor again instead.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid <i>progenitorID</i>, a <i>progenitorID</i> in the body that doesn't match the URL, submitting the same value for both <i>companyID</i> and <i>progenitorID</i>, an invalid/malformed date, or <i>stopDateTime</i> earlier than <i>startDateTime</i>.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>progenitorID</i> doesn't resolve to any company at all, or — the case shown in the example below — there's no active progenitor relationship between this specific pair to update.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "update-a-progenitor",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "progenitorID",
            "in": "path",
            "description": "The companyID of the progenitor company whose relationship you want to update.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "c1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgenitorItem"
              },
              "example": {
                "progenitorID": "c1",
                "startDateTime": "2020-01-01 00:00:00",
                "stopDateTime": "2020-12-31 23:59:59",
                "supplierInvoices": true,
                "customerInvoices": true,
                "receipts": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "progenitorID": "c1",
                    "startDateTime": "2020-01-01 00:00:00",
                    "stopDateTime": "2020-12-31 23:59:59",
                    "supplierInvoices": true,
                    "customerInvoices": true,
                    "receipts": true
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:30:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "Both progenitor IDs need to be the same company ID.",
                      "element": "progenitorID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:30:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 511401,
                      "message": "Progenitor ID not found.",
                      "details": "",
                      "element": "progenitorID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:31:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:31:30"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Delete a progenitor",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>You can remove a <a href=\"/docs/progenitors/add-a-progenitor\">progenitor relationship</a> between two companies by using this operation.</p>\n  <p>The request URL must include both <i>companyID</i> (the inheriting company) and <i>progenitorID</i> (the company it inherits from).</p>\n  <p>If successful, the request will return a 200 HTTP response with an empty data object in the body. The relationship is soft-deleted, not erased — its patterns stop being inherited immediately, but the relationship's history is preserved, and it can be brought back later via <a href=\"/docs/progenitors/add-a-progenitor\">Add a progenitor</a>, which reactivates it rather than creating a new one.</p>\n  <p>This operation is <b>not idempotent</b>: deleting an already-inactive (or never-existing) relationship returns a 404, not a silent success.</p>\n</div>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid <i>progenitorID</i>, or submitting the same value for both.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>progenitorID</i> doesn't resolve to any company at all, or — the case shown in the example below — there's no active progenitor relationship between this specific pair to delete.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "delete-a-progenitor",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "progenitorID",
            "in": "path",
            "description": "The companyID of the progenitor company whose relationship you want to delete.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "c1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorDeleteResponse"
                },
                "example": {
                  "success": true,
                  "data": {},
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:40:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:40:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 511401,
                      "message": "Progenitor ID not found.",
                      "details": "",
                      "element": "progenitorID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:41:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:41:30"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Retrieve a progenitor",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>Retrieve a single active <a href=\"/docs/progenitors/add-a-progenitor\">progenitor relationship</a> — send a GET request with the <i>companyID</i> of the inheriting company and the <i>progenitorID</i> of the company it inherits from.</p>\n  <p>If successful, the request will return a 200 HTTP response with the progenitor object included in the response body.</p>\n</div>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid <i>progenitorID</i>, or submitting the same value for both <i>companyID</i> and <i>progenitorID</i>.</p>\n\n<p><b>Note on the 404 response:</b> this operation has three distinct causes, all returned as 404 but with different codes — a <i>companyID</i> that doesn't resolve to a company (code 111401), a <i>progenitorID</i> that doesn't resolve to any company at all (also 111401, but with <code>element</code> set to <code>progenitorID</code>), or — the case shown in the example below — both companies existing but no active progenitor relationship between this specific pair (code 511401, \"Progenitor ID not found.\"). A relationship that's been <a href=\"/docs/progenitors/delete-a-progenitor\">removed</a> also produces this last case; it's indistinguishable from a relationship that never existed.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "retrieve-a-progenitor",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "progenitorID",
            "in": "path",
            "description": "The companyID of the progenitor company to retrieve the relationship for.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "c1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorDetailResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "progenitorID": "c1",
                    "startDateTime": "2020-01-01 00:00:00",
                    "stopDateTime": "2020-12-31 23:59:59",
                    "supplierInvoices": true,
                    "customerInvoices": true,
                    "receipts": true,
                    "created": "2020-01-01 00:05:12"
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:20:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:20:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 511401,
                      "message": "Progenitor ID not found.",
                      "details": "",
                      "element": "progenitorID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:21:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:21:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Add a file",
        "description": "Last updated: 2021-09-20\n\n<img style=\"width:100%; max-width:800px;\"\nsrc=\"https://apimgmtstmczul04oe76zn3s.blob.core.windows.net/content/6041ff60-4635-7c3f-e4b3-e8590f3be32f\">\n\nOnce a company has been created, PDFs, images and e-invoices can be uploaded for subsequent extraction. In the AzoraOne APIs, uploads and extractions are performed in two separate steps.\n\nYou will need to add a file in order to:\n<ul>\n    <li>Extract data from receipts</li>\n    <li>Extract data from supplier invoices</li>\n</ul>\n\n<div class=\"description\">\n  <p>The request URL must include the <i>companyID</i> of the company that that you want to upload the file to. The request must also include a body with the Content-type multipart/form-data that contains a unique file ID and a file.</p>\n  <p>If successful, the request will return a 202 HTTP response with a file object included in the response body. The file object does NOT contain the file itself — see the <a href=\"#response-schema\">Response schema below</a> for its exact fields.</p>\n  <p>Consider the 202 response as a confirmation that we have received the file. The response is not an indication of how the preprocessing has proceeded. In this stage, only the <i>fileID</i>, <i>fileName</i> and <i>status</i> parameters will have values and the <i>status</i> parameter will always be WAITING. </p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> Note:\n    <p>If you would retrieve the file a short time afterwards (by sending a GET request to the <i>files</i> resource), chances are that the <i>status</i> parameter would have changed to READY. The status READY means that the preprocessing has been successful. More importantly, the status READY also means that you will now be able to extract data from the file by sending a GET request to either the <i>receipts</i> or <i>supplierInvoices</i> resource. Furthermore, once preprocessing is complete, the <i>type</i> and <i>verificationSeries</i> parameters will contain values that can be used for displaying the image in the appropriate view in your application. You can find more information on this in the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation.</p>\n  </div>\n  <h5>Additional information</h5>\n  <p>The <i>files</i> resource uses the Content-type multipart/form-data.</p>\n  <p>Currently the minimum file size is 1 KB and the maximum file size is 10 MB.</p>\n  <p>The MIME type of the uploaded files should be application/pdf, image/png, image/jpeg, application/xml or text/xml.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> Note:\n    <p>The API also allows certain e-invoices of the type XML to be processed:</p>\n<ul>\n<li>Svefaktura 1.0</li>\n<li>PEPPOL BIS Billing 3.0</li>\n<ul>\n<li>Invoice</li>\n<li>CreditNote</li>\n</ul>\n</ul>\n<p>Other types of XML-files will be rejected.</p>\n<p>The MIME type should be application/xml or text/xml when uploading XML-files.</p>\n<p>E-invoices allows for automatic extraction of certain fields in the SupplierInvoice model, if previous knowledge is missing. The following fields will be extracted even if no previous knowledge exists:</p>\n<ul>\n<li>invoiceDate</li>\n<li>dueDate</li>\n<li>invoiceNumber</li>\n<li>ocrNumber</li>\n<li>referenceNumber</li>\n<li>totalSum</li>\n<li>vat</li>\n</ul>\n<p>In addition, the seller's organization number, VAT number, bank giro / PlusGiro number and IBAN — when present on the e-invoice — are used to automatically match the invoice to an existing supplier in your account.</p>\n<p>Contact us at <a class=\"email\" href=\"mailto:support@arkimera.se\">support@arkimera.se</a> if you want us to add any additional XML formats.</p>\n  </div>\n</div>\n\n<h3>Parameter details</h3>\n\nBelow you will find detailed information about the parameters featured in the examples.\n\n<b>fileID</b> <br>\nMust be unique within the service. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\">RFC-1738</a>.\n\n<b>file</b> <br>\nMust be a valid PDF, PNG, JPEG or XML (Svefaktura or PEPPOL) file.\n\n<b>webhookUrl</b> <br>\nMust be a valid URL to an endpoint that accepts POST requests.",
        "operationId": "add-a-file",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "fileID",
                  "file"
                ],
                "properties": {
                  "fileID": {
                    "type": "string",
                    "description": "Must be unique within the service. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>.",
                    "default": "1"
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "The URL that a webhook notification will be sent to once this file has finished preprocessing. Must be a valid URL to an endpoint that accepts POST requests. See <a href=\"/documentation/webhooks\" target=\"_blank\" rel=\"noopener\">webhooks</a> for more information."
                  },
                  "file": {
                    "type": "file",
                    "description": "The file to upload. Must be a valid PDF, PNG, JPEG or XML (Svefaktura 1.0 or PEPPOL BIS Billing 3.0 Invoice/CreditNote) file — other XML formats are rejected. MIME type must be one of application/pdf, image/png, image/jpeg, application/xml or text/xml. File size must be between 1 KB and 10 MB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "fileID": "100",
                    "fileName": "telavox.pdf",
                    "status": "WAITING",
                    "type": "",
                    "verificationSeries": "",
                    "createdDate": "",
                    "conformity": null,
                    "summary": null
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-30 07:54:49"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211212,
                      "message": "File is not valid.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 08:13:08"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Retrieve all files",
        "description": "Last updated: 2026-08-05\n\n<div class=\"description\">\n  <p>A GET request to this operation returns a list of files uploaded to AzoraOne by or for a specific company. These files may include receipts, supplier invoices, or other documents supported by AzoraOne.</p>\n  <p>This operation is highly flexible, allowing you to search, sort, paginate, and filter the results using query parameters — see the Parameters section below for the full set (including the <i>text</i> search syntax) and the Response schema for the exact shape of each returned file and the <i>meta</i> object. In addition, you can optionally request summary and performance data for each file to gain insights into extraction quality and document lifecycle.</p>\n  <p>This operation is ideal for building dashboards, audit tools, or history views that give users visibility into their document archive within AzoraOne.</p>\n  <p>Each returned file does not contain the file itself — see the <a href=\"/docs/files/retrieve-file-details#response-schema\">Retrieve file details</a> operation for that.</p>\n</div>",
        "operationId": "retrieve-all-files",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "text",
            "in": "query",
            "description": "Full-text search over the OCR-extracted content of uploaded files. OCR text is tokenized and indexed; searches use prefix-based token matching. Rules: matches individual terms only (no multi-word phrases); 3–512 characters; each search term must be wrapped in double quotes, e.g. <code>\"Coffee\"</code> (a bare, unquoted term like <code>Coffee</code> is rejected), and matching against the term itself is case-insensitive. <code>\"Coff\"</code> prefix-matches any word starting with <code>Coff</code> (e.g. <code>Coffee</code>); add a trailing space inside the quotes — <code>\"Coff \"</code> — to match only the exact word. Combine terms with the logical operators <code>AND</code>, <code>OR</code>, <code>NOT</code> and <code>AND NOT</code> — these operators are case-insensitive, so uppercase, lowercase, and mixed-case forms are accepted. Used alone (without a preceding <code>AND</code>), <code>NOT</code> may only appear at the very start of the expression, to exclude a term from every result, e.g. <code>NOT \"Diesel\"</code>. Used as the combined operator <code>AND NOT</code>, it connects two terms and can appear anywhere in the expression (not just at the start), e.g. <code>\"Petrol\" AND NOT \"Diesel\"</code>. Group with parentheses, e.g. <code>(\"Coffee\" AND \"Cookies\") OR \"Petrol\"</code>. Two quoted terms can't appear back to back without an operator between them, and an operator can't appear at the very end. Can be combined with <code>status</code>, <code>type</code> and date filters for more precise searches.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileCreatedFrom",
            "in": "query",
            "description": "Only return files uploaded on or after this date/time, formatted as yyyy-MM-dd HH:mm:ss. Must be earlier than <code>fileCreatedTo</code> if both are supplied.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileCreatedTo",
            "in": "query",
            "description": "Only return files uploaded on or before this date/time, formatted as yyyy-MM-dd HH:mm:ss. Must be later than <code>fileCreatedFrom</code> if both are supplied.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Only return files with this suggested document type. One of <code>SupplierInvoice</code>, <code>Receipt</code>, <code>CustomerInvoice</code> or <code>Other</code>.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Only return files in this processing state. One of <code>READY</code>, <code>BOOKED</code>, <code>EXTRACTED</code>, <code>COMPLETE</code> or <code>ERROR</code>. Can be combined with <code>text</code>, <code>type</code> or date filters.",
            "schema": {
              "type": "string",
              "enum": [
                "READY",
                "BOOKED",
                "EXTRACTED",
                "COMPLETE",
                "ERROR"
              ]
            }
          },
          {
            "name": "summary",
            "in": "query",
            "description": "When set to <code>true</code>, each returned file's <code>summary</code> field is populated with its most recent extraction and booking events — see <a href=\"#response-schema\">SummaryItem</a>. Also required (set to <code>true</code>) in order to use the <code>supplierID</code> filter. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "supplierID",
            "in": "query",
            "description": "Only return files whose most recent extraction or booking involved this supplier. Requires <code>summary=true</code> — supplying <code>supplierID</code> without it is rejected with a 400, not silently ignored.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conformity",
            "in": "query",
            "description": "When set to <code>true</code>, each returned file's <code>conformity</code> field is populated, and the response's <code>meta.aggregates.averageConformity</code> reflects the page's average — see <a href=\"#response-schema\">ConformityItem</a> and the Quality &amp; Performance documentation for the calculation logic. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "conformityFilters",
            "in": "query",
            "description": "Restricts the conformity calculation to specific fields. Allowed only together with <code>conformity=true</code>; supplying it without <code>conformity=true</code> returns a 400 response. Accepts a comma-separated list of field names: for receipts, <code>receiptDate</code>, <code>description</code> or <code>accounts</code>; for supplier invoices, <code>supplier</code>, <code>description</code>, <code>invoiceDate</code>, <code>dueDate</code>, <code>invoiceNumber</code>, <code>ocrNumber</code>, <code>refNumber</code>, <code>orderNumber</code>, <code>ourRef</code>, <code>yourRef</code>, <code>totalSum</code>, <code>vat</code> or <code>accounts</code>. See the Quality &amp; Performance and Field Filtering documentation for full details.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileFormat",
            "in": "query",
            "description": "Only return files of this file type. One of <code>pdf</code>, <code>jpg</code>, <code>png</code> or <code>xml</code>.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "1-based page number to return. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>1</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page, up to 100. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>10</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "description": "Sort direction: <code>asc</code> or <code>desc</code>. Defaults to <code>desc</code>.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field to sort by. One of <code>fileID</code>, <code>fileName</code>, <code>status</code>, <code>type</code>, <code>verificationSeries</code>, <code>createdDateUTC</code>, <code>conformity</code>, <code>extractAncestor</code>, <code>lastExtractedDate</code>, <code>lastBookedDate</code>, <code>supplierIDExtracted</code> or <code>supplierIDBooked</code>. Defaults to <code>createdDateUTC</code>.",
            "schema": {
              "type": "string",
              "default": "createdDateUTC"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileListResponse"
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "fileID": "1",
                      "fileName": "file1.pdf",
                      "status": "COMPLETE",
                      "type": "SupplierInvoice",
                      "verificationSeries": "",
                      "conformity": {
                        "value": 100
                      },
                      "createdDate": "2025-06-01 12:45:53",
                      "summary": {
                        "latestExtraction": {
                          "eventDate": "2026-06-02 13:55:03",
                          "type": "SupplierInvoice",
                          "supplierID": "1",
                          "ancestor": "None"
                        },
                        "latestBooking": {
                          "eventDate": "2026-06-02 13:55:03",
                          "type": "SupplierInvoice",
                          "supplierID": "1"
                        }
                      }
                    },
                    {
                      "fileID": "2",
                      "fileName": "file3.pdf",
                      "status": "BOOKED",
                      "type": "SupplierInvoice",
                      "verificationSeries": "",
                      "conformity": {
                        "value": null
                      },
                      "createdDate": "2025-06-01 12:45:53",
                      "summary": {
                        "latestExtraction": null,
                        "latestBooking": {
                          "eventDate": "2026-06-02 13:55:03",
                          "type": "SupplierInvoice",
                          "supplierID": "2"
                        }
                      }
                    },
                    {
                      "fileID": "3",
                      "fileName": "file3.pdf",
                      "status": "EXTRACTED",
                      "type": "Receipt",
                      "verificationSeries": "",
                      "conformity": {
                        "value": null
                      },
                      "createdDate": "2025-06-02 12:22:37",
                      "summary": {
                        "latestExtraction": {
                          "eventDate": "2025-06-02 12:25:25",
                          "type": "Receipt",
                          "supplierID": null,
                          "ancestor": "StartBot"
                        },
                        "latestBooking": null
                      }
                    },
                    {
                      "fileID": "4",
                      "fileName": "file4.pdf",
                      "status": "ERROR",
                      "type": "Other",
                      "verificationSeries": "",
                      "conformity": {
                        "value": null
                      },
                      "createdDate": "2025-06-03 06:13:33",
                      "summary": {
                        "latestExtraction": null,
                        "latestBooking": null
                      }
                    },
                    {
                      "fileID": "5",
                      "fileName": "file5.pdf",
                      "status": "READY",
                      "type": "Other",
                      "verificationSeries": "",
                      "conformity": {
                        "value": null
                      },
                      "createdDate": "2024-08-05 08:08:03",
                      "summary": {
                        "latestExtraction": null,
                        "latestBooking": null
                      }
                    }
                  ],
                  "extended": "",
                  "meta": {
                    "pagination": {
                      "pageNumber": 1,
                      "pageSize": 5,
                      "totalItems": 50,
                      "totalPages": 10
                    },
                    "aggregates": {
                      "averageConformity": 100
                    },
                    "updated": "2026-08-05 07:00:00"
                  },
                  "origin": "",
                  "time": "2020-08-30 07:54:49"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 101152,
                      "message": "Query parameter is not valid.",
                      "details": "Unsupported type. Please choose one of: SupplierInvoice, Receipt or Other.",
                      "element": "type"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-02 08:13:08"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/memories": {
      "delete": {
        "tags": [
          "Memories"
        ],
        "summary": "Delete all memories",
        "description": "Last updated: 2026-08-06\n\n<p>This operation deletes all previously acquired memories from a company.</p>\n\n<p>Memories are a hidden resource that contains knowledge on how the company wants its documents bookkept. Memories are automatically created by bookkeeping documents — mechanically, this operation is the same soft-delete used by <a href=\"/docs/models/update-models-status\">Update models' status</a> to disable a learned pattern, just applied unconditionally to every pattern for the company, with no way to filter by type, supplier, or date range.</p>\n\n<p>Deleting the memories will reset the knowledge of a specific company. You will need to bookkeep documents again in order to leverage the self-learning capabilities of AzoraOne. You can, for example, use this feature for demo purposes — reset a company's memories in order to showcase AzoraOne's self-learning capabilities again without having to create a new company and its accompanying files, suppliers and progenitors all over again.</p>\n\n<p><b>Important — this can affect other companies too.</b> If another company has this one configured as a <a href=\"/docs/progenitors/add-a-progenitor\">progenitor</a>, deleting this company's memories silently breaks the knowledge that company inherits from it. The progenitor relationship record itself is left untouched — it still shows as active if retrieved — but the patterns it points to are gone, so the child company's extractions simply stop finding matches contributed by this company going forward. Files, suppliers, and the progenitor relationship <i>records</i> are not modified by this operation — only what they're still able to find is affected.</p>\n\n<p>This operation is irreversible through the API — there is no endpoint that restores exactly what was deleted here. Calling it on a company that has no memories yet still succeeds with a 200 response; it's simply a no-op.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can also mean the delete failed at the database layer — this operation returns 400 rather than 500 for that specific failure, unlike most other database-failure cases in this API.</p>\n\n<p><b>Note on the 500 response:</b> this can indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "delete-all-memories",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryDeleteResponse"
                },
                "example": {
                  "success": true,
                  "data": {},
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:50:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:50:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:51:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:51:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files/{fileID}/receipts": {
      "put": {
        "tags": [
          "Receipts"
        ],
        "summary": "Bookkeep a receipt",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <img style=\"width:100%; max-width:800px;\"\nsrc=\"https://apimgmtstmczul04oe76zn3s.blob.core.windows.net/content/be0c49a4-aefa-5597-18af-4af26e7db2e7\">\n  <p>An integral part of AzoraOne is the built-in self-learning capability. In order to learn, AzoraOne must have the correct input data. We think the user, be it the small business owner or a professional accountant, knows the company best. Consequently, we use the data generated by the user upon bookkeeping as our learning data. To enable this, send a PUT request to the <i>receipts</i> endpoint when the user presses the bookkeep button in your application.</p>\n  <p>The request will update the receipt object with the correct values.</p>\n  <p>If successful, the request will return a 200 HTTP response with the receipt object included in the response body. As a side effect, the file's status is always advanced to <code>BOOKED</code> once the file-readiness checks pass, regardless of what its status was before — including in cases where a later step in this same request still fails with a 500 (see the note on the 500 response below).</p>\n  <p><b>Note on the 400 response:</b> most causes are field-level validation failures — see the <a href=\"#request-schema\">request schema below</a> for each field's rules. The two other causes are the file itself being unprocessable, and the account rows' <code>debit</code>/<code>credit</code> failing to balance: unlike supplier and customer invoices (which balance against <code>totalSum</code>/<code>vat</code>), a receipt has no total or VAT field, so the sum of every row's <code>debit</code> must equal the sum of every row's <code>credit</code> directly (tolerance &lt;0.001). At least two non-empty account rows are also required.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>fileID</i> wasn't found.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request. Unlike supplier and customer invoices — where the self-learning sort-pattern update, key-saving, and statistics work is deferred to a background job after the response is sent — this operation does that work synchronously within the request itself, so a 500 here can occur later in the request's lifecycle, after the file's status has already been set to <code>BOOKED</code>.</p>\n  <h5>Self-learning sorting of files</h5>\n  <p>As an added benefit, the request works as a determiner of document type (i.e. receipt), thus enabling AzoraOne to categorize all future uploaded documents of similar look, layout and origin into the same type.</p>\n  <p>Moreover, by supplying the <i>verificationSeries</i> parameter in the request body, AzoraOne will learn how to sort uploaded files not only into type but into preferred verification series as well. This enables you to prearrange all uploaded documents in verification series in your application, thus offering self-learning sorting of documents to your customer. In turn, helps to reduce one of the largest thresholds to digitalization of the bookkeeping process: The user who uploads the file does not have to keep more than one mail address in memory and does not need to decide to which verification series or type the document belongs to. Furthermore, bookkeeping one series at a time is enabled, thus allowing for optimal workflow for professional accountants.</p>\n  <p>Two prerequisites must be fulfilled in order to teach AzoraOne to sort documents using the bookkeep operation:</p>\n  <ol>\n    <li>Your application must allow for the user to move documents from one view or series to another.</li>\n    <li>The bookkeep operation must be implemented in the actual view.</li>\n  </ol>\n  <p>The first prerequisite is necessary in order for the user to be able to move the verification to where it belongs. The second prerequisite is necessary in order to teach AzoraOne that the receipt incorrectly categorized as a supplier invoice actually is a receipt. Without these prerequisites in place, a verification incorrectly categorized as a supplier invoice by AzoraOne will not be possible to bookkeep as a receipt. Consequently, AzoraOne will not learn that the user wants to handle the verification as a receipt. In turn, means that AzoraOne will categorize the verification as a supplier invoice over and over again, regardless of how many times the user uploads the verification.</p>\n  <p>Provided that the bookkeep operation has been implemented and your application allows for moving verifications, AzoraOne can be taught to categorize files into either receipts or supplier invoices and verification series therein.</p>\n  <div class=\"note\">\n    <span class=\"glyphicon glyphicon-exclamation-sign\"></span> New feature:\n    <p>If you want a more flexible sorting you can use the <a href=\"/docs/files/update-a-file#request-schema\">Update a file</a> operation. With this operation, you can teach AzoraOne to categorize files into types other than receipts or supplier invoices, and you do not need to implement the bookkeep operation in order to teach AzoraOne.</p>\n  </div>\n  <p>In order to take advantage of the acquired knowledge and sort uploaded files for your user, you have two options. Either you can retrieve the values for the <i>type</i> and <i>verificationSeries</i> parameters by sending a GET request to the <i>files</i> endpoint, or you can use webhooks for Files. In the latter case, when AzoraOne has preprocessed an uploaded file, a webhook will be sent to your callback URL with information on suggested type and verification series. Although not a requirement, using webhooks presents several advantages over retrieving the files object, you can read more about them <a href=\"/documentation/webhooks\" target=\"blank\">here</a>.</p>\n</div>\n\n<p>See the <a href=\"#request-schema\">request schema below</a> for validation rules on every field.</p>",
        "operationId": "bookkeep-a-receipt",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptItem"
              },
              "example": {
                "description": "Employee breakfast",
                "verificationSeries": "A",
                "receiptDate": "2020-05-04",
                "accounts": [
                  {
                    "account": "1930",
                    "periodicity": {
                      "offsetAccount": "",
                      "startDate": "",
                      "endDate": ""
                    },
                    "project": {
                      "targetValue": ""
                    },
                    "costBearer": {
                      "targetValue": ""
                    },
                    "resultsCentre": {
                      "targetValue": ""
                    },
                    "debit": "0,00",
                    "credit": "3119,00"
                  },
                  {
                    "account": "2641",
                    "periodicity": {
                      "offsetAccount": "",
                      "startDate": "",
                      "endDate": ""
                    },
                    "project": {
                      "targetValue": ""
                    },
                    "costBearer": {
                      "targetValue": ""
                    },
                    "resultsCentre": {
                      "targetValue": ""
                    },
                    "debit": "623,82",
                    "credit": "0,00"
                  },
                  {
                    "account": "1790",
                    "periodicity": {
                      "offsetAccount": "6210",
                      "startDate": "2020-05-01",
                      "endDate": "2021-04-30"
                    },
                    "project": {
                      "targetValue": "P657588"
                    },
                    "costBearer": {
                      "targetValue": "10"
                    },
                    "resultsCentre": {
                      "targetValue": "20"
                    },
                    "debit": "2495,29",
                    "credit": "0,00"
                  },
                  {
                    "account": "3740",
                    "periodicity": {
                      "offsetAccount": "",
                      "startDate": "",
                      "endDate": ""
                    },
                    "project": {
                      "targetValue": ""
                    },
                    "costBearer": {
                      "targetValue": ""
                    },
                    "resultsCentre": {
                      "targetValue": ""
                    },
                    "debit": "0,00",
                    "credit": "0,11"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptBookkeepResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "description": "Employee breakfast",
                    "verificationSeries": "A",
                    "receiptDate": "2020-05-04",
                    "accounts": [
                      {
                        "account": "1930",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "3119,00"
                      },
                      {
                        "account": "2641",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "623,82",
                        "credit": "0,00"
                      },
                      {
                        "account": "1790",
                        "periodicity": {
                          "offsetAccount": "6210",
                          "startDate": "2020-05-01",
                          "endDate": "2021-04-30"
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "2495,29",
                        "credit": "0,00"
                      },
                      {
                        "account": "3740",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "0,11"
                      }
                    ]
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:30:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 411802,
                      "message": "Description is not valid.",
                      "details": "",
                      "element": "description"
                    },
                    {
                      "code": 411602,
                      "message": "Date is not valid.",
                      "details": "",
                      "element": "receiptDate"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:30:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:31:00"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:31:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:32:00"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Receipts"
        ],
        "summary": "Extract data from a receipt",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>A GET request to the <i>receipts</i> endpoint is used to extract data from a receipt (or other files that match the receipts representation). Supply the unique file ID from your file upload request, and AzoraOne will return extracted data from the receipt.</p>\n  <p>By adding the verification series (if known) as a query parameter, you will decrease the time for extraction and potentially improve the accuracy of the result since faulty positives from other series will not interfere with the result.</p>\n  <p>If successful, the request will return a 200 HTTP response with the receipt object included in the response body.</p>\n  <p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i> or <i>verificationSeries</i>, a 400 can also mean the file could not be processed — its extraction status has moved past the point where it can still be extracted from.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>fileID</i> itself wasn't found.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request. It can also mean this request's own extraction-statistics save failed after retrying once — a side effect unique to this operation among the extraction endpoints, since a GET here still writes usage/statistics data unless <code>readonlyMode</code> is set.</p>\n  <p>Provided that a similar receipt has previously been uploaded and bookkept, the user can begin to reap the benefits of self-learning automation. From now on, your application can offer extraction of data from similar receipts that are uploaded to AzoraOne.</p>\n  <h5>The extended receipt object</h5>\n  <p>In addition to traditional bookkeeping data, you can choose to extract additional information from a receipt.</p>\n  <p>The extended data do not feature any feedback mechanism (as opposed to the values in the original data object). Thus, you should not expect the accuracy of the values to increase with use. Nevertheless, the extended feature can provide you with additional insight into the files that your users upload to the AzoraOne API service.</p>\n  <p>In order to obtain the values from the parameters of the extended object, you will need to set the query parameter <i>extended</i> to true when sending a GET request to the <i>receipts</i> endpoint. If the parameter is not set, it will be interpreted as false and you will not receive any extended data. See the <a href=\"#response-schema\">response schema below</a> for the full list of extended fields and their formats.</p>\n  <h5>The origin receipt object</h5>\n  <p>In addition to extended data, you can choose to extract origin data from a receipt — see the <a href=\"#response-schema\">response schema below</a> for the ancestorType/companyID fields and what each ancestorType value means.</p>\n  <h5>Other areas of use</h5>\n  <p>The most obvious area of use for the <i>receipts</i> resource is cash receipts. However, as long as the parameters in the receipt object fit your needs, the resource can be used to extract data from vastly different verification types such as payslips, withdrawal slips or tax declarations.</p>\n  <p>The <i>receipts</i> resource is not primarily designed for extracting data from supplier invoices since the receipt object lacks parameters like invoice number, OCR number, due date etc. If you want to extract these parameter values from files, the <i>supplierInvoices</i> resource is better suited for this task. However, in cases where accounts payable is not used, the <i>receipts</i> resource may be used to extract supplier invoices as well.</p>\n</div>",
        "operationId": "extract-data-from-a-receipt",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "verificationSeries",
            "in": "query",
            "description": "Restricts extraction to a specific verification series. Decreases extraction time and can improve accuracy, since false positives from other series won't interfere with the result. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>; an invalid value returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "A"
            }
          },
          {
            "name": "extended",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>extended</code> field is populated with additional, non-feedback-corrected data extracted from the receipt — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "origin",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>origin</code> field is populated with information on what model generated the extraction result — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "description": "Employee breakfast",
                    "verificationSeries": "A",
                    "receiptDate": "2020-05-04",
                    "accounts": [
                      {
                        "account": "1930",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "3119,00"
                      },
                      {
                        "account": "2641",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "623,82",
                        "credit": "0,00"
                      },
                      {
                        "account": "1790",
                        "periodicity": {
                          "offsetAccount": "6210",
                          "startDate": "2020-05-01",
                          "endDate": "2021-04-30"
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "2495,29",
                        "credit": "0,00"
                      },
                      {
                        "account": "3740",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": ""
                        },
                        "costBearer": {
                          "targetValue": ""
                        },
                        "resultsCentre": {
                          "targetValue": ""
                        },
                        "debit": "0,00",
                        "credit": "0,11"
                      }
                    ]
                  },
                  "extended": {
                    "dates": [
                      "2020-05-03",
                      "2020-05-01",
                      "2021-04-30"
                    ],
                    "times": [
                      "2026-08-04"
                    ],
                    "emails": [
                      "info@arkimera.se"
                    ],
                    "currencies": [
                      "SEK"
                    ],
                    "creditCardNumbers": [
                      "0982-01-01"
                    ],
                    "corporateIdentityNumbers": [
                      "556550-5681"
                    ],
                    "ibans": [
                      "SE1150000000056241002716",
                      "NL91ABNA0417164300"
                    ],
                    "bic": [
                      "ESSESESS"
                    ],
                    "vatNumbersByCountry": {
                      "SE": [
                        "SE556600778601",
                        "SE559108741501"
                      ],
                      "NL": [
                        "NL001234567B01"
                      ]
                    },
                    "corporateIdentityNumbersByCountry": {
                      "SE": [
                        "5566007786",
                        "5020765649"
                      ],
                      "NL": [
                        "12345678"
                      ]
                    },
                    "countryOfOrigin": "SE"
                  },
                  "meta": "",
                  "origin": {
                    "ancestor": {
                      "ancestorType": "None",
                      "companyID": "19"
                    }
                  },
                  "time": "2026-08-06 10:20:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:20:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:22:00"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:22:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/progenitors/multiple": {
      "post": {
        "tags": [
          "Progenitors"
        ],
        "summary": "Add a progenitor list",
        "description": "Last updated: 2026-08-06\n\n<p>Create multiple <a href=\"/docs/progenitors/add-a-progenitor\">progenitor relationships</a> for a company in a single POST request, instead of calling Add a progenitor once per relationship.</p>\n\n<p>Each entry in the list follows the same structure and validation rules as an individual <a href=\"/docs/progenitors/add-a-progenitor#request-schema\">Add a progenitor</a> request — see the request schema below.</p>\n\n<p><b>Note on the 400 response:</b> a <code>400 Bad Request</code> can mean two different things here. If the request itself is malformed (an invalid <code>companyID</code>, a missing body, or an empty <code>progenitors</code> array), you'll get the standard error envelope shown in the 400 example below. But if the request was well-formed and every entry in the list individually failed validation, you'll instead get the same per-entry result list shape as the 200/409 responses — just with a 400 status instead. Check the shape of the body (does it have an <code>objectList</code>?), not just the status code, to tell these apart.</p>\n\n<p><b>Note on the 404 response:</b> only the top-level <code>companyID</code> not resolving to a company returns a 404 with the standard error envelope — an individual entry's <code>progenitorID</code> not resolving to a company is instead reported per-entry as part of a 400/409 <code>objectList</code> response.</p>\n\n<p><b>Note on the 409 response:</b> returned when the request is well-formed and at least one entry succeeded, but not all of them did — a mix of successes and failures across the list, each in its own entry in the same <code>objectList</code> shape.</p>\n\n<p>Each entry is created independently and commits to the database as it's processed — this is <b>not</b> transactional across the whole list. A failure partway through does not roll back entries that already succeeded, which is exactly why a partial failure is reported as 409 rather than a single pass/fail result.</p>\n\n<p>There is no limit on how many entries may be submitted in one request, and no requirement that <code>progenitorID</code> values within the list be distinct from each other — submitting the same <code>progenitorID</code> twice processes both independently, and the second one fails as a duplicate of the first.</p>",
        "operationId": "add-a-progenitor-list",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgenitorList"
              },
              "example": {
                "progenitors": [
                  {
                    "progenitorID": "c1",
                    "startDateTime": "2020-01-01 00:00:00",
                    "stopDateTime": "2020-12-31 23:59:59",
                    "supplierInvoices": true,
                    "customerInvoices": true,
                    "receipts": true
                  },
                  {
                    "progenitorID": "c2",
                    "startDateTime": "2021-01-01 00:00:00",
                    "stopDateTime": "",
                    "supplierInvoices": false,
                    "customerInvoices": false,
                    "receipts": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": true,
                      "data": {
                        "progenitorID": "c1",
                        "startDateTime": "2020-01-01 00:00:00",
                        "stopDateTime": "2020-12-31 23:59:59",
                        "supplierInvoices": true,
                        "customerInvoices": true,
                        "receipts": true
                      },
                      "objectID": "1"
                    },
                    {
                      "success": true,
                      "data": {
                        "progenitorID": "c2",
                        "startDateTime": "2021-01-01 00:00:00",
                        "stopDateTime": "",
                        "supplierInvoices": false,
                        "customerInvoices": false,
                        "receipts": true
                      },
                      "objectID": "2"
                    }
                  ],
                  "time": "2026-08-06 11:10:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:10:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:11:00"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgenitorResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": true,
                      "data": {
                        "progenitorID": "c1",
                        "startDateTime": "2020-01-01 00:00:00",
                        "stopDateTime": "2020-12-31 23:59:59",
                        "supplierInvoices": true,
                        "customerInvoices": true,
                        "receipts": true
                      },
                      "objectID": "1"
                    },
                    {
                      "success": false,
                      "data": [
                        {
                          "code": 111401,
                          "message": "Company ID not found.",
                          "details": "",
                          "element": "progenitorID"
                        }
                      ],
                      "objectID": "2"
                    }
                  ],
                  "time": "2026-08-06 11:11:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 11:12:00"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/models": {
      "patch": {
        "tags": [
          "Models"
        ],
        "summary": "Update models' status",
        "description": "Last updated: 2026-08-06\n\n<p>Bulk-enable or bulk-disable the learned extraction patterns (\"models\") AzoraOne uses to automatically extract data from future uploads for this company. A pattern is created and refined automatically as you use the extraction and bookkeeping operations across supplier invoices, customer invoices, and receipts — this operation lets you turn a set of them off (or back on) without deleting them.</p>\n\n<p>This is a <b>bulk</b> operation — there is no way to target a single pattern by ID. Every pattern for the company that matches the <i>type</i>/<i>supplierID</i>/<i>startDateTime</i>/<i>endDateTime</i> filters is affected in one call; omitting all filters affects every pattern for the company. The response does not report how many patterns were affected or which ones — only that the request was accepted.</p>\n\n<p>Disabling a pattern (<code>active: false</code>) removes it from consideration for future extractions immediately; re-enabling (<code>active: true</code>) makes it eligible again. Nothing is deleted — patterns can be toggled back and forth freely. If this company acts as a <a href=\"/docs/progenitors/add-a-progenitor\">progenitor</a> for other companies, disabling one of its patterns also stops that pattern from being used by those companies until it's re-enabled.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid <i>supplierID</i>, an invalid or unrecognized <i>type</i>, a malformed or out-of-order <i>startDateTime</i>/<i>endDateTime</i>, or a missing request body.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>supplierID</i> you submitted doesn't resolve to an existing supplier.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "update-models-status",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Restricts the update to patterns of this document type: <code>SupplierInvoice</code>, <code>CustomerInvoice</code>, <code>Receipt</code>, or <code>Other</code>. Optional — if omitted, patterns of every type are affected (subject to the other filters). An unrecognized value returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "SupplierInvoice"
            }
          },
          {
            "name": "supplierID",
            "in": "query",
            "description": "Restricts the update to patterns linked to this specific supplier. Only meaningful together with <code>type=SupplierInvoice</code> — supplying it with any other <code>type</code> value, or without <code>type</code> at all, returns a 400 response. Optional; if supplied, it must resolve to an existing supplier — see <a href=\"/docs/suppliers/add-a-supplier#request-schema\">Add a supplier</a>.",
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "startDateTime",
            "in": "query",
            "description": "Only affects patterns created on or after this date/time, formatted yyyy-MM-dd HH:mm:ss. Optional, and independent of <code>endDateTime</code> — either may be supplied without the other.",
            "schema": {
              "type": "string",
              "default": "2020-01-01 00:00:00"
            }
          },
          {
            "name": "endDateTime",
            "in": "query",
            "description": "Only affects patterns created on or before this date/time, formatted yyyy-MM-dd HH:mm:ss. Optional, and independent of <code>startDateTime</code>. If both are supplied, <code>startDateTime</code> must not be later than <code>endDateTime</code>, or the request returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "2024-11-30 00:00:00"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelUpdateItem"
              },
              "example": {
                "active": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelsUpdateResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "active": false
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:40:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 911901,
                      "message": "Type does not exist.",
                      "details": "The type value must be either 'SupplierInvoice', 'Receipt'.",
                      "element": "type"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:40:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:41:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:41:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files/{fileID}/details": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Retrieve file details",
        "description": "Last updated: 2026-08-05\n\n<div class=\"description\">\n  <p>A GET request to this operation returns a comprehensive view of a single file's lifecycle — its metadata, optional raw content, calculated conformity score, and event history. Use it to power a \"file details\" page where users can:</p>\n  <ul>\n    <li>See core file info (<i>fileID</i>, <i>fileName</i>, <i>status</i>, <i>type</i>, <i>createdDate</i>, etc.) — see the <a href=\"#response-schema\">Response schema below</a> for the full field list</li>\n    <li>Embed the actual document (<i>fileContent=true</i>) for preview or download</li>\n    <li>Assess AzoraOne's performance by comparing extracted values against booked data (<i>conformity=true</i>)</li>\n    <li>Drill into processing history — either just the comparison events (<i>eventSet=latestComparison</i>) or every extraction and booking in order (<i>eventSet=eventHistory</i>)</li>\n  </ul>\n  <p><b>Note:</b> the two event shapes use different keys for the same concept — an <i>eventHistory</i> item's document type is under <code>type</code>, while the equivalent field on a <i>latestComparison</i> item is <code>effectiveType</code>. See the <a href=\"#response-schema\">response schema below</a> for both.</p>\n  <p>See the <a href=\"#parameters\">Parameters section below</a> for the full set of query parameters.</p>\n</div>",
        "operationId": "retrieve-file-details",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conformity",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>conformity</code> field is populated — see <a href=\"#response-schema\">ConformityItem</a> and the Quality &amp; Performance documentation for the calculation logic. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "conformityFilters",
            "in": "query",
            "description": "Restricts the conformity calculation to specific fields. Allowed only together with <code>conformity=true</code>; supplying it without <code>conformity=true</code> returns a 400 response. Accepts a comma-separated list of field names: for receipts, <code>receiptDate</code>, <code>description</code> or <code>accounts</code>; for supplier invoices, <code>supplier</code>, <code>description</code>, <code>invoiceDate</code>, <code>dueDate</code>, <code>invoiceNumber</code>, <code>ocrNumber</code>, <code>refNumber</code>, <code>orderNumber</code>, <code>ourRef</code>, <code>yourRef</code>, <code>totalSum</code>, <code>vat</code> or <code>accounts</code>. See the Quality &amp; Performance and Field Filtering documentation for full details.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileContent",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>fileContent</code> field is populated with the file's raw content as a data URI, for embedding, preview or download. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "fileText",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>fileText</code> field is populated with the raw text extracted from the file via OCR — see <a href=\"#response-schema\">FileText</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "eventSet",
            "in": "query",
            "description": "Which processing events to include in the response. <code>latestComparison</code> (default) returns only the extraction and booking used for the conformity calculation, as <code>latestComparison.extraction</code>/<code>.booking</code>. <code>eventHistory</code> returns every extraction and booking event for the file, in chronological order, as the <code>eventHistory</code> array.",
            "schema": {
              "type": "string",
              "default": "latestComparison"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDetailResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "fileID": "1",
                    "fileName": "file1.pdf.pdf",
                    "status": "BOOKED",
                    "type": "SupplierInvoice",
                    "effectiveType": null,
                    "verificationSeries": "",
                    "conformity": {
                      "value": 100
                    },
                    "createdDate": "2025-06-15 09:07:07",
                    "eventHistory": [
                      {
                        "eventType": "Booking",
                        "type": "SupplierInvoice",
                        "eventDate": "2025-06-17 08:13:47",
                        "supplierID": "1",
                        "description": "",
                        "verificationSeries": "",
                        "invoiceDate": "2025-05-15",
                        "dueDate": "2025-05-29",
                        "invoiceNumber": "529496",
                        "ocrNumber": "52949682",
                        "ourRef": "",
                        "yourRef": "",
                        "totalSum": "6808,00",
                        "vat": "",
                        "accounts": [
                          {
                            "account": "4215",
                            "periodicity": {
                              "offsetAccount": "",
                              "startDate": "",
                              "endDate": ""
                            },
                            "project": {
                              "targetValue": ""
                            },
                            "costBearer": {
                              "targetValue": ""
                            },
                            "resultsCentre": {
                              "targetValue": ""
                            },
                            "debit": "6808,00",
                            "credit": ""
                          }
                        ]
                      },
                      {
                        "eventType": "Extraction",
                        "type": "SupplierInvoice",
                        "eventDate": "2025-06-15 08:13:19",
                        "supplierID": "1",
                        "description": "",
                        "verificationSeries": "",
                        "invoiceDate": "2025-05-15",
                        "dueDate": "2025-05-29",
                        "invoiceNumber": "529496",
                        "ocrNumber": "52949682",
                        "ourRef": "",
                        "yourRef": "",
                        "totalSum": "6808,00",
                        "vat": "",
                        "accounts": [
                          {
                            "account": "4215",
                            "periodicity": {
                              "offsetAccount": "",
                              "startDate": "",
                              "endDate": ""
                            },
                            "project": {
                              "targetValue": ""
                            },
                            "costBearer": {
                              "targetValue": ""
                            },
                            "resultsCentre": {
                              "targetValue": ""
                            },
                            "debit": "6808,00",
                            "credit": ""
                          }
                        ]
                      },
                      {
                        "eventType": "Extraction",
                        "type": "SupplierInvoice",
                        "eventDate": "2025-06-14 09:07:10",
                        "supplierID": "1",
                        "description": "",
                        "verificationSeries": "",
                        "invoiceDate": "2025-05-15",
                        "dueDate": "2025-05-29",
                        "invoiceNumber": "529496",
                        "ocrNumber": "52949682",
                        "ourRef": "",
                        "yourRef": "",
                        "totalSum": "6808,00",
                        "vat": "",
                        "accounts": [
                          {
                            "account": "4215",
                            "periodicity": {
                              "offsetAccount": "",
                              "startDate": "",
                              "endDate": ""
                            },
                            "project": {
                              "targetValue": ""
                            },
                            "costBearer": {
                              "targetValue": ""
                            },
                            "resultsCentre": {
                              "targetValue": ""
                            },
                            "debit": "6808,00",
                            "credit": ""
                          }
                        ]
                      }
                    ],
                    "fileContent": "data:application/pdf;base64,JVBERi0xLjUKJcTl8uXrp/Og0MTGCjEgMCBvYmoKPDwvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFI+PgplbmRvYmoKMiAwIG9iago8PC9UeXBlIC9QYWdlcyAvQ291bnQgMSAvS2lkcyBbMyAwIFJdID4+CmVuZG9iagozIDAgb2JqCjw8L1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA1OTUuMjggODQxLjg1XSA+PgplbmRvYmoKeHJlZgoKMCA0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAwMDAxMCAwMDAwMCBuIAowMDAwMDAwMDY1IDAwMDAwIG4gCjAwMDAwMDAxMTkgMDAwMDAgbiAKMDAwMDAwMDIxNSAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgNCAvUm9vdCAxIDAgUiAvSW5mbyA4IDAgUiAvSUQgWyAzNDQwYWQ0ODQyYWRkZTNkYjMzOGQ3YjE5NTE5MzQ2XSAvUHJldmlldyA3IDAgUiA+PgpzdGFydHhyZWYKNDE1CiUlRU9G==",
                    "fileText": {
                      "rawText": "Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos."
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2025-06-23 16:13:29"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211402,
                      "message": "File ID is not valid.",
                      "details": "",
                      "element": "fileID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-08-30 08:04:02"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:40:48"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2020-07-28 07:45:27"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/customers": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Add a customer",
        "description": "Last updated: 2026-05-18\n\n<p>Identifying the correct customer on a customer-invoice extraction request is critical for a frictionless experience. AzoraOne provides a robust, rule-based mechanism for selecting a customer by matching values in the customer list against data found on the extracted document.</p>\n\n<p>You will need to create a customer in order to:</p>\n<ul>\n    <li>Help locate a <i>customerID</i> from the customer list when extracting a customer invoice.</li>\n    <li>Bookkeep the <i>customerID</i> parameter to customer invoices.</li>\n</ul>\n\n<p>To secure correct and consistent identification of customers, make sure POST requests contain correctly formatted values that are unique to the actual customer, either as single entities or in combination with each other. See the <a href=\"#request-schema\">request schema below</a> for the formatting and validation rules for each field.</p>\n\n<p><b>At least one identifying field is required:</b> one of <code>legalRegistrationNumber</code>, <code>vatNumber</code> or a <code>customerTag</code> must have a value — <code>countryOfOrigin</code> alone does not count. Leaving all of them empty returns 400 (code 621101).</p>\n\n<p><b>Note on the 400 response:</b> as well as a field failing its own format check (see the request schema below), a 400 can mean the <code>customerID</code> you submitted already belongs to another customer in this company, a customer tag exceeds 100 characters (code 627102), or that every identifying field above was left empty.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "add-a-customer",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerItem"
              },
              "example": {
                "customerID": "1",
                "customerName": "Telavox",
                "legalRegistrationNumber": "556600-7786",
                "vatNumber": "SE556600778601",
                "countryOfOrigin": "SE",
                "customerTags": {
                  "customerTag1": "billing@telavox.se",
                  "customerTag2": "+46712345678",
                  "customerTag3": "",
                  "customerTag4": "",
                  "customerTag5": "",
                  "customerTag6": ""
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customerID": "1",
                    "customerName": "Telavox",
                    "legalRegistrationNumber": "556600-7786",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "customerTags": {
                      "customerTag1": "billing@telavox.se",
                      "customerTag2": "+46712345678",
                      "customerTag3": "",
                      "customerTag4": "",
                      "customerTag5": "",
                      "customerTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621101,
                      "message": "Legal registration number, vat number and customertags are missing",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve all customers",
        "description": "Last updated: 2026-08-06\n\n<p>Retrieve a paginated list of the customers added to a company.</p>\n\n<p>The endpoint defaults to <code>pageNumber=1</code> and <code>pageSize=10</code>. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied — supplying only one returns a <code>400 Bad Request</code>. <code>pageSize</code> cannot exceed 100.</p>\n\n<p>This operation accepts no other query parameters — any name other than <code>pageNumber</code>/<code>pageSize</code> is rejected with a <code>400 Bad Request</code> rather than being silently ignored. There is no way to filter, search, or change the sort order; results are always returned in internal creation order.</p>\n\n<p><b>NOTE:</b> a database failure while fetching the page also returns <code>400 Bad Request</code> (code 1009220), not <code>500 Internal Server Error</code> — the same code this operation's 500 response uses for its own database-failure cases. The two are distinguishable by the <code>details</code> field: query-parameter validation errors always carry a non-empty <code>details</code> string, this one does not.</p>",
        "operationId": "retrieve-all-customers",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "1-based page number to return. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>1</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Customers per page, up to 100. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>10</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerListResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customers": [
                      {
                        "customerID": "1",
                        "customerName": "Telavox",
                        "legalRegistrationNumber": "556600-7786",
                        "vatNumber": "SE556600778601",
                        "countryOfOrigin": "SE",
                        "customerTags": {
                          "customerTag1": "billing@telavox.se",
                          "customerTag2": "+46712345678",
                          "customerTag3": "",
                          "customerTag4": "",
                          "customerTag5": "",
                          "customerTag6": ""
                        }
                      },
                      {
                        "customerID": "2",
                        "customerName": "Acme Consulting",
                        "legalRegistrationNumber": "19800101-1234",
                        "vatNumber": "",
                        "countryOfOrigin": "SE",
                        "customerTags": {
                          "customerTag1": "accounts@acme.example",
                          "customerTag2": "Box 123, 11122 Stockholm",
                          "customerTag3": "",
                          "customerTag4": "",
                          "customerTag5": "",
                          "customerTag6": ""
                        }
                      }
                    ]
                  },
                  "extended": "",
                  "meta": {
                    "pagination": {
                      "pageNumber": 1,
                      "pageSize": 10,
                      "totalItems": 2,
                      "totalPages": 1
                    }
                  },
                  "origin": "",
                  "time": "2026-08-06 09:30:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 101152,
                      "message": "Query parameter is not valid",
                      "details": "Max allowed value is 100.",
                      "element": "pageSize"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:31:00"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:31:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:32:00"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/customers/multiple": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Add a customer list",
        "description": "Last updated: 2026-05-18\n\n<p>To streamline the process of customer onboarding, this operation allows you to submit a list of customers in a single POST request.</p>\n\n<p>This is especially useful when initializing the customer list for a company or syncing from an external database.</p>\n\n<p>Each customer in the list follows the same structure and validation rules as an <a href=\"/docs/customers/add-a-customer#request-schema\">individual customer creation request</a> — see the request schema below for the formatting and validation rules for each field. Accurate customer information is essential for identifying the correct customer when extracting and booking customer invoices.</p>\n\n<p>The system uses a rule-based mechanism to identify customers based on unique parameter values found in the extracted documents. To ensure reliable identification, at least one valid identifying field or one valid customer tag must be provided per customer.</p>\n\n<p><b>Note on the 400 response:</b> a <code>400 Bad Request</code> can mean two different things here. If the request itself is malformed (an invalid <code>companyID</code>, a missing body, or an empty <code>customers</code> array), you'll get the standard error envelope shown in the 400 example below. But if the request was well-formed and every customer in the list individually failed validation, you'll instead get the same per-customer result list shape as the 200/409 responses — just with a 400 status instead. Check the shape of the body (does it have an <code>objectList</code>?), not just the status code, to tell these apart.</p>\n\n<p><b>Note on the 409 response:</b> returned when the request is well-formed and at least one customer succeeded, but not all of them did — a mix of successes and failures across the list, each in its own entry in the same <code>objectList</code> shape.</p>",
        "operationId": "add-a-customer-list",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerList"
              },
              "example": {
                "customers": [
                  {
                    "customerID": "1",
                    "customerName": "Telavox",
                    "legalRegistrationNumber": "556600-7786",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "customerTags": {
                      "customerTag1": "billing@telavox.se",
                      "customerTag2": "+46712345678",
                      "customerTag3": "",
                      "customerTag4": "",
                      "customerTag5": "",
                      "customerTag6": ""
                    }
                  },
                  {
                    "customerID": "2",
                    "customerName": "Acme Consulting",
                    "legalRegistrationNumber": "19800101-1234",
                    "vatNumber": "",
                    "countryOfOrigin": "SE",
                    "customerTags": {
                      "customerTag1": "accounts@acme.example",
                      "customerTag2": "Box 123, 11122 Stockholm",
                      "customerTag3": "",
                      "customerTag4": "",
                      "customerTag5": "",
                      "customerTag6": ""
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": true,
                      "data": {
                        "customerID": "1",
                        "customerName": "Telavox",
                        "legalRegistrationNumber": "556600-7786",
                        "vatNumber": "SE556600778601",
                        "countryOfOrigin": "SE",
                        "customerTags": {
                          "customerTag1": "billing@telavox.se",
                          "customerTag2": "+46712345678",
                          "customerTag3": "",
                          "customerTag4": "",
                          "customerTag5": "",
                          "customerTag6": ""
                        }
                      },
                      "objectID": "1"
                    },
                    {
                      "success": true,
                      "data": {
                        "customerID": "2",
                        "customerName": "Acme Consulting",
                        "legalRegistrationNumber": "19800101-1234",
                        "vatNumber": "",
                        "countryOfOrigin": "SE",
                        "customerTags": {
                          "customerTag1": "accounts@acme.example",
                          "customerTag2": "Box 123, 11122 Stockholm",
                          "customerTag3": "",
                          "customerTag4": "",
                          "customerTag5": "",
                          "customerTag6": ""
                        }
                      },
                      "objectID": "2"
                    }
                  ],
                  "time": "2026-05-18 20:18:34"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponseObjectList"
                },
                "example": {
                  "objectList": [
                    {
                      "success": false,
                      "data": [
                        {
                          "code": 621101,
                          "message": "Legal registration number, vat number and customertags are missing",
                          "details": "",
                          "element": ""
                        }
                      ],
                      "objectID": "1"
                    },
                    {
                      "success": true,
                      "data": {
                        "customerID": "2",
                        "customerName": "Acme Consulting",
                        "legalRegistrationNumber": "19800101-1234",
                        "vatNumber": "",
                        "countryOfOrigin": "SE",
                        "customerTags": {
                          "customerTag1": "accounts@acme.example",
                          "customerTag2": "Box 123, 11122 Stockholm",
                          "customerTag3": "",
                          "customerTag4": "",
                          "customerTag5": "",
                          "customerTag6": ""
                        }
                      },
                      "objectID": "2"
                    }
                  ],
                  "time": "2026-05-18 20:18:34"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-05-20 12:00:00"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/customers/{customerID}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a customer",
        "description": "Last updated: 2026-08-06\n\n<p>In order to retrieve the customer object of a customer that has been added to a company, send a GET request to this operation.</p>\n\n<p>The request URL must include the <i>companyID</i> of the company that the customer has been added to and the <i>customerID</i> of the customer that you want to retrieve.</p>\n\n<p>If successful, the request will return a 200 HTTP response with the customer object included in the response body.</p>",
        "operationId": "retrieve-a-customer",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "customerID",
            "in": "path",
            "description": "The customer's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customerID": "1",
                    "customerName": "Telavox",
                    "legalRegistrationNumber": "556600-7786",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "customerTags": {
                      "customerTag1": "billing@telavox.se",
                      "customerTag2": "+46712345678",
                      "customerTag3": "",
                      "customerTag4": "",
                      "customerTag5": "",
                      "customerTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:22:35"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621402,
                      "message": "Customer ID is not valid.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:23:10"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621401,
                      "message": "Customer ID not found.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:23:44"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:24:02"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Last updated: 2026-08-06\n\n<p><b>NOTE:</b> When updating a resource, new information overwrites the existing information — this is a full replace, not a partial update. Any field you leave empty is cleared, not left unchanged.</p>\n\n<p>Unlike creating a customer, updating one does <b>not</b> require at least one base parameter or customer tag to be set — every field, including all customer tags, may be left empty. This lets you clear a customer's details while keeping the record itself (and its history) in place. See the request schema below for the formatting rules that still apply to any field you do set.</p>\n\n<p>The <code>customerID</code> in the request body must match the <code>customerID</code> in the URL — a mismatch returns a <code>400 Bad Request</code>.</p>",
        "operationId": "update-a-customer",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "customerID",
            "in": "path",
            "description": "The customer's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerItem"
              },
              "example": {
                "customerID": "1",
                "customerName": "Telavox",
                "legalRegistrationNumber": "556600-7786",
                "vatNumber": "SE556600778601",
                "countryOfOrigin": "SE",
                "customerTags": {
                  "customerTag1": "billing@telavox.se",
                  "customerTag2": "+46712345678",
                  "customerTag3": "",
                  "customerTag4": "",
                  "customerTag5": "",
                  "customerTag6": ""
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customerID": "1",
                    "customerName": "Telavox",
                    "legalRegistrationNumber": "556600-7786",
                    "vatNumber": "SE556600778601",
                    "countryOfOrigin": "SE",
                    "customerTags": {
                      "customerTag1": "billing@telavox.se",
                      "customerTag2": "+46712345678",
                      "customerTag3": "",
                      "customerTag4": "",
                      "customerTag5": "",
                      "customerTag6": ""
                    }
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:40:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621402,
                      "message": "Customer ID is not valid.",
                      "details": "CustomerID parameter and CustomerID in Body mismatch.",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:40:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621401,
                      "message": "Customer ID not found.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:41:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:41:30"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "description": "Last updated: 2026-08-06\n\n<p>You can delete a customer resource by using this operation.</p>\n\n<p>The request URL must include both <i>companyID</i> and <i>customerID</i>.</p>\n\n<p>If successful, the request will return a 200 HTTP response with an empty data object in the body.</p>",
        "operationId": "delete-a-customer",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "customerID",
            "in": "path",
            "description": "The customer's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDeleteResponse"
                },
                "example": {
                  "success": true,
                  "data": {},
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:50:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621402,
                      "message": "Customer ID is not valid.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:50:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621401,
                      "message": "Customer ID not found.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:51:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 09:51:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/files/{fileID}/customerInvoices": {
      "get": {
        "tags": [
          "Customer invoices"
        ],
        "summary": "Extract data from a customer invoice",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>A GET request to the <i>customerInvoices</i> endpoint is used to extract data from a customer invoice (or other files that match the customerInvoices representation). Supply the unique file ID from your file upload request, and AzoraOne will return extracted data from the customer invoice.</p>\n  <p>Customer invoices are outgoing invoices — this operation is the customer-invoice equivalent of <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice\">Extract data from an invoice</a>. Customer master data (legal registration number, VAT number, and customer tags — see <a href=\"/docs/customers/add-a-customer#request-schema\">CustomerItem</a>) is used to match a <code>customerID</code>, in place of the supplier signals used for supplier invoices.</p>\n  <p>By adding the verification series (if known) as a query parameter, you will decrease the time for extraction and potentially improve the accuracy of the result since faulty positives from other series will not interfere with the result.</p>\n  <p>If successful, the request will return a 200 HTTP response with the customer invoice object included in the response body.</p>\n  <p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i> or <i>verificationSeries</i>, a 400 can also mean the file could not be processed — its extraction status has moved past the point where it can still be extracted from.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>fileID</i> that wasn't found, a 404 can also mean the <i>companyID</i> itself doesn't resolve to a company.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>\n  <h5>The extended customer invoice object</h5>\n  <p>In addition to traditional bookkeeping data, you can choose to extract additional information from a customer invoice.</p>\n  <p>The extended data do not feature any feedback mechanism (as opposed to the values in the original data object). Thus, you should not expect the accuracy of the values to increase with use. Nevertheless, the extended feature can provide you with additional insight into the files that your users upload to the AzoraOne API service.</p>\n  <p>In order to obtain the values from the parameters of the extended object, you will need to set the query parameter <i>extended</i> to true when sending a GET request to the <i>customerInvoices</i> endpoint. If the parameter is not set, it will be interpreted as false and you will not receive any extended data.</p>\n  <p>Unlike the equivalent object on supplier invoices, this does not include <code>bankAccountNumbers</code> or <code>plusGiroNumbers</code> — see the <a href=\"#response-schema\">response schema below</a> for the full list of extended fields and their formats.</p>\n  <h5>The origin customer invoice object</h5>\n  <p>In addition to extended data, you can choose to extract origin data from a customer invoice — see the <a href=\"#response-schema\">response schema below</a> for the ancestorType/companyID fields and what each ancestorType value means.</p>\n</div>",
        "operationId": "extract-data-from-a-customer-invoice",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2"
            }
          },
          {
            "name": "verificationSeries",
            "in": "query",
            "description": "Restricts extraction to a specific verification series. Decreases extraction time and can improve accuracy, since false positives from other series won't interfere with the result. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>; an invalid value returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "A"
            }
          },
          {
            "name": "extended",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>extended</code> field is populated with additional, non-feedback-corrected data extracted from the invoice — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "origin",
            "in": "query",
            "description": "When set to <code>true</code>, the response's <code>origin</code> field is populated with information on what model generated the extraction result — see the <a href=\"#response-schema\">response schema below</a>. Defaults to <code>false</code>.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerInvoiceResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customerID": "1",
                    "description": "Music license fee for period 2025-07-01 to 2025-12-31",
                    "verificationSeries": "A",
                    "invoiceDate": "2025-10-06",
                    "dueDate": "2025-11-05",
                    "invoiceNumber": "779191",
                    "ocrNumber": "22880377919146",
                    "referenceNumber": "12345",
                    "orderNumber": "12345",
                    "ourRef": "Accounts Receivable",
                    "yourRef": "Jon Johansson",
                    "totalSum": "4950,00",
                    "vat": "280,20",
                    "accounts": [
                      {
                        "account": "3041",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "",
                        "credit": "4669,80"
                      }
                    ]
                  },
                  "extended": {
                    "dates": [
                      "2025-10-06",
                      "2025-11-05"
                    ],
                    "times": [
                      "2026-08-04"
                    ],
                    "emails": [
                      "billing@telavox.se"
                    ],
                    "currencies": [
                      "SEK"
                    ],
                    "creditCardNumbers": [],
                    "corporateIdentityNumbers": [
                      "556600-7786"
                    ],
                    "ibans": [],
                    "bic": [],
                    "vatNumbersByCountry": {
                      "SE": [
                        "SE556600778601"
                      ]
                    },
                    "corporateIdentityNumbersByCountry": {
                      "SE": [
                        "5566007786"
                      ]
                    },
                    "countryOfOrigin": "SE"
                  },
                  "meta": "",
                  "origin": {
                    "ancestor": {
                      "ancestorType": "None",
                      "companyID": "23"
                    }
                  },
                  "time": "2026-08-06 10:00:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:00:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211401,
                      "message": "File ID not found.",
                      "details": "",
                      "element": "fileID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:01:00"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:01:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:02:00"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Customer invoices"
        ],
        "summary": "Bookkeep a customer invoice",
        "description": "Last updated: 2026-08-06\n\n<div class=\"description\">\n  <p>An integral part of AzoraOne is the built-in self-learning capability. In order to learn, AzoraOne must have the correct input data. We think the user, be it the small business owner or a professional accountant, knows the company best. Consequently, we use the data generated by the user upon bookkeeping as our learning data. To enable this, send a PUT request to the <i>customerInvoices</i> endpoint when the user presses the bookkeep button in your application.</p>\n  <p>The request will update the customer invoice object with the correct values.</p>\n  <p>If successful, the request will return a 200 HTTP response with the customer invoice object included in the response body. As a side effect, the file's status is always advanced to <code>BOOKED</code> once bookkeeping succeeds, regardless of what its status was before.</p>\n  <p><b>Note on the 400 response:</b> most causes are field-level validation failures — see the <a href=\"#request-schema\">request schema below</a> for each field's rules. The two other causes are the file itself being unprocessable, and <code>totalSum</code>, <code>vat</code> and the account rows' <code>debit</code>/<code>credit</code> failing to balance: <code>totalSum</code> plus the sum of every row's <code>debit</code> must equal <code>vat</code> plus the sum of every row's <code>credit</code> (tolerance &lt;0.001) — otherwise the request returns \"Debit and credit do not balance.\" This is the reverse polarity of the balance rule used for supplier invoices, since customer invoices are outgoing.</p>\n  <p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 can also mean the <i>fileID</i> wasn't found, or that a non-empty <i>customerID</i> you submitted doesn't resolve to an existing customer.</p>\n  <p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request. Unlike supplier invoices, a customer-invoice bookkeep request can still return a 500 after the file's status has already been set to <code>BOOKED</code> — if saving the invoice for self-learning processing subsequently fails, that status change is not rolled back.</p>\n  <p>This operation is the customer-invoice equivalent of <a href=\"/docs/supplier-invoices/bookkeep-an-invoice\">Bookkeep an invoice</a> — see that operation for more on the self-learning sorting mechanism (teaching AzoraOne to categorize future uploads by type and verification series), which works identically for customer invoices.</p>\n</div>",
        "operationId": "bookkeep-a-customer-invoice",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "fileID",
            "in": "path",
            "description": "The file's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInvoiceItem"
              },
              "example": {
                "customerID": "1",
                "description": "Music license fee for period 2025-07-01 to 2025-12-31",
                "verificationSeries": "A",
                "invoiceDate": "2025-10-06",
                "dueDate": "2025-11-05",
                "invoiceNumber": "779191",
                "ocrNumber": "22880377919146",
                "referenceNumber": "12345",
                "orderNumber": "12345",
                "ourRef": "Accounts Receivable",
                "yourRef": "Jon Johansson",
                "totalSum": "4950,00",
                "vat": "990,00",
                "accounts": [
                  {
                    "account": "3041",
                    "periodicity": {
                      "offsetAccount": "",
                      "startDate": "",
                      "endDate": ""
                    },
                    "project": {
                      "targetValue": "P657588"
                    },
                    "costBearer": {
                      "targetValue": "10"
                    },
                    "resultsCentre": {
                      "targetValue": "20"
                    },
                    "debit": "",
                    "credit": "3960,00"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerInvoiceBookkeepResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "customerID": "1",
                    "description": "Music license fee for period 2025-07-01 to 2025-12-31",
                    "verificationSeries": "A",
                    "invoiceDate": "2025-10-06",
                    "dueDate": "2025-11-05",
                    "invoiceNumber": "779191",
                    "ocrNumber": "22880377919146",
                    "referenceNumber": "12345",
                    "orderNumber": "12345",
                    "ourRef": "Accounts Receivable",
                    "yourRef": "Jon Johansson",
                    "totalSum": "4950,00",
                    "vat": "990,00",
                    "accounts": [
                      {
                        "account": "3041",
                        "periodicity": {
                          "offsetAccount": "",
                          "startDate": "",
                          "endDate": ""
                        },
                        "project": {
                          "targetValue": "P657588"
                        },
                        "costBearer": {
                          "targetValue": "10"
                        },
                        "resultsCentre": {
                          "targetValue": "20"
                        },
                        "debit": "",
                        "credit": "3960,00"
                      }
                    ]
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:10:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 321602,
                      "message": "Date is not valid.",
                      "details": "",
                      "element": "invoiceDate"
                    },
                    {
                      "code": 325492,
                      "message": "Debit and credit do not balance.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:10:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 621401,
                      "message": "Customer ID not found.",
                      "details": "",
                      "element": "customerID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:11:00"
                }
              }
            }
          },
          "412": {
            "description": "PreconditionFailed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 211215,
                      "message": "File is not ready for extraction.",
                      "details": "",
                      "element": "file"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:11:30"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 10:12:00"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/patterns": {
      "get": {
        "tags": [
          "Patterns"
        ],
        "summary": "Retrieve all patterns",
        "description": "Last updated: 2026-08-06\n\n<p>Retrieve the company's patterns, with optional filtering and sorting.</p>\n\n<p>This operation always paginates: if you don't supply <i>pageNumber</i>/<i>pageSize</i>, the first page (size 10) is returned regardless — <code>meta.pagination</code> is always present in the response, never omitted.</p>\n\n<p>Any query parameter name other than the ones listed below is rejected with a 400 response, not silently ignored.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "retrieve-all-patterns",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Restricts results to patterns with this source: <code>client</code> or <code>provider</code> — see <a href=\"/docs/patterns/add-a-pattern#request-schema\">Add a pattern</a> for what each means. Optional — omit to include every source, including <code>system</code>-authored patterns (which this filter can't select for on its own). An unsupported value, such as <code>system</code>, returns a 400 response.",
            "schema": {
              "type": "string",
              "default": "client"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "1-based page number to return. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>1</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Patterns per page, up to 100. If either <code>pageNumber</code> or <code>pageSize</code> is supplied, both must be supplied. Defaults to <code>10</code> when neither is supplied.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "The field to sort by. Currently only supports <code>createdDateUTC</code>. Results are always secondarily ordered by <code>patternID</code> for a stable, deterministic tiebreak.",
            "schema": {
              "type": "string",
              "default": "createdDateUTC"
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "description": "Sort direction: <code>asc</code> or <code>desc</code>. Defaults to <code>desc</code>.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatternListResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "patterns": [
                      {
                        "patternID": "1",
                        "type": "SupplierInvoice",
                        "verificationSeries": "A",
                        "identifiers": [
                          "telavox",
                          "telecom",
                          "invoice"
                        ],
                        "source": "client",
                        "createdDate": "2026-08-06 12:00:00"
                      },
                      {
                        "patternID": "2",
                        "type": "Receipt",
                        "verificationSeries": "",
                        "identifiers": [
                          "parking",
                          "receipt",
                          "garage"
                        ],
                        "source": "provider",
                        "createdDate": "2026-08-05 09:30:00"
                      }
                    ]
                  },
                  "extended": "",
                  "meta": {
                    "pagination": {
                      "pageNumber": 1,
                      "pageSize": 10,
                      "totalItems": 2,
                      "totalPages": 1
                    }
                  },
                  "origin": "",
                  "time": "2026-08-06 12:20:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 101152,
                      "message": "Query parameter is not valid",
                      "details": "pageSize must be between 1 and 100.",
                      "element": "pageSize"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:20:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:21:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:21:30"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Patterns"
        ],
        "summary": "Add a pattern",
        "description": "Last updated: 2026-08-06\n\n<p>Create a pattern for a company.</p>\n\n<p>Patterns are used to classify and sort incoming documents: AzoraOne's OCR pipeline compares the recognized vocabulary on a newly-uploaded file against your patterns' <i>identifiers</i>, and the best match determines the file's suggested <i>type</i> and <i>verificationSeries</i> — the same fields shown on <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a>. This is a separate mechanism from the account-mapping patterns behind <a href=\"/docs/models/update-models-status\">Update models' status</a>: those affect what gets extracted from a document once its type is already known, while patterns decide the type/series in the first place, before extraction happens.</p>\n\n<p><b>Important:</b> the <i>identifiers</i> you submit must already exist in AzoraOne's identifier vocabulary — a single shared vocabulary reused across every company, not something scoped to your own. Identifiers are added to this vocabulary automatically as documents are OCR-processed; this API can only reference words AzoraOne has already encountered somewhere, it cannot register a brand-new identifier directly. An identifier your own company has never uploaded a document containing may still be valid if another company's document introduced it first.</p>\n\n<p>See the <a href=\"#request-schema\">request schema below</a> for validation rules on every field.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i> or a missing request body, a 400 can mean an invalid or missing <i>patternID</i>, an invalid <i>type</i> or <i>verificationSeries</i>, missing/invalid/unrecognized <i>identifiers</i>, a <i>patternID</i> that already exists for this company, or a pattern with the exact same set of identifiers already existing under a different <i>patternID</i>.</p>\n\n<p><b>Note on the 404 response:</b> returned when <i>companyID</i> doesn't resolve to a company.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "add-a-pattern",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatternItemRequest"
              },
              "example": {
                "patternID": "1",
                "type": "SupplierInvoice",
                "verificationSeries": "A",
                "identifiers": [
                  "telavox",
                  "telecom",
                  "invoice"
                ],
                "source": "client"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatternItemResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "patternID": "1",
                    "type": "SupplierInvoice",
                    "verificationSeries": "A",
                    "identifiers": [
                      "telavox",
                      "telecom",
                      "invoice"
                    ],
                    "source": "client",
                    "createdDate": "2026-08-06 12:00:00"
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:00:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461102,
                      "message": "Identifiers are not valid.",
                      "details": "Invalid identifiers: 'tel avox'. Each identifier must be a single token, 3-25 characters, letters a-z only, with no spaces or diacritics.",
                      "element": "identifiers"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:00:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111401,
                      "message": "Company ID not found.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:01:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:01:30"
                }
              }
            }
          }
        }
      }
    },
    "/companies/{companyID}/patterns/{patternID}": {
      "get": {
        "tags": [
          "Patterns"
        ],
        "summary": "Retrieve a pattern",
        "description": "Last updated: 2026-08-06\n\n<p>Retrieve a single pattern by patternID.</p>\n\n<p>The request URL must include the <i>companyID</i> of the company the pattern was added to and the <i>patternID</i> of the pattern you want to retrieve.</p>\n\n<p>If successful, the request will return a 200 HTTP response with the pattern object included in the response body.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 also means the <i>patternID</i> doesn't resolve to an existing pattern for this company — this includes a pattern that's been <a href=\"/docs/patterns/delete-a-pattern\">deleted</a>, which is indistinguishable from one that never existed.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "retrieve-a-pattern",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "patternID",
            "in": "path",
            "description": "The pattern's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatternItemResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "patternID": "1",
                    "type": "SupplierInvoice",
                    "verificationSeries": "A",
                    "identifiers": [
                      "telavox",
                      "telecom",
                      "invoice"
                    ],
                    "source": "client",
                    "createdDate": "2026-08-06 12:10:00"
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:10:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461402,
                      "message": "Pattern ID is not valid.",
                      "details": "",
                      "element": "patternID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:10:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461401,
                      "message": "Pattern ID not found.",
                      "details": "",
                      "element": "patternID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:11:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:11:30"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Patterns"
        ],
        "summary": "Update a pattern",
        "description": "Last updated: 2026-08-06\n\n<p><b>NOTE:</b> When updating a resource, new information overwrites the existing information — this is a full replace, not a partial update. Any field you leave empty is cleared, not left unchanged: in particular, omitting <code>verificationSeries</code> clears a previously-set value, and <code>identifiers</code> is still required on every request — there is no way to update a pattern without resending its complete identifier set. See the request schema below for the formatting rules that still apply to any field you do set.</p>\n\n<p>The <code>patternID</code> in the request body must match the <code>patternID</code> in the URL — a mismatch returns a <code>400 Bad Request</code>.</p>\n\n<p><b>Important — source is effectively unchangeable, and omitting it is not the same as leaving it alone.</b> <code>source</code> cannot be changed once a pattern is created. But there's a real trap: if you omit <code>source</code> from your request, it isn't preserved from the existing pattern — it's silently defaulted to <code>client</code>, exactly as on <a href=\"/docs/patterns/add-a-pattern#request-schema\">Add a pattern</a>. If the pattern's actual stored source is anything other than <code>client</code> (e.g. <code>provider</code>, or <code>system</code> for a pattern AzoraOne learned automatically), that silent default won't match it, and the request fails with a 400. <b>Always explicitly resend the pattern's current <code>source</code> value on every update</b> — you can get it from a prior <a href=\"/docs/patterns/retrieve-a-pattern\">Retrieve a pattern</a> call. A pattern whose source is <code>system</code> cannot be successfully updated through this operation at all: sending <code>system</code> explicitly is rejected as an invalid value, and omitting it (or sending <code>client</code>/<code>provider</code>) is rejected as a readonly violation.</p>\n\n<p>This operation cannot restore a pattern that's been <a href=\"/docs/patterns/delete-a-pattern\">deleted</a> — like <a href=\"/docs/progenitors/update-a-progenitor\">Update a progenitor</a>, it can only update an already-active pattern; a deleted (or never-existing) <code>patternID</code> returns 404. To bring a deleted pattern back, use <a href=\"/docs/patterns/add-a-pattern\">Add a pattern</a> again instead.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i> or a missing request body, a 400 can mean an invalid or mismatched <i>patternID</i>, an invalid <i>type</i> or <i>verificationSeries</i>, missing/invalid/unrecognized <i>identifiers</i>, an attempt to change <i>source</i> (see above), or a pattern with the exact same set of identifiers already existing under a different <i>patternID</i>. More than one of these can be reported together in the same response's error array.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 also means the <i>patternID</i> doesn't resolve to an existing, active pattern for this company — including one that's been deleted.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "update-a-pattern",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "patternID",
            "in": "path",
            "description": "The pattern's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatternItemRequest"
              },
              "example": {
                "patternID": "1",
                "type": "SupplierInvoice",
                "verificationSeries": "A",
                "identifiers": [
                  "telavox",
                  "telecom",
                  "invoice"
                ],
                "source": "client"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatternItemResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "patternID": "1",
                    "type": "SupplierInvoice",
                    "verificationSeries": "A",
                    "identifiers": [
                      "telavox",
                      "telecom",
                      "invoice"
                    ],
                    "source": "client",
                    "createdDate": "2026-08-06 12:30:00"
                  },
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:30:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461213,
                      "message": "Pattern already exists.",
                      "details": "",
                      "element": "identifiers"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:30:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461401,
                      "message": "Pattern ID not found.",
                      "details": "",
                      "element": "patternID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:31:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:31:30"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Patterns"
        ],
        "summary": "Delete a pattern",
        "description": "Last updated: 2026-08-06\n\n<p>Delete a single <a href=\"/docs/patterns/add-a-pattern\">pattern</a> by patternID.</p>\n\n<p>The request URL must include the <i>companyID</i> of the company the pattern was added to and the <i>patternID</i> of the pattern you want to delete.</p>\n\n<p>If successful, the request will return a 200 HTTP response with an empty data object in the body. The pattern is soft-deleted, not erased — a history snapshot of it is preserved internally before it's marked deleted, but there is no API to browse that history, and this operation cannot restore the pattern. To use the same identifiers again, <a href=\"/docs/patterns/add-a-pattern\">add a new pattern</a>.</p>\n\n<p>This operation is <b>not idempotent</b>: deleting an already-deleted (or never-existing) <i>patternID</i> returns a 404, not a silent success.</p>\n\n<p>Deleting a pattern has no retroactive effect on files that have already been classified using it — their suggested <i>type</i> and <i>verificationSeries</i> (see <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a>) are fixed at classification time and are not recalculated afterward. The deleted pattern simply stops being considered for classifying any file uploaded after the deletion.</p>\n\n<p>Unlike <a href=\"/docs/patterns/update-a-pattern\">Update a pattern</a>, this operation has no restriction based on <i>source</i> — a pattern AzoraOne learned automatically (<code>source: \"system\"</code>) can be deleted through this endpoint just like a <code>client</code>- or <code>provider</code>-sourced one.</p>\n\n<p><b>Note on the 400 response:</b> as well as an invalid <i>companyID</i>, a 400 can mean an invalid <i>patternID</i>.</p>\n\n<p><b>Note on the 404 response:</b> as well as a <i>companyID</i> that doesn't resolve to a company, a 404 also means the <i>patternID</i> doesn't resolve to an existing, active pattern for this company — this covers a <i>patternID</i> that belongs to a different company, one that's already been deleted, and one that never existed, all indistinguishably.</p>\n\n<p><b>Note on the 500 response:</b> this can also indicate a temporary database connectivity issue on our end, not necessarily a problem with your request.</p>",
        "operationId": "delete-a-pattern",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "description": "The company's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "patternID",
            "in": "path",
            "description": "The pattern's unique ID.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "Client-Key",
            "in": "header",
            "description": "The application's unique key.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "<ClientKey>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatternDeleteResponse"
                },
                "example": {
                  "success": true,
                  "data": {},
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:30:00"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 111402,
                      "message": "Company ID is not valid.",
                      "details": "",
                      "element": "companyID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:30:30"
                }
              }
            }
          },
          "404": {
            "description": "NotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 461401,
                      "message": "Pattern ID not found.",
                      "details": "",
                      "element": "patternID"
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:31:00"
                }
              }
            }
          },
          "500": {
            "description": "InternalServerError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                },
                "example": {
                  "success": false,
                  "data": [
                    {
                      "code": 1009220,
                      "message": "Database operation failed.",
                      "details": "",
                      "element": ""
                    }
                  ],
                  "extended": "",
                  "meta": "",
                  "origin": "",
                  "time": "2026-08-06 12:31:30"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CompanyItem": {
        "required": [
          "companyID"
        ],
        "type": "object",
        "properties": {
          "companyID": {
            "type": "string",
            "description": "Must be unique within the service. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "companyName": {
            "type": "string",
            "description": "Should be used to easily identify a specific company within the service, in reports and when talking to technical support."
          },
          "companyProxy": {
            "type": "string",
            "description": "Should be used to easily identify a specific company proxy within the service, in reports and when talking to technical support. Populate it if the company belongs to a specific accounting firm, parent company, or billing unit."
          },
          "active": {
            "type": "boolean",
            "description": "Set to true to activate the company, or false to deactivate it. The exact effect depends on your agreement."
          },
          "precognition": {
            "$ref": "#/components/schemas/PrecognitionItem",
            "description": "Precognition settings for the company."
          },
          "corporateIdentityNumber": {
            "type": "string",
            "description": "If <code>countryOfOrigin</code> is not provided, this value must be formatted according to Swedish format (nnnnnn-nnnn or nnnnnnnnn), where n is a digit between 0 and 9 and the last digit is a so-called control digit (checksum). Visit <a href=\"https://www4.skatteverket.se/rattsligvagledning/edition/2021.8/326447.html\" target=\"_blank\" rel=\"noopener\">Skatteverket</a> for more information. If a two-letter country code (<a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>) is provided for <code>countryOfOrigin</code>, the corresponding country's corporate identity number format will apply. The corporateIdentityNumber format complies with the EU Commission's specifications. Visit <a href=\"https://wikis.ec.europa.eu/spaces/UDBBIS/pages/90278474/Company+identifier+Machine+readable\" target=\"_blank\" rel=\"noopener\">Company identifier Machine readable</a> for more detail. You can also access the same information in the Excel Sheet <a href=\"https://wikis.ec.europa.eu/pages/viewpageattachments.action?pageId=90278474&metadataLink=true&preview=/90278474/90278478/NTR_ID_07Feb23.xlsx\" target=\"_blank\" rel=\"noopener\">here</a>. This value is also used to filter out a customer's own company data when locating a supplier from the supplier list during an extraction on a supplier invoice."
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "<code>bankAccountNumber</code> can only be used if <code>countryOfOrigin</code> is either empty or set to the Swedish country code. Must be formatted as (n)nnn-nnnn where n is a number between 0 and 9. Visit <a href=\"https://www.bankgirot.se/\" target=\"_blank\" rel=\"noopener\">Bankgirot</a> for more information."
          },
          "plusGiroNumber": {
            "type": "string",
            "description": "<code>plusGiroNumber</code> can only be used if <code>countryOfOrigin</code> is either empty or set to the Swedish country code. It must be formatted as (nnnnn)nn-n where n is a number between 0 and 9. Visit <a href=\"https://www.nordea.se/foretag/produkter/betala/transaktionskonto.html\" target=\"_blank\" rel=\"noopener\">Nordea</a> for more information."
          },
          "iban": {
            "type": "string",
            "description": "Must be formatted according to <a href=\"https://www.iso.org/obp/ui/#iso:std:iso:13616:-1:ed-2:v1:en\" target=\"_blank\" rel=\"noopener\">ISO-13616</a>."
          },
          "vatNumber": {
            "type": "string",
            "description": "The <code>vatNumber</code> must be in the correct format, with the country code extracted directly from the number for validation. We support only European, US, and GB VAT numbers. Refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats and the structure. You can find more information about VAT identification numbers <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a>."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "Must be formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "Ignored by the server on Add a company and Update a company — any value you send here has no effect and is not persisted. To find a company's real creation date, use Retrieve a company or Retrieve all companies."
          }
        },
        "description": "A company item",
        "example": {
          "companyID": "1",
          "companyName": "SmallCorp",
          "companyProxy": "Account Group Inc",
          "active": true,
          "precognition": {
            "active": false
          },
          "corporateIdentityNumber": "556754-9273",
          "bankAccountNumber": "310-6093",
          "plusGiroNumber": "477451-9",
          "iban": "",
          "vatNumber": "SE556754927301",
          "countryOfOrigin": "SE"
        }
      },
      "PrecognitionItem": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Serves to activate or deactivate precognition on the company when extracting data from documents. Whether this has any effect depends on your agreement."
          }
        },
        "description": "A precognition item"
      },
      "AccountItem": {
        "required": [
          "account"
        ],
        "type": "object",
        "properties": {
          "account": {
            "type": "string",
            "description": "The account number"
          },
          "periodicity": {
            "$ref": "#/components/schemas/PeriodicityItem",
            "description": "Periodic accrual/deferral settings for this account row, spreading the amount across multiple accounting periods between two dates. Optional."
          },
          "project": {
            "$ref": "#/components/schemas/ProjectItem",
            "description": "The project this account row belongs to. Optional."
          },
          "costBearer": {
            "$ref": "#/components/schemas/CostBearerItem",
            "description": "The cost bearer this account row belongs to. Optional."
          },
          "resultsCentre": {
            "$ref": "#/components/schemas/ResultsCentreItem",
            "description": "The results centre this account row belongs to. Optional."
          },
          "debit": {
            "type": "string",
            "description": "The debit amount"
          },
          "credit": {
            "type": "string",
            "description": "The credit amount"
          }
        },
        "description": "An account item"
      },
      "PeriodicityItem": {
        "type": "object",
        "properties": {
          "offsetAccount": {
            "type": "string",
            "description": "The account number of the offset account"
          },
          "startDate": {
            "type": "string",
            "description": "The start date of the periodicity period"
          },
          "endDate": {
            "type": "string",
            "description": "The end date of the periodicity period"
          }
        },
        "description": "A periodicity item"
      },
      "ProjectItem": {
        "type": "object",
        "properties": {
          "targetValue": {
            "type": "string",
            "description": "The target value that represents which project the account row belongs to"
          }
        },
        "description": "A project item"
      },
      "CostBearerItem": {
        "type": "object",
        "properties": {
          "targetValue": {
            "type": "string",
            "description": "The target value that represents which costbearer the account row belongs to"
          }
        },
        "description": "A costbearer item"
      },
      "ResultsCentreItem": {
        "type": "object",
        "properties": {
          "targetValue": {
            "type": "string",
            "description": "The target value that represents which resultscentre the account row belongs to"
          }
        },
        "description": "A resultscentre item"
      },
      "ReceiptItem": {
        "required": [
          "receiptDate",
          "accounts"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "A free text description. Optional, up to 100 characters."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this document belongs to. Optional — doesn't have to already exist. Supplying it teaches AzoraOne to sort future uploads with a similar layout into this series. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a> (case-insensitive); up to 100 characters."
          },
          "receiptDate": {
            "type": "string",
            "description": "The date printed on the receipt. Required, formatted YYYY-MM-DD per <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"noopener\">ISO 8601</a>."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The receipt's bookkeeping account rows. Required — at least two non-empty rows (where at least one of <code>debit</code>/<code>credit</code> is set) must be present, and the sum of every row's <code>debit</code> must equal the sum of every row's <code>credit</code> (tolerance &lt;0.001), or the request returns 400 \"Debit and credit do not balance.\" Unlike supplier and customer invoices, there is no <code>totalSum</code>/<code>vat</code> to balance against — the account rows must balance against each other directly. Each row needs exactly one of <code>debit</code>/<code>credit</code> set to a valid non-zero number, or both left blank; a row with both filled (or both invalid) fails validation."
          }
        },
        "description": "A receipt to bookkeep.",
        "example": {
          "description": "Employee breakfast",
          "verificationSeries": "A",
          "receiptDate": "2020-05-04",
          "accounts": [
            {
              "account": "1930",
              "periodicity": {
                "offsetAccount": "",
                "startDate": "",
                "endDate": ""
              },
              "project": {
                "targetValue": ""
              },
              "costBearer": {
                "targetValue": ""
              },
              "resultsCentre": {
                "targetValue": ""
              },
              "debit": "0,00",
              "credit": "3119,00"
            },
            {
              "account": "2641",
              "periodicity": {
                "offsetAccount": "",
                "startDate": "",
                "endDate": ""
              },
              "project": {
                "targetValue": ""
              },
              "costBearer": {
                "targetValue": ""
              },
              "resultsCentre": {
                "targetValue": ""
              },
              "debit": "623,82",
              "credit": "0,00"
            },
            {
              "account": "1790",
              "periodicity": {
                "offsetAccount": "6210",
                "startDate": "2020-05-01",
                "endDate": "2021-04-30"
              },
              "project": {
                "targetValue": "P657588"
              },
              "costBearer": {
                "targetValue": "10"
              },
              "resultsCentre": {
                "targetValue": "20"
              },
              "debit": "2495,29",
              "credit": "0,00"
            },
            {
              "account": "3740",
              "periodicity": {
                "offsetAccount": "",
                "startDate": "",
                "endDate": ""
              },
              "project": {
                "targetValue": ""
              },
              "costBearer": {
                "targetValue": ""
              },
              "resultsCentre": {
                "targetValue": ""
              },
              "debit": "0,00",
              "credit": "0,11"
            }
          ]
        }
      },
      "ReceiptOutput": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "A free text description. As found on the receipt when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this receipt belongs to. Matched from the file's extracted pattern when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "receiptDate": {
            "type": "string",
            "description": "The receipt's date, formatted YYYY-MM-DD. As found on the document when extracted (empty if not found); required and echoed back when bookkept."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The receipt's bookkeeping account rows. On extraction, as extracted from the document — can be empty even on a successful extraction, e.g. when no usable line items were found. On Bookkeep, echoes every row you submitted unchanged, including rows where both <code>debit</code> and <code>credit</code> were left empty; at least two non-empty rows are required for the request to succeed."
          }
        },
        "description": "A receipt, as returned by <a href=\"/docs/receipts/extract-data-from-a-receipt#response-schema\">Extract data from a receipt</a> (values found on the document) or <a href=\"/docs/receipts/bookkeep-a-receipt#response-schema\">Bookkeep a receipt</a> (values echoed from what you submitted, after validation). Unlike supplier and customer invoices, a receipt has no <code>totalSum</code>/<code>vat</code> fields and no linked-party ID."
      },
      "ReceiptExtendedData": {
        "type": "object",
        "properties": {
          "dates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dates found on the receipt. Format: YYYY-MM-DD."
          },
          "times": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Times found on the receipt. Format: hh:mm:ss."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Email addresses found on the receipt. Format: RFC 5322."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies found on the receipt, extracted from codes (e.g. USD, SEK), symbols (€), or aliases (e.g. kr, resolved using countryOfOrigin as SEK or DKK). Format: ISO 4217."
          },
          "creditCardNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The 4 (or 5) last digits of the credit cards found on the receipt. Format: xxxx(-x)."
          },
          "corporateIdentityNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Corporate identity numbers found on the receipt. Format: xxxxxx-xxxx."
          },
          "ibans": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank account numbers (IBAN) found on the receipt. Format: ISO 13616."
          },
          "bic": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank BIC (SWIFT) codes found on the receipt. Format: ISO 9362."
          },
          "vatNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all VAT numbers found on the receipt for that country. Format: EU VAT Numbers."
          },
          "corporateIdentityNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all corporate identity numbers found on the receipt for that country. Format: EU machine-readable company identifiers."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "A two-letter country code derived from values such as VAT numbers, IBANs, or corporate identity numbers found on the receipt. Format: ISO-3166-1 alpha-2."
          }
        },
        "description": "Additional, non-feedback-corrected data extracted from a receipt. Only returned when the request sets the extended query parameter to true; unused (empty) on non-receipt operations. Like customer invoices (and unlike supplier invoices), does not include bankAccountNumbers or plusGiroNumbers."
      },
      "ReceiptResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ReceiptOutput",
            "description": "The extracted receipt."
          },
          "extended": {
            "$ref": "#/components/schemas/ReceiptExtendedData",
            "description": "Additional, non-feedback-corrected data extracted from the receipt. Only present when the request sets the <code>extended</code> query parameter to <code>true</code>; empty otherwise."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "$ref": "#/components/schemas/Origin",
            "description": "Information on what model generated the extraction result. Only present when the request sets the <code>origin</code> query parameter to <code>true</code>; empty otherwise."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the extracted receipt."
      },
      "ReceiptBookkeepResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ReceiptOutput",
            "description": "The bookkept receipt, echoing what you submitted after validation."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on receipt extraction operations; see <a href=\"/docs/receipts/extract-data-from-a-receipt#response-schema\">ReceiptExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/receipts/extract-data-from-a-receipt#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the bookkept receipt."
      },
      "FileItem": {
        "type": "object",
        "properties": {
          "fileID": {
            "type": "string",
            "description": "The file's unique ID"
          },
          "fileName": {
            "type": "string",
            "description": "The file's name"
          },
          "status": {
            "type": "string",
"enum": [
              "WAITING",
              "ERROR",
              "READY",
              "EXTRACTED",
              "BOOKED",
              "COMPLETE"
            ],            "description": "The file's status"
          },
          "type": {
            "type": "string",
            "description": "The file's type"
          },
          "verificationSeries": {
            "type": "string",
            "description": "The file's verification series"
          }
        },
        "description": "A file item",
        "example": {
          "type": "Receipt",
          "verificationSeries": "A"
        }
      },
      "FileUploadOutput": {
        "type": "object",
        "properties": {
          "fileID": {
            "type": "string",
            "description": "The file's unique ID, echoing the <code>fileID</code> supplied in the upload request. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "fileName": {
            "type": "string",
            "description": "The name of the uploaded file."
          },
          "status": {
            "type": "string",
"enum": [
              "WAITING",
              "ERROR",
              "READY",
              "EXTRACTED",
              "BOOKED",
              "COMPLETE"
            ],            "description": "The file's processing status. Immediately after upload this is always <code>WAITING</code> — the 202 response is only a confirmation that the file was received, not that preprocessing has finished. Retrieve the file shortly afterwards (or better, use <a href=\"/documentation/webhooks\" target=\"_blank\" rel=\"noopener\">webhooks</a>) to see the status move to <code>READY</code>, which means the file is ready for extraction. See the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation for the full set of status values (WAITING, ERROR, READY, EXTRACTED, BOOKED, COMPLETE) and what each one means."
          },
          "type": {
            "type": "string",
            "description": "The suggested document type: <code>Receipt</code>, <code>SupplierInvoice</code>, <code>CustomerInvoice</code> or <code>Other</code>. Always an empty string in this response — the file has not been preprocessed yet, so no suggestion exists. Once the status becomes <code>READY</code>, retrieve the file again to get the suggested type — see the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The suggested verification series. Always an empty string in this response — the file has not been preprocessed yet, so no suggestion exists. Once the status becomes <code>READY</code>, retrieve the file again to get the suggested verification series — see the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "Not used by this operation — always returned empty. Populated when the file is retrieved; see the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation."
          },
          "conformity": {
            "type": "object",
            "description": "Not used by this operation — always returned <code>null</code>. Populated when a request to <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> (or <a href=\"/docs/files/retrieve-all-files#response-schema\">Retrieve all files</a>) sets the <code>conformity</code> query parameter to <code>true</code>."
          },
          "summary": {
            "type": "object",
            "description": "Not used by this operation — always returned <code>null</code>. Populated when a request to <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> (or <a href=\"/docs/files/retrieve-all-files#response-schema\">Retrieve all files</a>) sets the <code>summary</code> query parameter to <code>true</code>."
          }
        },
        "description": "The file object returned immediately after a successful upload. Does not contain the file itself — only fileID, fileName and status are meaningful at this stage; every other field is present but empty (string fields) or <code>null</code> (object fields) until the file is retrieved or its status changes."
      },
      "ConformityItem": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "description": "A percentage showing how closely this file's most recent data extraction (before booking) matches its most recent booked data — also known as the hit rate. <code>null</code> when no comparison is available (e.g. the file hasn't been both extracted and booked). See the Quality &amp; Performance documentation for the full calculation logic, and the <code>conformityFilters</code> query parameter to restrict the calculation to specific fields."
          }
        },
        "description": "Quality/performance comparison between a file's most recent extraction and its most recent booking. Only populated when a request explicitly sets the conformity query parameter to true; null otherwise."
      },
      "SummaryItem": {
        "type": "object",
        "properties": {
          "latestExtraction": {
            "$ref": "#/components/schemas/ExtractionSummaryItem",
            "description": "The file's most recent data extraction. <code>null</code> if the file has never been extracted."
          },
          "latestBooking": {
            "$ref": "#/components/schemas/BookingSummaryItem",
            "description": "The file's most recent booking. <code>null</code> if the file has never been booked."
          }
        },
        "description": "A file's processing history. Only populated when a request explicitly sets the summary query parameter to true; null otherwise."
      },
      "ExtractionSummaryItem": {
        "type": "object",
        "properties": {
          "eventDate": {
            "type": "string",
            "description": "When the extraction happened, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "type": {
            "type": "string",
            "description": "The document type this extraction was for: <code>Receipt</code>, <code>SupplierInvoice</code> or <code>CustomerInvoice</code>."
          },
          "supplierID": {
            "type": "string",
            "description": "The unique ID of the supplier connected to the extraction. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>. <code>null</code> for extractions that aren't supplier-invoice related (e.g. receipts)."
          },
          "ancestor": {
            "type": "string",
            "description": "What kind of model generated this extraction: <code>StartBot</code> (precognition model), <code>Progenitor</code> (inherited model from another company), <code>Brick</code> (binary model), or <code>None</code> (a model originally created by the company that performed the extraction)."
          }
        },
        "description": "Details of a file's most recent data extraction."
      },
      "BookingSummaryItem": {
        "type": "object",
        "properties": {
          "eventDate": {
            "type": "string",
            "description": "When the booking happened, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "type": {
            "type": "string",
            "description": "The document type this booking was for: <code>Receipt</code>, <code>SupplierInvoice</code> or <code>CustomerInvoice</code>."
          },
          "supplierID": {
            "type": "string",
            "description": "The unique ID of the supplier connected to the booking. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>. <code>null</code> for bookings that aren't supplier-invoice related (e.g. receipts)."
          }
        },
        "description": "Details of a file's most recent booking."
      },
      "FileUploadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/FileUploadOutput",
            "description": "The file that was received. Only a confirmation of receipt — see <a href=\"#response-schema\">FileUploadOutput</a> for which fields are actually populated at this stage."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data confirms a file was received for upload (202 Accepted)."
      },
      "FileOutput": {
        "type": "object",
        "properties": {
          "fileID": {
            "type": "string",
            "description": "The file's unique ID. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "fileName": {
            "type": "string",
            "description": "The name of the file."
          },
          "status": {
            "type": "string",
"enum": [
              "WAITING",
              "ERROR",
              "READY",
              "EXTRACTED",
              "BOOKED",
              "COMPLETE"
            ],            "description": "The file's processing status — use this to identify whether the file is ready to be extracted from, though <a href=\"/documentation/webhooks\" target=\"_blank\" rel=\"noopener\">webhooks</a> are the recommended way to get notified. One of: <code>WAITING</code> (currently being processed), <code>ERROR</code> (could not be processed, most likely corrupt — will not become ready for extraction), <code>READY</code> (ready for extraction), <code>EXTRACTED</code> (extracted once, but can be extracted and booked again), <code>BOOKED</code> (booked previously, but can be extracted and booked again), or <code>COMPLETE</code> (both extracted and booked)."
          },
          "type": {
            "type": "string",
            "description": "The suggested document type: <code>Receipt</code>, <code>SupplierInvoice</code>, <code>CustomerInvoice</code> or <code>Other</code>. Used together with <code>verificationSeries</code> to present the file in the appropriate view of your application, so the professional accountant sees it in the verification series of their choice without your users needing separate upload addresses per document type."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The suggested verification series. Contains a value if the user has previously specified or moved a similar file to a specific verification series in your application; otherwise empty. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "When the file was uploaded, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "conformity": {
            "$ref": "#/components/schemas/ConformityItem",
            "description": "Included when the request sets the <code>conformity</code> query parameter to <code>true</code>; <code>null</code> otherwise. Shows how closely this file's most recent data extraction (before booking) matches its most recent booked data. See ConformityItem, the <code>conformityFilters</code> parameter, and the Quality &amp; Performance documentation for the full calculation logic."
          },
          "summary": {
            "$ref": "#/components/schemas/SummaryItem",
            "description": "Included when the request sets the <code>summary</code> query parameter to <code>true</code>; <code>null</code> otherwise. The file's most recent extraction and booking events. See SummaryItem."
          }
        },
        "description": "The file object as returned by <a href=\"/docs/files/retrieve-a-file\">Retrieve a file</a> / <a href=\"/docs/files/retrieve-all-files\">Retrieve all files</a>. Does not contain the file itself — see the <a href=\"/docs/files/retrieve-file-details#response-schema\">Retrieve file details</a> operation for that."
      },
      "FileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/FileOutput",
            "description": "The retrieved file."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the retrieved file."
      },
      "FileMoveInput": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Set the new type of the document. Does not have to already match the file's current type. One of <code>Receipt</code>, <code>SupplierInvoice</code>, <code>CustomerInvoice</code> or <code>Other</code>. At least one of <code>type</code> or <code>verificationSeries</code> must be provided."
          },
          "verificationSeries": {
            "type": "string",
            "description": "Set the new verification series of the document. Does not have to already exist on the file. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a> (case-insensitive), up to 100 characters — send an empty string to clear it. At least one of <code>type</code> or <code>verificationSeries</code> must be provided."
          }
        },
        "description": "The new type and/or verification series to apply to a file. Only the fields you supply are changed; omitted fields are left as-is."
      },
      "FileUpdateOutput": {
        "type": "object",
        "properties": {
          "fileID": {
            "type": "string",
            "description": "The file's unique ID. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "fileName": {
            "type": "string",
            "description": "The name of the file."
          },
          "status": {
            "type": "string",
"enum": [
              "WAITING",
              "ERROR",
              "READY",
              "EXTRACTED",
              "BOOKED",
              "COMPLETE"
            ],            "description": "The file's processing status, unaffected by this operation. One of <code>WAITING</code>, <code>ERROR</code>, <code>READY</code>, <code>EXTRACTED</code>, <code>BOOKED</code> or <code>COMPLETE</code> — see the <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> operation for what each means. This operation can only be used once status has reached <code>READY</code> or later; see the <a href=\"#response-schema\">412 response below</a>."
          },
          "type": {
            "type": "string",
            "description": "The file's type after this update — the value just patched, or its unchanged existing value if <code>type</code> wasn't included in the request. One of <code>Receipt</code>, <code>SupplierInvoice</code>, <code>CustomerInvoice</code> or <code>Other</code>."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The file's verification series after this update — the value just patched, or its unchanged existing value if <code>verificationSeries</code> wasn't included in the request. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "When the file was originally uploaded, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Unaffected by this update."
          },
          "conformity": {
            "type": "object",
            "description": "Not used by this operation — always returned <code>null</code>. Populated when a request to <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> (or <a href=\"/docs/files/retrieve-all-files#response-schema\">Retrieve all files</a>) sets the <code>conformity</code> query parameter to <code>true</code>."
          },
          "summary": {
            "type": "object",
            "description": "Not used by this operation — always returned <code>null</code>. Populated when a request to <a href=\"/docs/files/retrieve-a-file#response-schema\">Retrieve a file</a> (or <a href=\"/docs/files/retrieve-all-files#response-schema\">Retrieve all files</a>) sets the <code>summary</code> query parameter to <code>true</code>."
          }
        },
        "description": "The file object after applying the patch. Does not contain the file itself."
      },
      "FileUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/FileUpdateOutput",
            "description": "The file after the patch was applied."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the file after a successful patch."
      },
      "FileAggregates": {
        "type": "object",
        "properties": {
          "averageConformity": {
            "type": "number",
            "description": "The average conformity (0–100) across every file on this page of results — the mean of each returned file's <code>conformity.value</code>. <code>null</code> if none of the files on this page have a conformity value (e.g. the request didn't set <code>conformity=true</code>, so every file's conformity is null and there's nothing to average)."
          }
        },
        "description": "Page-level conformity statistics for a file list."
      },
      "FileListMeta": {
        "type": "object",
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/Pagination",
            "description": "Pagination details for this page of results. See Pagination."
          },
          "aggregates": {
            "$ref": "#/components/schemas/FileAggregates",
            "description": "Page-level conformity statistics. See FileAggregates."
          },
          "updated": {
            "type": "string",
            "description": "When the file data backing this list was last synced from the primary database into the read store this operation queries, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Reflects the freshness of the whole dataset, not any single file's own update time."
          }
        },
        "description": "Response metadata for Retrieve all files — pagination plus page-level conformity aggregates."
      },
      "FileListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileOutput"
            },
            "description": "The files matching the request's filters, for the requested page."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "$ref": "#/components/schemas/FileListMeta",
            "description": "Pagination and page-level conformity aggregates. See FileListMeta."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a page of matching files."
      },
      "FileText": {
        "type": "object",
        "properties": {
          "rawText": {
            "type": "string",
            "description": "The raw text extracted from the file via OCR. Empty when text couldn't be extracted (e.g. a corrupt PDF, a logo/image with no text, or a PEPPOL XML). Also empty for files uploaded before 2025-10-08 00:00:00 — <code>rawText</code> is only available for files uploaded after that date."
          }
        },
        "description": "Raw OCR text for a file."
      },
      "StatsSummary": {
        "type": "object",
        "properties": {
          "extraction": {
            "$ref": "#/components/schemas/LatestComparisonItem",
            "description": "The extraction event used for this file's conformity calculation. <code>null</code> if no matching extraction/booking pair was found."
          },
          "booking": {
            "$ref": "#/components/schemas/LatestComparisonItem",
            "description": "The booking event used for this file's conformity calculation. <code>null</code> if no matching extraction/booking pair was found."
          }
        },
        "description": "The extraction and booking event compared to calculate a file's conformity score."
      },
      "LatestComparisonItem": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "Whether this event is an <code>Extraction</code> or a <code>Booking</code>."
          },
          "effectiveType": {
            "type": "string",
            "description": "The document type this event was for: <code>Receipt</code> or <code>SupplierInvoice</code>."
          },
          "eventDate": {
            "type": "string",
            "description": "When the event happened, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "supplierID": {
            "type": "string",
            "description": "The unique ID of the supplier connected to this event. Only present for supplier invoice events."
          },
          "ancestor": {
            "type": "string",
            "description": "What kind of model generated this event's extraction: <code>StartBot</code> (precognition model), <code>Progenitor</code> (inherited model from another company), <code>Brick</code> (binary model), or <code>None</code> (a model originally created by the company that performed the extraction). Only present on extraction events."
          },
          "description": {
            "type": "string",
            "description": "A free text description."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this event's document belongs to."
          },
          "receiptDate": {
            "type": "string",
            "description": "The receipt's date. Only present for receipt events."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The invoice's date. Only present for supplier invoice events."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due. Only present for supplier invoice events."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The unique invoice number. Only present for supplier invoice events."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The unique OCR number. Only present for supplier invoice events."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The unique reference number. Only present for supplier invoice events."
          },
          "orderNumber": {
            "type": "string",
            "description": "The order number. Only present for supplier invoice events."
          },
          "ourRef": {
            "type": "string",
            "description": "Contact person at the sender. Only present for supplier invoice events."
          },
          "yourRef": {
            "type": "string",
            "description": "Contact person at the recipient. Only present for supplier invoice events."
          },
          "totalSum": {
            "type": "string",
            "description": "The total amount. Only present for supplier invoice events."
          },
          "vat": {
            "type": "string",
            "description": "The VAT amount. Only present for supplier invoice events."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The bookkeeping account rows for this event. Only present for supplier invoice events."
          }
        },
        "description": "A single extraction or booking event as used for a conformity comparison. Fields are only present when relevant to the event's document type — receipt events carry receiptDate, supplier invoice events carry invoiceDate/dueDate/invoiceNumber and the other invoice fields; fields that don't apply to the event are omitted entirely, not just empty. Note this uses the key <code>effectiveType</code> for the document type — see <a href=\"#response-schema\">FileDetailEventItem</a> for the equivalent field in eventHistory, which uses the key <code>type</code> instead."
      },
      "FileDetailEventItem": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "Whether this event is an <code>Extraction</code> or a <code>Booking</code>."
          },
          "type": {
            "type": "string",
            "description": "The document type this event was for: <code>Receipt</code> or <code>SupplierInvoice</code>."
          },
          "eventDate": {
            "type": "string",
            "description": "When the event happened, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "supplierID": {
            "type": "string",
            "description": "The unique ID of the supplier connected to this event. Only present for supplier invoice events."
          },
          "ancestor": {
            "type": "string",
            "description": "What kind of model generated this event's extraction: <code>StartBot</code> (precognition model), <code>Progenitor</code> (inherited model from another company), <code>Brick</code> (binary model), or <code>None</code> (a model originally created by the company that performed the extraction). Only present on extraction events."
          },
          "description": {
            "type": "string",
            "description": "A free text description."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this event's document belongs to."
          },
          "receiptDate": {
            "type": "string",
            "description": "The receipt's date. Only present for receipt events."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The invoice's date. Only present for supplier invoice events."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due. Only present for supplier invoice events."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The unique invoice number. Only present for supplier invoice events."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The unique OCR number. Only present for supplier invoice events."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The unique reference number. Only present for supplier invoice events."
          },
          "orderNumber": {
            "type": "string",
            "description": "The order number. Only present for supplier invoice events."
          },
          "ourRef": {
            "type": "string",
            "description": "Contact person at the sender. Only present for supplier invoice events."
          },
          "yourRef": {
            "type": "string",
            "description": "Contact person at the recipient. Only present for supplier invoice events."
          },
          "totalSum": {
            "type": "string",
            "description": "The total amount. Only present for supplier invoice events."
          },
          "vat": {
            "type": "string",
            "description": "The VAT amount. Only present for supplier invoice events."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The bookkeeping account rows for this event. Only present for supplier invoice events."
          }
        },
        "description": "A single extraction or booking event in a file's full history. Fields are only present when relevant to the event's document type — receipt events carry receiptDate, supplier invoice events carry invoiceDate/dueDate/invoiceNumber and the other invoice fields; fields that don't apply to the event are omitted entirely, not just empty. Note this uses the key <code>type</code> for the document type — see <a href=\"#response-schema\">LatestComparisonItem</a> for the equivalent field in latestComparison, which uses the key <code>effectiveType</code> instead."
      },
      "FileDetailOutput": {
        "type": "object",
        "properties": {
          "fileID": {
            "type": "string",
            "description": "The file's unique ID. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "fileName": {
            "type": "string",
            "description": "The name of the file."
          },
          "status": {
            "type": "string",
"enum": [
              "WAITING",
              "ERROR",
              "READY",
              "EXTRACTED",
              "BOOKED",
              "COMPLETE"
            ],            "description": "The file's processing status. One of <code>WAITING</code> (currently being processed), <code>ERROR</code> (could not be processed, most likely corrupt — will not become ready for extraction), <code>READY</code> (ready for extraction), <code>EXTRACTED</code> (extracted once, but can be extracted and booked again), <code>BOOKED</code> (booked previously, but can be extracted and booked again), or <code>COMPLETE</code> (both extracted and booked)."
          },
          "type": {
            "type": "string",
            "description": "The suggested document type: <code>Receipt</code>, <code>SupplierInvoice</code>, <code>CustomerInvoice</code> or <code>Other</code>."
          },
          "effectiveType": {
            "type": "string",
            "description": "The document type determined from this file's actual extraction/booking history, once its <code>status</code> has resolved to <code>COMPLETE</code>. <code>null</code> while <code>status</code> is anything other than <code>COMPLETE</code>."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The suggested verification series. Contains a value if the user has previously specified or moved a similar file to a specific verification series in your application; otherwise empty. Formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "conformity": {
            "$ref": "#/components/schemas/ConformityItem",
            "description": "Included when the request sets the <code>conformity</code> query parameter to <code>true</code>; <code>null</code> otherwise. Shows how closely this file's most recent data extraction (before booking) matches its most recent booked data. See ConformityItem, the <code>conformityFilters</code> parameter, and the Quality &amp; Performance documentation for the full calculation logic."
          },
          "createdDate": {
            "type": "string",
            "description": "When the file was uploaded, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "latestComparison": {
            "$ref": "#/components/schemas/StatsSummary",
            "description": "The extraction/booking pair used for this file's conformity calculation. Only present in the response when the <code>eventSet</code> query parameter is <code>latestComparison</code> (the default) — omitted entirely, not just <code>null</code>, when <code>eventSet=eventHistory</code>."
          },
          "eventHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileDetailEventItem"
            },
            "description": "Every extraction and booking event for this file, in chronological order. Always present in the response — an empty array when <code>eventSet</code> is <code>latestComparison</code> (the default), populated when <code>eventSet=eventHistory</code>."
          },
          "fileContent": {
            "type": "string",
            "description": "The file's raw content as a data URI (<code>data:&lt;mimeType&gt;;base64,&lt;content&gt;</code>) when the <code>fileContent</code> query parameter is <code>true</code>; <code>null</code> otherwise."
          },
          "fileText": {
            "$ref": "#/components/schemas/FileText",
            "description": "Included when the <code>fileText</code> query parameter is <code>true</code>; <code>null</code> otherwise. See FileText."
          }
        },
        "description": "A comprehensive view of a single file — its metadata, optional raw content and OCR text, conformity score, and event history. Does not contain the file itself unless <code>fileContent=true</code> is set."
      },
      "FileDetailResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/FileDetailOutput",
            "description": "The file's details."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a single file's full details."
      },
      "SupplierItem": {
        "required": [
          "supplierID"
        ],
        "type": "object",
        "properties": {
          "supplierID": {
            "type": "string",
            "description": "Must be unique within the company. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "supplierName": {
            "type": "string",
            "description": "Optional. It should be used to easily identify a specific supplier within the service, in reports and when talking to technical support."
          },
          "corporateIdentityNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. If <code>countryOfOrigin</code> is not provided, this value must be formatted according to Swedish format (nnnnnn-nnnn or nnnnnnnnn), where n is a digit between 0 and 9 and the last digit is a so-called control digit (checksum). Visit <a href=\"https://www4.skatteverket.se/rattsligvagledning/edition/2021.8/326447.html\" target=\"_blank\" rel=\"noopener\">Skatteverket</a> for more information. If a two-letter country code (<a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>) is provided for <code>countryOfOrigin</code>, the corresponding country's corporate identity number format will apply. The corporateIdentityNumber format complies with the EU Commission's specifications. Visit <a href=\"https://wikis.ec.europa.eu/spaces/UDBBIS/pages/90278474/Company+identifier+Machine+readable\" target=\"_blank\" rel=\"noopener\">Company identifier Machine readable</a> for more detail. You can also access the same information in the Excel Sheet <a href=\"https://wikis.ec.europa.eu/pages/viewpageattachments.action?pageId=90278474&metadataLink=true&preview=/90278474/90278478/NTR_ID_07Feb23.xlsx\" target=\"_blank\" rel=\"noopener\">here</a>."
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. Must be formatted as (n)nnn-nnnn where n is a number between 0 and 9. Visit <a href=\"https://www.bankgirot.se/\" target=\"_blank\" rel=\"noopener\">Bankgirot</a> for more information."
          },
          "plusGiroNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. Must be formatted as (nnnnn)nn-n where n is a number between 0 and 9. Visit <a href=\"https://www.nordea.se/foretag/produkter/betala/transaktionskonto.html\" target=\"_blank\" rel=\"noopener\">Nordea</a> for more information."
          },
          "iban": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. Must be formatted according to <a href=\"https://www.iso.org/obp/ui/#iso:std:iso:13616:-1:ed-2:v1:en\" target=\"_blank\" rel=\"noopener\">ISO-13616</a>."
          },
          "vatNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. The <code>vatNumber</code> must be in the correct format, with the country code extracted directly from the number for validation. We support only European, US, and GB VAT numbers. Refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats and the structure. You can find more information about VAT identification numbers <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a>."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "Optional. Must be formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>. Note: supplying only this field does not by itself satisfy the \"at least one identifying field\" requirement below — it doesn't count as an identifying field on its own."
          },
          "supplierTags": {
            "$ref": "#/components/schemas/SupplierTagsItem",
            "description": "Optional — but see the note below on at least one identifying field being required. In addition to the base identifying parameters, you may provide up to six free-form supplier tags per supplier: <code>supplierTag1</code>–<code>supplierTag6</code> — text found on a document (e.g. a phone number or email address) used to help match this supplier during extraction, for situations where the base parameters are insufficient — for example, non-domestic suppliers who lack standard identifiers on their invoices, or suppliers working with factoring companies where the base parameters may not clearly distinguish between two entities. Tags are flexible and designed to support multi-language and cross-market use; it's the integrating party's responsibility to select the most appropriate tags for the data available. <br><br>Each tag must be 100 characters or fewer. A tag must also: appear on the document, be at least 3 characters long, and — if it consists of multiple words or values — appear next to each other and in the same order as on the document. (Note: only the 100-character limit is actually enforced by this operation — a tag violating the other three rules is still accepted, it just won't reliably match during extraction.)"
          }
        },
        "description": "A supplier item",
        "example": {
          "supplierID": "1",
          "supplierName": "Telavox",
          "corporateIdentityNumber": "556600-7786",
          "bankAccountNumber": "5677-6487",
          "plusGiroNumber": "",
          "iban": "SE1150000000056241002716",
          "vatNumber": "SE556600778601",
          "countryOfOrigin": "SE",
          "supplierTags": {
            "supplierTag1": "+46712345678",
            "supplierTag2": "example@email.com",
            "supplierTag3": "",
            "supplierTag4": "",
            "supplierTag5": "",
            "supplierTag6": ""
          }
        }
      },
      "SupplierOutput": {
        "type": "object",
        "properties": {
          "supplierID": {
            "type": "string",
            "description": "The supplier's unique identifier within the company, exactly as submitted when the supplier was created — the API does not modify it. Guaranteed unique within the company and formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "supplierName": {
            "type": "string",
            "description": "The supplier's display name, used to identify it in reports and when talking to technical support. Empty if none was provided when the supplier was added."
          },
          "corporateIdentityNumber": {
            "type": "string",
            "description": "The supplier's corporate identity number, already validated. If <code>countryOfOrigin</code> is empty or set to the Swedish country code, this follows the Swedish format nnnnnn-nnnn — the API automatically inserts the separator dash if it was missing when the supplier was added. For any other <code>countryOfOrigin</code>, the number follows that country's official corporate-identifier format, per the EU Commission's <a href=\"https://wikis.ec.europa.eu/spaces/UDBBIS/pages/90278474/Company+identifier+Machine+readable\" target=\"_blank\" rel=\"noopener\">machine-readable company identifier</a> specification (also available as an <a href=\"https://wikis.ec.europa.eu/pages/viewpageattachments.action?pageId=90278474&metadataLink=true&preview=/90278474/90278478/NTR_ID_07Feb23.xlsx\" target=\"_blank\" rel=\"noopener\">Excel sheet</a>). Empty if none was provided when the supplier was added."
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "The supplier's Swedish bankgirot account number, already validated. Always includes the separator dash — the API inserts it automatically, 4 digits from the end, if it was missing when the supplier was added — in the format (n)nnn-nnnn. See <a href=\"https://www.bankgirot.se/\" target=\"_blank\" rel=\"noopener\">Bankgirot</a> for more on the format. Empty if none was provided."
          },
          "plusGiroNumber": {
            "type": "string",
            "description": "The supplier's Swedish PlusGiro account number, already validated. Always includes the separator dash — the API inserts it automatically, 1 digit from the end, if it was missing when the supplier was added — in the format (nnnnn)nn-n. See <a href=\"https://www.nordea.se/foretag/produkter/betala/transaktionskonto.html\" target=\"_blank\" rel=\"noopener\">Nordea</a> for more on the format. Empty if none was provided."
          },
          "iban": {
            "type": "string",
            "description": "The supplier's international bank account number, already validated. Always uppercase with spaces removed, regardless of how it was formatted when the supplier was added, per <a href=\"https://www.iso.org/obp/ui/#iso:std:iso:13616:-1:ed-2:v1:en\" target=\"_blank\" rel=\"noopener\">ISO-13616</a>. Empty if none was provided."
          },
          "vatNumber": {
            "type": "string",
            "description": "The supplier's VAT number, already validated and normalized to uppercase. Support covers European, US, and GB VAT numbers — refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats and structure, and <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a> for more on VAT identification numbers. Empty if none was provided."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "The supplier's two-letter country code, normalized to uppercase, per <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>. Empty if none was provided when the supplier was added."
          },
          "supplierTags": {
            "$ref": "#/components/schemas/SupplierTagsItem",
            "description": "Any supplier-specific tags stored for this supplier — up to six free-form identifiers (see below) used to help match this supplier against values found on an extracted document when the base parameters alone aren't enough, such as non-domestic suppliers without standard identifiers, or suppliers working with factoring companies. Unused slots are returned as empty strings. Right after creation, at least one base parameter or one tag is guaranteed to have a value — but this isn't guaranteed to still hold later, since <a href=\"/docs/suppliers/update-a-supplier#request-schema\">Update a supplier</a> allows every field, including all tags, to be cleared."
          }
        },
        "description": "The supplier as returned by the API."
      },
      "SupplierTagsItem": {
        "type": "object",
        "properties": {
          "supplierTag1": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          },
          "supplierTag2": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          },
          "supplierTag3": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          },
          "supplierTag4": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          },
          "supplierTag5": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          },
          "supplierTag6": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. a phone number or email address) used to help match this supplier during extraction. Rejected if longer than 100 characters — see the <code>supplierTags</code> notes above for the guidelines that make a tag effective at matching."
          }
        },
        "description": "A set of up to six free-form supplier tags — see <a href=\"/docs/suppliers/add-a-supplier#request-schema\">SupplierItem.supplierTags</a> for the full explanation.",
        "example": {
          "supplierTag1": "07XXXXXXXX",
          "supplierTag2": "65434552",
          "supplierTag3": "0031228366411",
          "supplierTag4": "IE1150000000056241002716",
          "supplierTag5": "",
          "supplierTag6": ""
        }
      },
      "SupplierList": {
        "required": [
          "suppliers"
        ],
        "type": "object",
        "properties": {
          "suppliers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupplierItem"
            },
            "description": "One or more suppliers to create. Each entry follows the same structure and validation rules as an individual supplier creation request — see <a href=\"/docs/suppliers/add-a-supplier#request-schema\">SupplierItem</a>."
          }
        },
        "description": "A list of suppliers to create in a single request.",
        "example": {
          "suppliers": [
            {
              "supplierID": "1",
              "supplierName": "Telavox",
              "corporateIdentityNumber": "556600-7786",
              "bankAccountNumber": "5677-6487",
              "plusGiroNumber": "",
              "iban": "SE1150000000056241002716",
              "vatNumber": "SE556600778601",
              "countryOfOrigin": "SE",
              "supplierTags": {
                "supplierTag1": "+46712345678",
                "supplierTag2": "example@email.com",
                "supplierTag3": "",
                "supplierTag4": "",
                "supplierTag5": "",
                "supplierTag6": ""
              }
            },
            {
              "supplierID": "2",
              "supplierName": "Telenor",
              "corporateIdentityNumber": "556421-0309",
              "bankAccountNumber": "5331-1338",
              "plusGiroNumber": "4792603-5",
              "iban": "SE2195000099603447926035",
              "vatNumber": "SE556421030901",
              "countryOfOrigin": ""
            },
            {
              "supplierID": "3",
              "supplierName": "Dutch Supplier B.V.",
              "corporateIdentityNumber": "12345678",
              "bankAccountNumber": "",
              "plusGiroNumber": "",
              "iban": "NL91ABNA0417164300",
              "vatNumber": "NL987654321B01",
              "countryOfOrigin": "NL",
              "supplierTags": {
                "supplierTag1": "+31207654321",
                "supplierTag2": "contact@dutchsupplier.nl",
                "supplierTag3": "",
                "supplierTag4": "",
                "supplierTag5": "",
                "supplierTag6": ""
              }
            }
          ]
        }
      },
      "SupplierInvoiceItem": {
        "required": [
          "invoiceDate",
          "totalSum",
          "accounts"
        ],
        "type": "object",
        "properties": {
          "supplierID": {
            "type": "string",
            "description": "The ID of an existing supplier this invoice is from. Optional — leave empty if unknown. If supplied, it must resolve to a supplier already added to this company — see <a href=\"/docs/suppliers/add-a-supplier#request-schema\">Add a supplier</a>. Never rewritten by the server — the value you send is echoed back exactly."
          },
          "description": {
            "type": "string",
            "description": "A free text description. Optional."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this document belongs to. Optional — doesn't have to already exist. Supplying it teaches AzoraOne to sort future uploads with a similar layout into this series."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The date the invoice was created. Required, formatted YYYY-MM-DD per <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"noopener\">ISO 8601</a>."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due. Optional, formatted YYYY-MM-DD per <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"noopener\">ISO 8601</a> when supplied."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The invoice's unique number, if one appears on the document. Optional."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The invoice's OCR (payment reference) number, if one appears on the document. Optional."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The invoice's reference number, if one appears on the document. Optional."
          },
          "orderNumber": {
            "type": "string",
            "description": "The invoice's order number, if one appears on the document. Optional."
          },
          "ourRef": {
            "type": "string",
            "description": "The sender's contact person. Optional."
          },
          "yourRef": {
            "type": "string",
            "description": "The recipient's contact person. Optional."
          },
          "totalSum": {
            "type": "string",
            "description": "The invoice's total amount. Required, must be a valid number within the service's configured limit. Not recalculated by this operation — must equal <code>vat</code> plus the sum of every account row's <code>debit</code> minus the sum of every row's <code>credit</code> (tolerance ±0.001), or the request returns 400 \"Debit and credit do not balance.\""
          },
          "vat": {
            "type": "string",
            "description": "The invoice's VAT amount. Optional, must be a valid number within the service's configured limit when supplied. Not recalculated by this operation — see <code>totalSum</code> for the balance rule it must satisfy together with the account rows."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The invoice's bookkeeping account rows. Required — the array itself must be present. Each row needs exactly one of <code>debit</code>/<code>credit</code> set to a valid non-zero number, or both left blank; a row with both filled (or both invalid) fails validation. See <code>totalSum</code> for how the full set of rows must reconcile against it and <code>vat</code>."
          }
        },
        "description": "A supplier invoice to bookkeep.",
        "example": {
          "supplierID": "1",
          "description": "Telavox invoice",
          "verificationSeries": "A",
          "invoiceDate": "2020-05-03",
          "dueDate": "",
          "invoiceNumber": "",
          "ocrNumber": "707902514856",
          "referenceNumber": "12345",
          "orderNumber": "12345",
          "ourRef": "Emma Example",
          "yourRef": "Tony Test",
          "totalSum": "3119,00",
          "vat": "623,82",
          "accounts": [
            {
              "account": "1790",
              "periodicity": {
                "offsetAccount": "6210",
                "startDate": "2020-05-01",
                "endDate": "2021-04-30"
              },
              "project": {
                "targetValue": "P657588"
              },
              "costBearer": {
                "targetValue": "10"
              },
              "resultsCentre": {
                "targetValue": "20"
              },
              "debit": "2495,29",
              "credit": "0,00"
            },
            {
              "account": "3740",
              "periodicity": {
                "offsetAccount": "",
                "startDate": "",
                "endDate": ""
              },
              "project": {
                "targetValue": ""
              },
              "costBearer": {
                "targetValue": ""
              },
              "resultsCentre": {
                "targetValue": ""
              },
              "debit": "0,00",
              "credit": "0,11"
            }
          ]
        }
      },
      "SupplierInvoiceOutput": {
        "type": "object",
        "properties": {
          "supplierID": {
            "type": "string",
            "description": "The unique ID of the linked supplier. On <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">extraction</a>, the supplier AzoraOne matched based on confidence-scored signals found on the file (corporate identity number, VAT number, IBAN, bank account number, plus-giro number, or supplier tags — see <a href=\"/docs/suppliers/add-a-supplier#request-schema\">SupplierItem</a>); empty if none could be confidently matched. On <a href=\"/docs/supplier-invoices/bookkeep-an-invoice#request-schema\">Bookkeep</a>, echoes the <code>supplierID</code> you submitted — never assigned or changed by the server."
          },
          "description": {
            "type": "string",
            "description": "A free text description. As found on the invoice when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this invoice belongs to. Matched from the file's extracted pattern when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The invoice's date, formatted YYYY-MM-DD. As found on the document when extracted (empty if not found); required and echoed back when bookkept."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due, formatted YYYY-MM-DD. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The invoice's unique number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The invoice's OCR (payment reference) number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The invoice's reference number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "orderNumber": {
            "type": "string",
            "description": "The invoice's order number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "ourRef": {
            "type": "string",
            "description": "The sender's contact person. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "yourRef": {
            "type": "string",
            "description": "The recipient's contact person. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "totalSum": {
            "type": "string",
            "description": "The invoice's total amount. As found on the document when extracted (empty if not found); required and echoed back, unrecalculated, when bookkept."
          },
          "vat": {
            "type": "string",
            "description": "The invoice's VAT amount. On <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">extraction</a>, recalculated by summing the base value found on the document together with any account rows internally flagged as VAT sub-accounts — those rows are then removed from <code>accounts</code> so they don't appear twice; if the recalculated total is zero, the originally-found value is kept unchanged instead. On <a href=\"/docs/supplier-invoices/bookkeep-an-invoice#request-schema\">Bookkeep</a>, echoed back exactly as submitted — never recalculated."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The invoice's bookkeeping account rows. On extraction, as extracted from the document — can be empty even on a successful extraction, e.g. when no usable line items were found or every extracted row nets to zero. On Bookkeep, echoes every row you submitted unchanged, including rows where both <code>debit</code> and <code>credit</code> were left empty."
          }
        },
        "description": "A supplier invoice, as returned by <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Extract data from an invoice</a> (values found on the document) or <a href=\"/docs/supplier-invoices/bookkeep-an-invoice#response-schema\">Bookkeep an invoice</a> (values echoed from what you submitted, after validation)."
      },
      "SupplierInvoiceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/SupplierInvoiceOutput",
            "description": "The extracted supplier invoice."
          },
          "extended": {
            "$ref": "#/components/schemas/SupplierInvoiceExtendedData",
            "description": "Additional, non-feedback-corrected data extracted from the invoice. Only present when the request sets the <code>extended</code> query parameter to <code>true</code>; empty otherwise."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "$ref": "#/components/schemas/Origin",
            "description": "Information on what model generated the extraction result. Only present when the request sets the <code>origin</code> query parameter to <code>true</code>; empty otherwise."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the extracted supplier invoice."
      },
      "SupplierInvoiceBookkeepResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/SupplierInvoiceOutput",
            "description": "The bookkept supplier invoice, echoing what you submitted after validation."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on the <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Extract data from an invoice</a> operation; see SupplierInvoiceExtendedData."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on the <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Extract data from an invoice</a> operation with the model that generated the result; see Origin."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the bookkept supplier invoice."
      },
      "ProgenitorItem": {
        "required": [
          "progenitorID"
        ],
        "type": "object",
        "properties": {
          "progenitorID": {
            "type": "string",
            "description": "The companyID of the existing company to inherit knowledge from. Required, and must resolve to a real company — see <a href=\"/docs/companies/retrieve-a-company#response-schema\">Retrieve a company</a>. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>; up to 200 characters. Cannot be the same as the <code>companyID</code> in the URL."
          },
          "startDateTime": {
            "type": "string",
            "description": "Restricts inheritance to progenitor patterns created on or after this date/time, formatted YYYY-MM-DD HH:mm:ss. Optional — leave empty to inherit from every pattern regardless of when it was created. Not a wall-clock validity window for the relationship itself; see the operation description above."
          },
          "stopDateTime": {
            "type": "string",
            "description": "Restricts inheritance to progenitor patterns created on or before this date/time, formatted YYYY-MM-DD HH:mm:ss. Optional, and independent of <code>startDateTime</code>. If both are supplied, <code>stopDateTime</code> must not be earlier than <code>startDateTime</code>, or the request returns a 400 response. Not a wall-clock validity window for the relationship itself; see the operation description above."
          },
          "supplierInvoices": {
            "type": "boolean",
            "description": "Whether the child company should inherit the progenitor's supplier-invoice extraction patterns. Optional, defaults to <code>true</code>."
          },
          "customerInvoices": {
            "type": "boolean",
            "description": "Whether the child company should inherit the progenitor's customer-invoice extraction patterns. Optional, defaults to <code>false</code>."
          },
          "receipts": {
            "type": "boolean",
            "description": "Whether the child company should inherit the progenitor's receipt extraction patterns. Optional, defaults to <code>true</code>."
          }
        },
        "description": "A progenitor relationship to create.",
        "example": {
          "progenitorID": "c1",
          "startDateTime": "2020-01-01 00:00:00",
          "stopDateTime": "2020-12-31 23:59:59",
          "supplierInvoices": true,
          "customerInvoices": true,
          "receipts": true
        }
      },
      "ProgenitorList": {
        "required": [
          "progenitors"
        ],
        "type": "object",
        "properties": {
          "progenitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProgenitorItem"
            },
            "description": "One or more progenitor relationships to create. Each entry follows the same structure and validation rules as an individual creation request — see <a href=\"/docs/progenitors/add-a-progenitor#request-schema\">ProgenitorItem</a>. Not required to be unique within this list — submitting the same progenitorID twice results in the second entry failing as a duplicate."
          }
        },
        "description": "A list of progenitor relationships to create in a single request.",
        "example": {
          "progenitors": [
            {
              "progenitorID": "c1",
              "startDateTime": "2020-01-01 00:00:00",
              "stopDateTime": "2020-12-31 23:59:59",
              "supplierInvoices": true,
              "customerInvoices": true,
              "receipts": true
            },
            {
              "progenitorID": "c2",
              "startDateTime": "2021-01-01 00:00:00",
              "stopDateTime": "",
              "supplierInvoices": false,
              "customerInvoices": false,
              "receipts": true
            }
          ]
        }
      },
      "ProgenitorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ProgenitorItem",
            "description": "The created progenitor relationship."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the created progenitor relationship."
      },
      "ProgenitorOutput": {
        "type": "object",
        "properties": {
          "progenitorID": {
            "type": "string",
            "description": "The companyID of the company knowledge is inherited from."
          },
          "startDateTime": {
            "type": "string",
            "description": "Restricts inheritance to progenitor patterns created on or after this date/time, formatted yyyy-MM-dd HH:mm:ss. Empty if unbounded on this side."
          },
          "stopDateTime": {
            "type": "string",
            "description": "Restricts inheritance to progenitor patterns created on or before this date/time, formatted yyyy-MM-dd HH:mm:ss. Empty if unbounded on this side."
          },
          "supplierInvoices": {
            "type": "boolean",
            "description": "Whether supplier-invoice extraction patterns are inherited from this progenitor."
          },
          "customerInvoices": {
            "type": "boolean",
            "description": "Whether customer-invoice extraction patterns are inherited from this progenitor."
          },
          "receipts": {
            "type": "boolean",
            "description": "Whether receipt extraction patterns are inherited from this progenitor."
          },
          "created": {
            "type": "string",
            "description": "When this progenitor relationship was created, or last re-added after being removed, in UTC, formatted yyyy-MM-dd HH:mm:ss. Not present on <a href=\"/docs/progenitors/add-a-progenitor#response-schema\">Add a progenitor</a>'s response — only on operations that retrieve an existing relationship."
          }
        },
        "description": "A progenitor relationship, as returned by Retrieve all progenitors / Retrieve a progenitor."
      },
      "ProgenitorListOutput": {
        "type": "object",
        "properties": {
          "progenitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProgenitorOutput"
            },
            "description": "Every active progenitor relationship for this company, sorted by the donor company's companyID. Empty array if none exist. Removed (inactive) relationships are never included."
          }
        },
        "description": "The company's active progenitor relationships."
      },
      "ProgenitorListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ProgenitorListOutput",
            "description": "The company's active progenitor relationships."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. This operation returns the full progenitor list unpaginated; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a> for the pagination shape used on operations that do paginate."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is every active progenitor relationship for the company."
      },
      "ProgenitorResponseObject": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether this particular progenitor relationship was created successfully (true/false) — independent of the other entries in the same request."
          },
          "data": {
            "$ref": "#/components/schemas/ProgenitorItem",
            "description": "The created progenitor relationship, shaped as below, when <code>success</code> is true. When <code>success</code> is false instead, this is a list of error objects (see ErrorResponse) — not the shape shown here."
          },
          "objectID": {
            "type": "string",
            "description": "The 1-based position of this entry within the submitted list — NOT its <code>progenitorID</code>. The third entry in the request always gets <code>objectID</code> \"3\", regardless of that entry's own progenitorID value."
          }
        },
        "description": "The per-entry result of a bulk progenitor create — one of these per entry submitted, in the same order."
      },
      "ProgenitorResponseObjectList": {
        "required": [
          "objectList"
        ],
        "type": "object",
        "properties": {
          "objectList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProgenitorResponseObject"
            },
            "description": "The result for each entry in the request, in the same order submitted."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "The response envelope for a bulk progenitor create — a list of per-entry results rather than the usual success/data/extended/meta/origin/time envelope."
      },
      "ProgenitorDetailResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ProgenitorOutput",
            "description": "The retrieved progenitor relationship."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a single progenitor relationship."
      },
      "ProgenitorDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "Always empty (<code>{}</code>) — deleting a progenitor relationship returns no resource data, only confirmation via <code>success</code>."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming the progenitor relationship was deleted, with no resource data returned."
      },
      "MemoryDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "Always empty (<code>{}</code>) — deleting a company's memories returns no resource data, only confirmation via <code>success</code>. Succeeds the same way even if the company had no memories to delete."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming the company's memories were deleted, with no resource data returned."
      },
      "ModelUpdateItem": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether the matched patterns should be enabled (<code>true</code>) or disabled (<code>false</code>). Not technically required by the request body, but omitting it is silently treated as <code>false</code> rather than rejected — always supply it explicitly to avoid an unintended bulk-disable."
          }
        },
        "description": "The requested active state for a bulk pattern update.",
        "example": {
          "active": false
        }
      },
      "ModelsUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/ModelUpdateItem",
            "description": "Echoes the requested active state. Does not report how many patterns were actually affected or which ones — see the operation description above."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming a bulk pattern-status update request was accepted."
      },
      "Response": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "The resulting data"
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response"
      },
      "SupplierResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/SupplierOutput",
            "description": "The created supplier."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the created/retrieved supplier."
      },
      "SupplierListOutput": {
        "type": "object",
        "properties": {
          "suppliers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupplierOutput"
            },
            "description": "Every supplier added to this company. Empty array if none have been added yet."
          }
        },
        "description": "The company's supplier list, as returned by the API."
      },
      "SupplierListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/SupplierListOutput",
            "description": "The company's suppliers."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. This operation returns the full supplier list unpaginated; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a> for the pagination shape used on operations that do paginate."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the company's full supplier list."
      },
      "SupplierDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "Always empty (<code>{}</code>) — deleting a supplier returns no resource data, only confirmation via <code>success</code>."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming the supplier was deleted, with no resource data returned."
      },
      "SupplierResponseObject": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether this particular supplier was created successfully (true/false) — independent of the other suppliers in the same request."
          },
          "data": {
            "$ref": "#/components/schemas/SupplierOutput",
            "description": "The created supplier, shaped as below, when <code>success</code> is true. When <code>success</code> is false instead, this is a list of error objects (see ErrorResponse) — not the shape shown here."
          },
          "objectID": {
            "type": "string",
            "description": "The 1-based position of this supplier within the submitted list — NOT its <code>supplierID</code>. The third entry in the request always gets <code>objectID</code> \"3\", regardless of that supplier's own supplierID value."
          }
        },
        "description": "The per-supplier result of a bulk create — one of these per supplier submitted, in the same order."
      },
      "SupplierResponseObjectList": {
        "required": ["objectList"],
        "type": "object",
        "properties": {
          "objectList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupplierResponseObject"
            },
            "description": "The result for each supplier in the request, in the same order submitted."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "The response envelope for a bulk supplier create — a list of per-supplier results rather than the usual success/data/extended/meta/origin/time envelope."
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "An API-specific error code. See the full list of error codes and their meanings on the <a href=\"https://developer.azora.one/docs/overview/responses\" target=\"_blank\" rel=\"noopener\">Responses</a> page."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message about the incident"
          },
          "details": {
            "type": "string",
            "description": "Details about the incident"
          },
          "element": {
            "type": "string",
            "description": "Which element of the body was at fault"
          }
        },
        "description": "An error response"
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "1-based index of this page."
          },
          "pageSize": {
            "type": "integer",
            "description": "Items per page."
          },
          "totalItems": {
            "type": "integer",
            "description": "Total matching items across all pages."
          },
          "totalPages": {
            "type": "integer",
            "description": "Total pages (ceil(totalItems / pageSize))."
          }
        },
        "description": "Pagination details for a list response."
      },
      "Meta": {
        "type": "object",
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/Pagination",
            "description": "Pagination details for this page of results."
          },
          "updated": {
            "type": "string",
            "description": "When the underlying data was last synced, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          }
        },
        "description": "Response metadata container. Populated on list operations; unused (empty) elsewhere."
      },
      "Ancestor": {
        "type": "object",
        "properties": {
          "ancestorType": {
            "type": "string",
            "description": "What kind of model generated the result: StartBot (precognition model), Progenitor (inherited model from another company), Brick (binary model), or None (a model originally created by the company that performed the extraction)."
          },
          "companyID": {
            "type": "string",
            "description": "The origin of the model (e.g. the specific company or specific brick) that generated the result."
          }
        },
        "description": "Identifies the model that produced an extraction result."
      },
      "Origin": {
        "type": "object",
        "properties": {
          "ancestor": {
            "$ref": "#/components/schemas/Ancestor",
            "description": "The model that generated this extraction result."
          }
        },
        "description": "Contains information on wherefrom an extraction result was generated. Populated on extraction operations; unused (empty) elsewhere."
      },
      "SupplierInvoiceExtendedData": {
        "type": "object",
        "properties": {
          "dates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dates found on the invoice. Format: YYYY-MM-DD."
          },
          "times": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Times found on the invoice. Format: hh:mm:ss."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Email addresses found on the invoice. Format: RFC 5322."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies found on the invoice, extracted from codes (e.g. USD, SEK), symbols (€), or aliases (e.g. kr, resolved using countryOfOrigin as SEK or DKK). Format: ISO 4217."
          },
          "creditCardNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The 4 (or 5) last digits of the credit cards found on the invoice. Format: xxxx(-x)."
          },
          "corporateIdentityNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Corporate identity numbers found on the invoice. Format: xxxxxx-xxxx."
          },
          "bankAccountNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Bank account numbers found on the invoice. Format: xxx-xxxx or xxxx-xxxx."
          },
          "plusGiroNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "PlusGiro numbers found on the invoice. Format: xx-x to xxxxxxx-x."
          },
          "ibans": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank account numbers (IBAN) found on the invoice. Format: ISO 13616."
          },
          "bic": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank BIC (SWIFT) codes found on the invoice. Format: ISO 9362."
          },
          "vatNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all VAT numbers found on the invoice for that country. Format: EU VAT Numbers."
          },
          "corporateIdentityNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all corporate identity numbers found on the invoice for that country. Format: EU machine-readable company identifiers."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "A two-letter country code derived from values such as VAT numbers, IBANs, or corporate identity numbers found on the invoice. Format: ISO-3166-1 alpha-2."
          }
        },
        "description": "Additional, non-feedback-corrected data extracted from a supplier invoice. Only returned when the request sets the extended query parameter to true; unused (empty) on non-invoice operations. Includes plain lists (single-country use) and by-country dictionaries (multi-country use)."
      },
      "ResponseObject": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "The resulting data"
          },
          "objectID": {
            "type": "string",
            "description": "The index of the object received in the list"
          }
        },
        "description": "A response object"
      },
      "ResponseObjectList": {
        "required": [
          "objectList"
        ],
        "type": "object",
        "properties": {
          "objectList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponseObject"
            },
            "description": "The list of objects that was received in the request"
          },
          "time": {
            "type": "string",
            "description": "The exact time that the response was created"
          }
        },
        "description": "A response object list"
      },
      "Body": {
        "example": "-----------------------------41184676334\nContent-Disposition: form-data; name=\"fileID\"\nContent-Type: text/plain\n\n100\n-----------------------------41184676334\nContent-Disposition: form-data; name=\"file\" filename=\"telavox.pdf\"\nContent-Type: application/pdf\n\nInsert file content here!\n-----------------------------41184676334--"
      },
      "CustomerTagsItem": {
        "type": "object",
        "properties": {
          "customerTag1": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          },
          "customerTag2": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          },
          "customerTag3": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          },
          "customerTag4": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          },
          "customerTag5": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          },
          "customerTag6": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional identifier text found on the document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction. Rejected if longer than 100 characters — see the customerTags notes above for the guidelines that make a tag effective at matching."
          }
        },
        "description": "A customer tags item",
        "example": {
          "customerTag1": "billing@telavox.se",
          "customerTag2": "+46712345678",
          "customerTag3": "",
          "customerTag4": "",
          "customerTag5": "",
          "customerTag6": ""
        }
      },
      "CustomerItem": {
        "required": [
          "customerID"
        ],
        "type": "object",
        "properties": {
          "customerID": {
            "type": "string",
            "description": "Must be unique within the company. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "customerName": {
            "type": "string",
            "description": "Optional. Used to easily identify a specific customer within the service, in reports and when talking to technical support."
          },
          "legalRegistrationNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. The customer's official registration identifier, such as a company registration number or organisation number. Must be at least 4 characters and contain only letters A-Z, digits 0-9, and hyphens. Normalized to uppercase."
          },
          "vatNumber": {
            "type": "string",
            "description": "Optional — but see the note below on at least one identifying field being required. The <code>vatNumber</code> must be in the correct format, with the country code extracted directly from the number for validation. We support only European, US, and GB VAT numbers. Refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats and the structure. You can find more information about VAT identification numbers <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a>. Normalized to uppercase."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "Optional. Must be formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>. Normalized to uppercase. Note: supplying only this field does not by itself satisfy the \"at least one identifying field\" requirement below — it doesn't count as an identifying field on its own."
          },
          "customerTags": {
            "$ref": "#/components/schemas/CustomerTagsItem",
            "description": "Optional — but see the note below on at least one identifying field being required. In addition to the base identifying parameters, you may provide up to six free-form customer tags per customer: <code>customerTag1</code>–<code>customerTag6</code> — text found on a document (e.g. an email address, phone number, or postal address) used to help match this customer during customer-invoice extraction, for situations where the base parameters are insufficient — for example, non-domestic customers who lack standard identifiers on their invoices, or customers working with factoring companies where the base parameters may not clearly distinguish between two entities. Tags are flexible and designed to support multi-language and cross-market use; it's the integrating party's responsibility to select the most appropriate tags for the data available. <br><br>Each tag must be 100 characters or fewer. A tag must also: appear on the document, be at least 3 characters long, and — if it consists of multiple words or values — appear next to each other and in the same order as on the document. (Note: only the 100-character limit is actually enforced by this operation — a tag violating the other three rules is still accepted, it just won't reliably match during extraction.)"
          }
        },
        "description": "A customer item",
        "example": {
          "customerID": "1",
          "customerName": "Telavox",
          "legalRegistrationNumber": "556600-7786",
          "vatNumber": "SE556600778601",
          "countryOfOrigin": "SE",
          "customerTags": {
            "customerTag1": "billing@telavox.se",
            "customerTag2": "+46712345678",
            "customerTag3": "",
            "customerTag4": "",
            "customerTag5": "",
            "customerTag6": ""
          }
        }
      },
      "CustomerOutput": {
        "type": "object",
        "properties": {
          "customerID": {
            "type": "string",
            "description": "The customer's unique identifier within the company, exactly as submitted when the customer was created — the API does not modify it. Guaranteed unique within the company and formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "customerName": {
            "type": "string",
            "description": "The customer's display name, used to identify it in reports and when talking to technical support. Empty if none was provided when the customer was added."
          },
          "legalRegistrationNumber": {
            "type": "string",
            "description": "The customer's official registration identifier, already validated and normalized to uppercase. Empty if none was provided when the customer was added."
          },
          "vatNumber": {
            "type": "string",
            "description": "The customer's VAT number, already validated and normalized to uppercase. Support covers European, US, and GB VAT numbers — refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats and structure, and <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a> for more on VAT identification numbers. Empty if none was provided."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "The customer's two-letter country code, normalized to uppercase, per <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>. Empty if none was provided when the customer was added."
          },
          "customerTags": {
            "$ref": "#/components/schemas/CustomerTagsItem",
            "description": "Any customer-specific tags stored for this customer — up to six free-form identifiers (see below) used to help match this customer against values found on an extracted document when the base parameters alone aren't enough, such as non-domestic customers without standard identifiers, or customers working with factoring companies. Unused slots are returned as empty strings. Right after creation, at least one of <code>legalRegistrationNumber</code>, <code>vatNumber</code> or a tag is guaranteed to have a value — but this isn't guaranteed to still hold later, since <a href=\"/docs/customers/update-a-customer#request-schema\">Update a customer</a> allows every field, including all tags, to be cleared."
          }
        },
        "description": "The customer as returned by the API."
      },
      "CustomerResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CustomerOutput",
            "description": "The created customer."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the created/retrieved customer."
      },
      "CustomerList": {
        "required": [
          "customers"
        ],
        "type": "object",
        "properties": {
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerItem"
            },
            "description": "One or more customers to create. Each entry follows the same structure and validation rules as an individual customer creation request — see <a href=\"/docs/customers/add-a-customer#request-schema\">CustomerItem</a>."
          }
        },
        "description": "A list of customers to create in a single request.",
        "example": {
          "customers": [
            {
              "customerID": "1",
              "customerName": "Telavox",
              "legalRegistrationNumber": "556600-7786",
              "vatNumber": "SE556600778601",
              "countryOfOrigin": "SE",
              "customerTags": {
                "customerTag1": "billing@telavox.se",
                "customerTag2": "+46712345678",
                "customerTag3": "",
                "customerTag4": "",
                "customerTag5": "",
                "customerTag6": ""
              }
            },
            {
              "customerID": "2",
              "customerName": "Acme Consulting",
              "legalRegistrationNumber": "19800101-1234",
              "vatNumber": "",
              "countryOfOrigin": "SE",
              "customerTags": {
                "customerTag1": "accounts@acme.example",
                "customerTag2": "Box 123, 11122 Stockholm",
                "customerTag3": "",
                "customerTag4": "",
                "customerTag5": "",
                "customerTag6": ""
              }
            }
          ]
        }
      },
      "CustomerResponseObject": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether this particular customer was created successfully (true/false) — independent of the other customers in the same request."
          },
          "data": {
            "$ref": "#/components/schemas/CustomerOutput",
            "description": "The created customer, shaped as below, when <code>success</code> is true. When <code>success</code> is false instead, this is a list of error objects (see ErrorResponse) — not the shape shown here."
          },
          "objectID": {
            "type": "string",
            "description": "The 1-based position of this customer within the submitted list — NOT its <code>customerID</code>. The third entry in the request always gets <code>objectID</code> \"3\", regardless of that customer's own customerID value."
          }
        },
        "description": "The per-customer result of a bulk create — one of these per customer submitted, in the same order."
      },
      "CustomerResponseObjectList": {
        "required": [
          "objectList"
        ],
        "type": "object",
        "properties": {
          "objectList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerResponseObject"
            },
            "description": "The result for each customer in the request, in the same order submitted."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "The response envelope for a bulk customer create — a list of per-customer results rather than the usual success/data/extended/meta/origin/time envelope."
      },
      "CustomerListOutput": {
        "type": "object",
        "properties": {
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerOutput"
            },
            "description": "The customers on this page, in internal creation order — there is no way to change the sort order or filter this list. At most pageSize items; fewer only on the last page."
          }
        },
        "description": "A page of the company's customers."
      },
      "CustomerListMeta": {
        "type": "object",
        "properties": {
          "pagination": {
            "$ref": "#/components/schemas/Pagination",
            "description": "Pagination details for this page of results."
          }
        },
        "description": "Response metadata for Retrieve all customers — pagination only, always populated since this operation always paginates."
      },
      "CustomerListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CustomerListOutput",
            "description": "The requested page of customers."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "$ref": "#/components/schemas/CustomerListMeta",
            "description": "Pagination details for this page — always populated, since this operation always paginates."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a page of the company's customers."
      },
      "CustomerDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "Always empty (<code>{}</code>) — deleting a customer returns no resource data, only confirmation via <code>success</code>."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming the customer was deleted, with no resource data returned."
      },
      "CustomerInvoiceItem": {
        "required": [
          "invoiceDate",
          "totalSum"
        ],
        "type": "object",
        "properties": {
          "customerID": {
            "type": "string",
            "description": "The ID of an existing customer this invoice is from. Optional — leave empty if unknown. If supplied, it must resolve to a customer already added to this company — see <a href=\"/docs/customers/add-a-customer#request-schema\">Add a customer</a>. Never rewritten by the server — the value you send is echoed back exactly."
          },
          "description": {
            "type": "string",
            "description": "A free text description. Optional, up to 100 characters."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this document belongs to. Optional — doesn't have to already exist. Supplying it teaches AzoraOne to sort future uploads with a similar layout into this series. Must be formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a> (case-insensitive); up to 100 characters."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The date the invoice was created. Required, formatted YYYY-MM-DD per <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"noopener\">ISO 8601</a>."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due. Optional, formatted YYYY-MM-DD per <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\" target=\"_blank\" rel=\"noopener\">ISO 8601</a> when supplied."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The invoice's unique number, if one appears on the document. Optional, up to 100 characters."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The invoice's OCR (payment reference) number, if one appears on the document. Optional. When supplied, spaces are stripped and the remaining digits must be 2–25 characters long and pass a checksum (mod-10) validation."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The invoice's reference number, if one appears on the document. Optional, up to 100 characters."
          },
          "orderNumber": {
            "type": "string",
            "description": "The invoice's order number, if one appears on the document. Optional, up to 100 characters."
          },
          "ourRef": {
            "type": "string",
            "description": "The sender's contact person. Optional, up to 100 characters."
          },
          "yourRef": {
            "type": "string",
            "description": "The recipient's contact person. Optional, up to 100 characters."
          },
          "totalSum": {
            "type": "string",
            "description": "The invoice's total amount. Required, must be a valid number within the service's configured limit. Not recalculated by this operation — must equal <code>vat</code> plus the sum of every account row's <code>credit</code> minus the sum of every row's <code>debit</code> (tolerance &lt;0.001), or the request returns 400 \"Debit and credit do not balance.\" This is the reverse of the balance rule used for supplier invoices, since customer invoices are outgoing."
          },
          "vat": {
            "type": "string",
            "description": "The invoice's VAT amount. Optional, must be a valid number within the service's configured limit when supplied. Not recalculated by this operation — see <code>totalSum</code> for the balance rule it must satisfy together with the account rows."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The invoice's bookkeeping account rows. Optional — if omitted or left empty, it contributes nothing to the balance check (see <code>totalSum</code>). Each row needs exactly one of <code>debit</code>/<code>credit</code> set to a valid non-zero number, or both left blank; a row with both filled (or both invalid) fails validation."
          }
        },
        "description": "A customer invoice to bookkeep.",
        "example": {
          "customerID": "1",
          "description": "Music license fee for period 2025-07-01 to 2025-12-31",
          "verificationSeries": "A",
          "invoiceDate": "2025-10-06",
          "dueDate": "2025-11-05",
          "invoiceNumber": "779191",
          "ocrNumber": "22880377919146",
          "referenceNumber": "12345",
          "orderNumber": "12345",
          "ourRef": "Accounts Receivable",
          "yourRef": "Jon Johansson",
          "totalSum": "4950,00",
          "vat": "280,20",
          "accounts": [
            {
              "account": "3041",
              "periodicity": {
                "offsetAccount": "",
                "startDate": "",
                "endDate": ""
              },
              "project": {
                "targetValue": "P657588"
              },
              "costBearer": {
                "targetValue": "10"
              },
              "resultsCentre": {
                "targetValue": "20"
              },
              "debit": "",
              "credit": "4669,80"
            }
          ]
        }
      },
      "CustomerInvoiceExtendedData": {
        "type": "object",
        "properties": {
          "dates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dates found on the invoice. Format: YYYY-MM-DD."
          },
          "times": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Times found on the invoice. Format: hh:mm:ss."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Email addresses found on the invoice. Format: RFC 5322."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Currencies found on the invoice, extracted from codes (e.g. USD, SEK), symbols (€), or aliases (e.g. kr, resolved using countryOfOrigin as SEK or DKK). Format: ISO 4217."
          },
          "creditCardNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The 4 (or 5) last digits of the credit cards found on the invoice. Format: xxxx(-x)."
          },
          "corporateIdentityNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Legal registration numbers found on the invoice — the field name is shared with the supplier-invoice equivalent, but on customer invoices it holds legal registration numbers rather than corporate identity numbers. Format: xxxxxx-xxxx."
          },
          "ibans": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank account numbers (IBAN) found on the invoice. Format: ISO 13616."
          },
          "bic": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "International bank BIC (SWIFT) codes found on the invoice. Format: ISO 9362."
          },
          "vatNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all VAT numbers found on the invoice for that country. Format: EU VAT Numbers."
          },
          "corporateIdentityNumbersByCountry": {
            "type": "object",
            "description": "A dictionary keyed by country code (ISO-3166-1 alpha-2), each value a list of all legal registration numbers found on the invoice for that country — see corporateIdentityNumbers above on the field-naming note. Format: EU machine-readable company identifiers."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "A two-letter country code derived from values such as VAT numbers, IBANs, or legal registration numbers found on the invoice. Format: ISO-3166-1 alpha-2."
          }
        },
        "description": "Additional, non-feedback-corrected data extracted from a customer invoice. Only returned when the request sets the extended query parameter to true; unused (empty) on non-invoice operations. Unlike the supplier-invoice equivalent, does not include bankAccountNumbers or plusGiroNumbers.",
        "example": {
          "dates": [
            "2025-10-06",
            "2025-11-05"
          ],
          "times": [
            "11:23:55"
          ],
          "emails": [
            "billing@telavox.se"
          ],
          "currencies": [
            "SEK"
          ],
          "creditCardNumbers": [],
          "corporateIdentityNumbers": [
            "556600-7786"
          ],
          "ibans": [],
          "bic": [],
          "vatNumbersByCountry": {
            "SE": [
              "SE556600778601"
            ]
          },
          "corporateIdentityNumbersByCountry": {
            "SE": [
              "5566007786"
            ]
          },
          "countryOfOrigin": "SE"
        }
      },
      "CustomerInvoiceOutput": {
        "type": "object",
        "properties": {
          "customerID": {
            "type": "string",
            "description": "The unique ID of the linked customer. On <a href=\"/docs/customer-invoices/extract-data-from-a-customer-invoice#response-schema\">extraction</a>, the customer AzoraOne matched based on confidence-scored signals found on the file (legal registration number, VAT number, or customer tags — see <a href=\"/docs/customers/add-a-customer#request-schema\">CustomerItem</a>); empty if none could be confidently matched. On <a href=\"/docs/customer-invoices/bookkeep-a-customer-invoice#request-schema\">Bookkeep</a>, echoes the <code>customerID</code> you submitted — never assigned or changed by the server."
          },
          "description": {
            "type": "string",
            "description": "A free text description. As found on the invoice when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series this invoice belongs to. Matched from the file's extracted pattern when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "invoiceDate": {
            "type": "string",
            "description": "The invoice's date, formatted YYYY-MM-DD. As found on the document when extracted (empty if not found); required and echoed back when bookkept."
          },
          "dueDate": {
            "type": "string",
            "description": "The date the invoice is due, formatted YYYY-MM-DD. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "invoiceNumber": {
            "type": "string",
            "description": "The invoice's unique number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "ocrNumber": {
            "type": "string",
            "description": "The invoice's OCR (payment reference) number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "referenceNumber": {
            "type": "string",
            "description": "The invoice's reference number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "orderNumber": {
            "type": "string",
            "description": "The invoice's order number. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "ourRef": {
            "type": "string",
            "description": "The sender's contact person. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "yourRef": {
            "type": "string",
            "description": "The recipient's contact person. As found on the document when extracted; echoes what you submitted when bookkept. Empty if neither applies."
          },
          "totalSum": {
            "type": "string",
            "description": "The invoice's total amount. As found on the document when extracted (empty if not found); required and echoed back, unrecalculated, when bookkept."
          },
          "vat": {
            "type": "string",
            "description": "The invoice's VAT amount. On <a href=\"/docs/customer-invoices/extract-data-from-a-customer-invoice#response-schema\">extraction</a>, recalculated by summing the base value found on the document together with any account rows internally flagged as VAT sub-accounts — those rows are then removed from <code>accounts</code> so they don't appear twice; if the recalculated total is zero, the originally-found value is kept unchanged instead. On <a href=\"/docs/customer-invoices/bookkeep-a-customer-invoice#request-schema\">Bookkeep</a>, echoed back exactly as submitted — never recalculated."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountItem"
            },
            "description": "The invoice's bookkeeping account rows. On extraction, as extracted from the document — can be empty even on a successful extraction, e.g. when no usable line items were found or every extracted row nets to zero. On Bookkeep, echoes every row you submitted unchanged, including rows where both <code>debit</code> and <code>credit</code> were left empty."
          }
        },
        "description": "A customer invoice, as returned by <a href=\"/docs/customer-invoices/extract-data-from-a-customer-invoice#response-schema\">Extract data from a customer invoice</a> (values found on the document) or <a href=\"/docs/customer-invoices/bookkeep-a-customer-invoice#response-schema\">Bookkeep a customer invoice</a> (values echoed from what you submitted, after validation)."
      },
      "CustomerInvoiceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CustomerInvoiceOutput",
            "description": "The extracted customer invoice."
          },
          "extended": {
            "$ref": "#/components/schemas/CustomerInvoiceExtendedData",
            "description": "Additional, non-feedback-corrected data extracted from the invoice. Only present when the request sets the <code>extended</code> query parameter to <code>true</code>; empty otherwise."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "$ref": "#/components/schemas/Origin",
            "description": "Information on what model generated the extraction result. Only present when the request sets the <code>origin</code> query parameter to <code>true</code>; empty otherwise."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the extracted customer invoice."
      },
      "CustomerInvoiceBookkeepResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CustomerInvoiceOutput",
            "description": "The bookkept customer invoice, echoing what you submitted after validation."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on customer-invoice extraction operations; see <a href=\"/docs/customer-invoices/extract-data-from-a-customer-invoice#response-schema\">CustomerInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/customer-invoices/extract-data-from-a-customer-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is the bookkept customer invoice.",
        "example": {
          "success": true,
          "data": {
            "customerID": "1",
            "description": "Music license fee for period 2025-07-01 to 2025-12-31",
            "verificationSeries": "A",
            "invoiceDate": "2025-10-06",
            "dueDate": "2025-11-05",
            "invoiceNumber": "779191",
            "ocrNumber": "22880377919146",
            "referenceNumber": "12345",
            "orderNumber": "12345",
            "ourRef": "Accounts Receivable",
            "yourRef": "Jon Johansson",
            "totalSum": "4950,00",
            "vat": "280,20",
            "accounts": [
              {
                "account": "3041",
                "periodicity": {
                  "offsetAccount": "",
                  "startDate": "",
                  "endDate": ""
                },
                "project": {
                  "targetValue": "P657588"
                },
                "costBearer": {
                  "targetValue": "10"
                },
                "resultsCentre": {
                  "targetValue": "20"
                },
                "debit": "",
                "credit": "4669,80"
              }
            ]
          },
          "extended": "",
          "meta": "",
          "origin": "",
          "time": "2026-05-20 12:00:00"
        }
      },
      "PatternItemRequest": {
        "required": [
          "patternID",
          "type",
          "identifiers"
        ],
        "type": "object",
        "properties": {
          "patternID": {
            "type": "string",
            "description": "A unique identifier for this pattern, chosen by you. Required, must be unique within the company, formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>; up to 200 characters. On <a href=\"/docs/patterns/update-a-pattern#request-schema\">update</a>, if supplied, it must match the patternID in the URL, or the request returns a 400."
          },
          "type": {
            "type": "string",
            "description": "The document type this pattern applies to: <code>SupplierInvoice</code>, <code>CustomerInvoice</code>, <code>Receipt</code>, or <code>Other</code>. Required. Freely changeable on <a href=\"/docs/patterns/update-a-pattern#request-schema\">update</a>."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series to suggest when this pattern matches. Optional — leave empty if you only want this pattern to influence the suggested document type, not series. Must be formatted according to RFC-1738; up to 100 characters. On <a href=\"/docs/patterns/update-a-pattern#request-schema\">update</a>, leaving this empty clears any previously-set value — there is no way to update a pattern without resending this field if you want to keep it."
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The vocabulary this pattern matches against — a document becomes a candidate match when its recognized text contains all of these identifiers. Required, at least one, on both creation and <a href=\"/docs/patterns/update-a-pattern#request-schema\">update</a> — there is no way to update a pattern without resending its complete identifier set. Each identifier must be a single token, 3-25 characters, lowercase letters a-z only, with no spaces, numbers, or diacritics; identifiers you submit are automatically lowercased and de-duplicated. Every identifier must already exist in AzoraOne's identifier vocabulary — see the note above — one that AzoraOne has never encountered in any OCR'd document is rejected."
          },
          "source": {
            "type": "string",
            "description": "Where this pattern originated: <code>client</code> (added directly via this API) or <code>provider</code> (added on your behalf by AzoraOne or an integration partner). Optional on creation, defaults to <code>client</code>. Cannot be changed after creation. AzoraOne itself uses a third value, <code>system</code>, for patterns it learns automatically; you cannot set this via the API, only <code>client</code>/<code>provider</code>. <b>On <a href=\"/docs/patterns/update-a-pattern#request-schema\">update</a>, this field is not preserved by omission</b> — leaving it out defaults it to <code>client</code> just like on creation, and that default is then checked against the pattern's actual stored source like any other value; if the stored source isn't <code>client</code>, omitting this field causes the update to fail. Always resend the pattern's current source explicitly (e.g. from <a href=\"/docs/patterns/retrieve-a-pattern#response-schema\">Retrieve a pattern</a>) to avoid this. A pattern whose source is <code>system</code> cannot be successfully updated through this operation at all."
          }
        },
        "description": "Request payload used for creating and updating patterns",
        "example": {
          "patternID": "1",
          "type": "SupplierInvoice",
          "verificationSeries": "A",
          "identifiers": [
            "telavox",
            "telecom",
            "invoice"
          ],
          "source": "client"
        }
      },
      "PatternItem": {
        "required": [
          "patternID",
          "type",
          "identifiers"
        ],
        "type": "object",
        "properties": {
          "patternID": {
            "type": "string",
            "description": "The pattern's unique ID within the company, exactly as submitted — the API does not modify it."
          },
          "type": {
            "type": "string",
            "description": "The document type this pattern applies to: <code>SupplierInvoice</code>, <code>CustomerInvoice</code>, <code>Receipt</code>, or <code>Other</code>."
          },
          "verificationSeries": {
            "type": "string",
            "description": "The verification series suggested when this pattern matches. Empty if none was set."
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The vocabulary this pattern matches against, normalized to lowercase with duplicates removed."
          },
          "source": {
            "type": "string",
            "description": "Where this pattern originated: <code>client</code>, <code>provider</code>, or <code>system</code> (a pattern AzoraOne learned automatically — never created via this API)."
          },
          "createdDate": {
            "type": "string",
            "description": "When this pattern was first created, in UTC, formatted yyyy-MM-dd HH:mm:ss."
          }
        },
        "description": "Response payload for a pattern item",
        "example": {
          "patternID": "1",
          "type": "SupplierInvoice",
          "verificationSeries": "A",
          "identifiers": [
            "telavox",
            "telecom",
            "invoice"
          ],
          "source": "client",
          "createdDate": "2026-05-20 12:00:00"
        }
      },
      "PatternList": {
        "required": [
          "patterns"
        ],
        "type": "object",
        "properties": {
          "patterns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatternItem"
            },
            "description": "The patterns matching the request, for the requested page, in the requested sort order."
          }
        },
        "description": "A page of the company's patterns.",
        "example": {
          "patterns": [
            {
              "patternID": "1",
              "type": "SupplierInvoice",
              "verificationSeries": "A",
              "identifiers": [
                "telavox",
                "telecom",
                "invoice"
              ],
              "source": "client",
              "createdDate": "2026-08-06 12:00:00"
            },
            {
              "patternID": "2",
              "type": "Receipt",
              "verificationSeries": "",
              "identifiers": [
                "parking",
                "receipt",
                "garage"
              ],
              "source": "provider",
              "createdDate": "2026-08-05 09:30:00"
            }
          ]
        }
      },
      "PatternMetaModel": {
        "type": "object",
        "properties": {
          "pagination": {
            "type": "object",
            "properties": {
              "pageNumber": {
                "type": "integer",
                "description": "1-based index of this page."
              },
              "pageSize": {
                "type": "integer",
                "description": "Items per page."
              },
              "totalItems": {
                "type": "integer",
                "description": "Total matching items across all pages."
              },
              "totalPages": {
                "type": "integer",
                "description": "Total pages (ceil(totalItems / pageSize))."
              }
            },
            "description": "Pagination details for this page of results. Always present — this operation always paginates, even when pageNumber/pageSize weren't supplied."
          }
        },
        "description": "Response metadata for Retrieve all patterns — pagination only, always populated.",
        "example": {
          "pagination": {
            "pageNumber": 1,
            "pageSize": 10,
            "totalItems": 2,
            "totalPages": 1
          }
        }
      },
      "PatternItemResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/PatternItem",
            "description": "The created pattern."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a single pattern.",
        "example": {
          "success": true,
          "data": {
            "patternID": "1",
            "type": "SupplierInvoice",
            "verificationSeries": "A",
            "identifiers": [
              "telavox",
              "telecom",
              "invoice"
            ],
            "source": "client",
            "createdDate": "2026-05-20 12:00:00"
          },
          "extended": "",
          "meta": "",
          "origin": "",
          "time": "2026-05-20 12:00:00"
        }
      },
      "PatternListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/PatternList",
            "description": "The requested page of patterns."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "$ref": "#/components/schemas/PatternMetaModel",
            "description": "Pagination details for this page — always populated, since this operation always paginates."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a page of the company's patterns.",
        "example": {
          "success": true,
          "data": {
            "patterns": [
              {
                "patternID": "1",
                "type": "SupplierInvoice",
                "verificationSeries": "A",
                "identifiers": [
                  "telavox",
                  "telecom",
                  "invoice"
                ],
                "source": "client",
                "createdDate": "2026-08-06 12:00:00"
              },
              {
                "patternID": "2",
                "type": "Receipt",
                "verificationSeries": "",
                "identifiers": [
                  "parking",
                  "receipt",
                  "garage"
                ],
                "source": "provider",
                "createdDate": "2026-08-05 09:30:00"
              }
            ]
          },
          "extended": "",
          "meta": {
            "pagination": {
              "pageNumber": 1,
              "pageSize": 10,
              "totalItems": 2,
              "totalPages": 1
            }
          },
          "origin": "",
          "time": "2026-08-06 12:20:00"
        }
      },
      "PatternDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "type": "object",
            "description": "Always empty (<code>{}</code>) — deleting a pattern returns no resource data, only confirmation via <code>success</code>."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response confirming the pattern was deleted, with no resource data returned."
      },
      "CompanyOutput": {
        "type": "object",
        "properties": {
          "companyID": {
            "type": "string",
            "description": "The company's unique identifier, exactly as it was assigned when the company was added. Unique within the service and formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "companyName": {
            "type": "string",
            "description": "The company's display name, used to identify it in reports and when talking to technical support. Empty if none was provided when the company was added."
          },
          "companyProxy": {
            "type": "string",
            "description": "The accounting firm, parent company, or billing unit this company is grouped under, used to identify it in reports and when talking to technical support. Empty if the company was not added under a proxy."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the company is currently active or inactive in the service. The exact effect of this depends on your agreement."
          },
          "precognition": {
            "$ref": "#/components/schemas/PrecognitionItem",
            "description": "The company's precognition settings — see below."
          },
          "corporateIdentityNumber": {
            "type": "string",
            "description": "The company's corporate identity number, already validated. If <code>countryOfOrigin</code> is empty or set to the Swedish country code, this follows the Swedish format <code>nnnnnn-nnnn</code> — the API automatically inserts the separator dash if it was missing when the company was added. For any other <code>countryOfOrigin</code>, the number follows that country's official corporate-identifier format, per the EU Commission's specifications — see <a href=\"https://wikis.ec.europa.eu/spaces/UDBBIS/pages/90278474/Company+identifier+Machine+readable\" target=\"_blank\" rel=\"noopener\">Company identifier Machine readable</a> and the accompanying <a href=\"https://wikis.ec.europa.eu/pages/viewpageattachments.action?pageId=90278474&metadataLink=true&preview=/90278474/90278478/NTR_ID_07Feb23.xlsx\" target=\"_blank\" rel=\"noopener\">Excel sheet</a> (Swedish format details: <a href=\"https://www4.skatteverket.se/rattsligvagledning/edition/2021.8/326447.html\" target=\"_blank\" rel=\"noopener\">Skatteverket</a>). Also used internally to exclude a customer's own company when matching a supplier from the supplier list during an extraction on a supplier invoice."
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "The company's Swedish bank account (bankgiro) number. Only used when <code>countryOfOrigin</code> is either empty or set to the Swedish country code. Always includes the separator dash — the API inserts it automatically if it was missing when the company was added — in the format (n)nnn-nnnn. See <a href=\"https://www.bankgirot.se/\" target=\"_blank\" rel=\"noopener\">Bankgirot</a> for more information."
          },
          "plusGiroNumber": {
            "type": "string",
            "description": "The company's Swedish plusgiro number. Only used when <code>countryOfOrigin</code> is either empty or set to the Swedish country code. Always includes the separator dash — the API inserts it automatically if it was missing when the company was added — in the format (nnnnn)nn-n. See <a href=\"https://www.nordea.se/foretag/produkter/betala/transaktionskonto.html\" target=\"_blank\" rel=\"noopener\">Nordea</a> for more information."
          },
          "iban": {
            "type": "string",
            "description": "The company's international bank account number. Always upper-case with all spaces removed, formatted according to <a href=\"https://www.iso.org/obp/ui/#iso:std:iso:13616:-1:ed-2:v1:en\" target=\"_blank\" rel=\"noopener\">ISO-13616</a>."
          },
          "vatNumber": {
            "type": "string",
            "description": "The company's VAT identification number, already validated, with the country code embedded in the number itself. Always upper-case. Only European, US, and GB VAT numbers are supported — refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats, and <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a> for more on VAT identification numbers generally."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "The company's country of origin. Always upper-case, formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "The company's creation date, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Always empty on Add a company and Update a company — the server does not return the real creation timestamp in those responses. Populated with the actual value when retrieved via Retrieve a company or Retrieve all companies."
          },
          "metrics": {
            "type": "object",
            "description": "Not used by this operation — always returned null. Populated with aggregated processing statistics when <code>metrics=true</code> is passed on <a href=\"/docs/companies/retrieve-a-company#response-schema\">Retrieve a company</a> or <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Retrieve all companies</a>."
          }
        },
        "description": "The company as returned by the API."
      },
      "CompanyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CompanyOutput",
            "description": "The company that was added, retrieved, or updated."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated with pagination info on list operations; see <a href=\"/docs/companies/retrieve-all-companies#response-schema\">Meta</a>."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a single company."
      },
      "MetricsFileType": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The file type this breakdown covers. Currently always <code>SupplierInvoice</code> or <code>Receipt</code>."
          },
          "averageConformity": {
            "type": "number",
            "description": "Aggregated conformity score (%) for this file type, or null if there are no matching files."
          },
          "extractedCount": {
            "type": "integer",
            "description": "Number of files of this type that have been extracted. If a file was extracted as both a supplier invoice and a receipt, its most recent extraction determines which type it is counted under. Null if there are no matching files."
          },
          "bookedCount": {
            "type": "integer",
            "description": "Number of files of this type that have been booked but not extracted, or null if there are no matching files."
          },
          "extractedAndBookedCount": {
            "type": "integer",
            "description": "Number of files of this type that have been both extracted and booked, or null if there are no matching files."
          }
        },
        "description": "Processing statistics for a single file type."
      },
      "MetricsFile": {
        "type": "object",
        "properties": {
          "uploadedCount": {
            "type": "integer",
            "description": "Total number of files uploaded to this company, or null if there are no matching files."
          },
          "extractedCount": {
            "type": "integer",
            "description": "Total number of files extracted, including both receipts and supplier invoices, or null if there are no matching files."
          },
          "bookedCount": {
            "type": "integer",
            "description": "Total number of files that have been booked but never extracted, or null if there are no matching files."
          },
          "extractedAndBookedCount": {
            "type": "integer",
            "description": "Total number of files that have been both extracted and booked, or null if there are no matching files."
          },
          "extractedByBricksCount": {
            "type": "integer",
            "description": "Total number of files extracted by the \"BRICK\" models, or null if there are no matching files."
          },
          "averageConformity": {
            "type": "number",
            "description": "Aggregate conformity score (%) across all extracted files of any type, or null if there are no matching files."
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricsFileType"
            },
            "description": "Breakdown of the above counts by file type."
          }
        },
        "description": "File-processing statistics for the company."
      },
      "Metrics": {
        "type": "object",
        "properties": {
          "files": {
            "$ref": "#/components/schemas/MetricsFile",
            "description": "File-processing counts and their breakdown by file type."
          },
          "bricks": {
            "type": "object",
            "description": "Reserved for future use — currently always null."
          }
        },
        "description": "Aggregated processing statistics for the company. Only present when <code>metrics=true</code> was included in the request."
      },
      "CompanyDetailResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CompanyDetailOutput",
            "description": "The requested company."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "$ref": "#/components/schemas/CompanyMeta",
            "description": "Subscription and billing metadata for the company."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a single company, with optional aggregated metrics."
      },
      "CompanyMeta": {
        "type": "object",
        "properties": {
          "created": {
            "type": "string",
            "description": "When the company was added to the service, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "subscriptionStart": {
            "type": "string",
            "description": "When the company's current billing subscription began, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "lastActivated": {
            "type": "string",
            "description": "When the company was last activated, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "lastDeactivated": {
            "type": "string",
            "description": "When the company was last deactivated, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Empty if the company has never been deactivated."
          },
          "cycleLength": {
            "type": "string",
            "description": "The company's billing cycle length, encoded as a zero-padded 4-digit string. Values above 0099 represent whole months — divide by 100 to get the month count (e.g. <code>0100</code> = 1 month). Values 0099 and below represent days directly (e.g. <code>0030</code> = 30 days)."
          },
          "cycleEnd": {
            "type": "string",
            "description": "The end date of the company's current billing cycle, computed from <code>subscriptionStart</code> and <code>cycleLength</code>, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          },
          "lastDebited": {
            "type": "string",
            "description": "When the company was last debited, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Empty if the company has never been debited."
          },
          "debitable": {
            "type": "boolean",
            "description": "Whether the company is currently eligible to be billed."
          },
          "pagination": {
            "type": "object",
            "description": "Not used by this operation — always null."
          },
          "updated": {
            "type": "string",
            "description": "When the underlying data was last synced, in UTC, formatted as yyyy-MM-dd HH:mm:ss."
          }
        },
        "description": "Subscription and billing metadata for the company."
      },
      "CompanyDetailOutput": {
        "type": "object",
        "properties": {
          "companyID": {
            "type": "string",
            "description": "The company's unique identifier, exactly as it was assigned when the company was added. Unique within the service and formatted according to <a href=\"https://www.ietf.org/rfc/rfc1738.txt\" target=\"_blank\" rel=\"noopener\">RFC-1738</a>."
          },
          "companyName": {
            "type": "string",
            "description": "The company's display name, used to identify it in reports and when talking to technical support. Empty if none was provided when the company was added."
          },
          "companyProxy": {
            "type": "string",
            "description": "The accounting firm, parent company, or billing unit this company is grouped under, used to identify it in reports and when talking to technical support. Empty if the company was not added under a proxy."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the company is currently active or inactive in the service. The exact effect of this depends on your agreement."
          },
          "precognition": {
            "$ref": "#/components/schemas/PrecognitionItem",
            "description": "The company's precognition settings — see below."
          },
          "corporateIdentityNumber": {
            "type": "string",
            "description": "The company's corporate identity number, already validated. If <code>countryOfOrigin</code> is empty or set to the Swedish country code, this follows the Swedish format <code>nnnnnn-nnnn</code> — the API automatically inserts the separator dash if it was missing when the company was added. For any other <code>countryOfOrigin</code>, the number follows that country's official corporate-identifier format, per the EU Commission's specifications — see <a href=\"https://wikis.ec.europa.eu/spaces/UDBBIS/pages/90278474/Company+identifier+Machine+readable\" target=\"_blank\" rel=\"noopener\">Company identifier Machine readable</a> and the accompanying <a href=\"https://wikis.ec.europa.eu/pages/viewpageattachments.action?pageId=90278474&metadataLink=true&preview=/90278474/90278478/NTR_ID_07Feb23.xlsx\" target=\"_blank\" rel=\"noopener\">Excel sheet</a> (Swedish format details: <a href=\"https://www4.skatteverket.se/rattsligvagledning/edition/2021.8/326447.html\" target=\"_blank\" rel=\"noopener\">Skatteverket</a>). Also used internally to exclude a customer's own company when matching a supplier from the supplier list during an extraction on a supplier invoice."
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "The company's Swedish bank account (bankgiro) number. Only used when <code>countryOfOrigin</code> is either empty or set to the Swedish country code. Always includes the separator dash — the API inserts it automatically if it was missing when the company was added — in the format (n)nnn-nnnn. See <a href=\"https://www.bankgirot.se/\" target=\"_blank\" rel=\"noopener\">Bankgirot</a> for more information."
          },
          "plusGiroNumber": {
            "type": "string",
            "description": "The company's Swedish plusgiro number. Only used when <code>countryOfOrigin</code> is either empty or set to the Swedish country code. Always includes the separator dash — the API inserts it automatically if it was missing when the company was added — in the format (nnnnn)nn-n. See <a href=\"https://www.nordea.se/foretag/produkter/betala/transaktionskonto.html\" target=\"_blank\" rel=\"noopener\">Nordea</a> for more information."
          },
          "iban": {
            "type": "string",
            "description": "The company's international bank account number. Always upper-case with all spaces removed, formatted according to <a href=\"https://www.iso.org/obp/ui/#iso:std:iso:13616:-1:ed-2:v1:en\" target=\"_blank\" rel=\"noopener\">ISO-13616</a>."
          },
          "vatNumber": {
            "type": "string",
            "description": "The company's VAT identification number, already validated, with the country code embedded in the number itself. Always upper-case. Only European, US, and GB VAT numbers are supported — refer to <a href=\"https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf\" target=\"_blank\" rel=\"noopener\">this pdf</a> for the accepted formats, and <a href=\"https://taxation-customs.ec.europa.eu/taxation/vat/vat-businesses/vat-identification-numbers_en\" target=\"_blank\" rel=\"noopener\">here</a> for more on VAT identification numbers generally."
          },
          "countryOfOrigin": {
            "type": "string",
            "description": "The company's country of origin. Always upper-case, formatted according to <a href=\"https://www.iban.com/country-codes\" target=\"_blank\" rel=\"noopener\">ISO-3166-1 alpha-2</a>."
          },
          "createdDate": {
            "type": "string",
            "description": "The company's creation date, in UTC, formatted as yyyy-MM-dd HH:mm:ss. Always empty on Add a company and Update a company — the server does not return the real creation timestamp in those responses. Populated with the actual value when retrieved via Retrieve a company or Retrieve all companies."
          },
          "metrics": {
            "$ref": "#/components/schemas/Metrics",
            "description": "Aggregated processing statistics for the company. Only present (non-null) when <code>metrics=true</code> was included in the request — null otherwise."
          }
        },
        "description": "The company as returned by Retrieve a company or Retrieve all companies, including optional metrics."
      },
      "CompanyListData": {
        "type": "object",
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyDetailOutput"
            },
            "description": "The companies matching the request, one page at a time."
          }
        },
        "description": "A page of companies."
      },
      "CompanyListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "A success indication of the request (true/false)"
          },
          "data": {
            "$ref": "#/components/schemas/CompanyListData",
            "description": "The requested companies."
          },
          "extended": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on supplier-invoice extraction operations; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">SupplierInvoiceExtendedData</a>."
          },
          "meta": {
            "$ref": "#/components/schemas/Meta",
            "description": "Populated with pagination info and the last-synced timestamp only when both <code>pageNumber</code> and <code>pageSize</code> are supplied. Not used — always returned empty — otherwise."
          },
          "origin": {
            "type": "object",
            "description": "Not used by this operation — always returned empty. Populated on extraction operations with the model that generated the result; see <a href=\"/docs/supplier-invoices/extract-data-from-an-invoice#response-schema\">Origin</a>."
          },
          "time": {
            "type": "string",
            "description": "The exact time the response was created, in UTC, formatted as yyyy-MM-dd HH:mm:ss (e.g. 2020-10-26 11:35:54)."
          }
        },
        "description": "A response whose data is a page of companies."
      }
    },
    "securitySchemes": {
      "clientKeyHeader": {
        "type": "apiKey",
        "name": "Client-Key",
        "in": "header"
      },
      "subscriptionKeyHeader": {
        "type": "apiKey",
        "name": "Ocp-Apim-Subscription-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "clientKeyHeader": [],
      "subscriptionKeyHeader": []
    }
  ]
}