openapi: 3.0.3
info:
  version: 2.51.0
  title: Hypatos REST API
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: >
    # Introduction


    The Hypatos API is organized around REST. The majority of the endpoints
    provide CRUD 

    functionality for resources. The API is also exposing Intent Resources which
    mimic user intents 

    or actions.


    The Hypatos API uses [OAuth 2.0 Client Credential
    Grant](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) 

    to authenticate requests. Before making any requests to any endpoint a
    client must authenticate 

    with the authorization server and requests an access token from the [token
    endpoint](#operation/requestAccessToken). 


    ````sh
      POST /auth/token HTTP/1.1
      Host: api.cloud.hypatos.ai
      Content-Type: application/x-www-form-urlencoded
      Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

      grant_type=client_credentials
    ````


    `Authorization` header contains `client_id:client_secret` encoded as
    explained in [RFC Client Password
    section](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1).
         
    If the authorization server authenticated the client successfully, an access
    token is issued. 

    Here is an example successful response:


    ````sh
      HTTP/1.1 200 OK
      Content-Type: application/json;charset=UTF-8
      Cache-Control: no-store
      Pragma: no-cache

      {
        "access_token": "mF_9.B5f-4.1JqM",
        "expires_in": 86400,
        "scope": "enrichment.write files.read",
        "token_type": "Bearer",
      }
    ````

    This token can be used to authenticate the requests to API endpoints by
    sending a Bearer token 

    in the `Authorization` HTTP header. The following example demonstrates how
    to use the access token 

    to retrieve a list of documents.


    ````sh
      GET /v2/documents HTTP/1.1
      Host: api.cloud.hypatos.ai
      Authorization: Bearer mF_9.B5f-4.1JqM
    ````


    # Versioning


    Changes to this API are released regularly. We use [Semantic Versioning
    2.0.0](https://semver.org/spec/v2.0.0.html) 

    scheme for versioning so that the clients can identify any
    backward-incompatible changes 

    easily. Briefly summarized one can say, if the MAJOR version of the new API
    version didn't 

    change you can expect the new version to be backward-compatible.


    # Rate limits


    In order to maximise the stability of our API, we institue rate limits for
    all of API 

    endpoints. Clients who send too many requests over a given period of time
    will see error 

    responses that show up as status code [429 Too Many
    Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). 


    When you see error responses with status code 429, it means you exhausted
    your current 

    quota and need to withhold from sending further requests until the quota is
    reset. We 

    encourage you not to wait until you get a 429 error but to monitor your
    quota in each 

    request. In each response you receive from the API, you will find HTTP
    headers providing 

    the details about your current quota. Here is the list of the HTTP headers:


    * `x-ratelimit-limit`: Indicates the quota associated to the client in the 

    current time-window followed by the description of the quota policy.

    * `x-ratelimit-remaining`: Indicates the number of remaining requests in the
    current 

    time-window

    * `x-ratelimit-reset`: Indicates the number of seconds until quota reset of
    the current 

    time-window


    Please note that IETF is currently in the process of publishing a standard
    for these 

    headers. Please explore the
    [draft](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/) 

    for more details.


    A basic technique to gracefully handle rate limits is watch for your quota
    permanently 

    and increase the time between your request as the quota is decreasing. To
    recover from a 

    429 error you need a retry mechanism following an exponential backoff
    schedule.
servers:
  - description: API EU
    url: https://api.cloud.hypatos.ai/v2
  - description: API US
    url: https://api.cloud.hypatos.com/v2
tags:
  - name: Authorization
    description: >-
      Endpoints for handling the [OAuth 2.0 Client Credentials
      Grant](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) flow.
  - name: Files
    description: |
      Endpoints for management of files
  - name: Documents
    description: Endpoints for document management
  - name: Enrichment
    description: Endpoints for data enrichment
  - name: Companies
    description: Endpoints for company management
  - name: Projects
    description: Endpoints for project management
  - name: E-Invoices
    description: Endpoints for e-invoices
  - name: Documents XML
    description: Endpoints serving project-scoped documents as XML
paths:
  /auth/token:
    post:
      tags:
        - Authorization
      summary: Request an access token
      operationId: requestAccessToken
      description: Request an access token using your client credentials
      security:
        - Basic: []
      responses:
        '200':
          description: Access token provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokenResponse'
        '401':
          description: Invalid Client Credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: The provided client credentials are not valid
                status: 401
                title: Invalid client credentials
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccessTokenRequest'
        description: Access token request
  /files:
    post:
      summary: Upload a file
      operationId: uploadFile
      description: >
        This endpoint allows a client to upload a binary file. The `id` returned
        in the

        response represents the file in Hypatos systems. It can be used in other
        endpoints,

        for example to initiate processing of the file to create a document
        holding captured

        data, or to include the file in a case.
      x-codeSamples:
        - lang: curl
          label: curl
          source: |
            curl -i -X POST https://api.cloud.hypatos.ai/v2/files \
              -H "Authorization: Bearer <YOUR_TOKEN_HERE>" \
              -H "Content-Type: application/pdf" \
              -H "X-Hy-Filename: invoice.pdf" \
              --data-binary @/path/to/your/document.pdf
      tags:
        - Files
      security:
        - OAuth2:
            - files.write
      parameters:
        - in: header
          name: X-Hy-Filename
          description: >-
            Optional name of the file to be stored along with the content. If
            not provided, a filename will be generated.
          schema:
            type: string
            maxLength: 256
      requestBody:
        description: Payload of the file
        required: true
        content:
          application/pdf:
            schema:
              $ref: '#/components/schemas/BinaryFile'
          image/jpeg:
            schema:
              $ref: '#/components/schemas/BinaryFile'
          image/png:
            schema:
              $ref: '#/components/schemas/BinaryFile'
          image/tiff:
            schema:
              $ref: '#/components/schemas/BinaryFile'
          application/xml:
            schema:
              $ref: '#/components/schemas/BinaryFile'
      responses:
        '201':
          description: File uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '400':
          description: Content type is not supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: The provided content type is not supported
                status: 400
                title: Content type not supported
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /files/{id}:
    get:
      summary: Download a file by id
      operationId: retrieveFile
      description: |
        Download the content of a file with the given identifier.
      tags:
        - Files
      security:
        - OAuth2:
            - files.read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: File id to download.
      responses:
        '200':
          description: Binary content of a file
          headers:
            Content-Disposition:
              description: >
                Suggests a filename for the downloaded file. If a filename was
                provided

                during upload via the `X-Hy-Filename` request header, it will be
                used

                here. Otherwise a filename is generated from the file
                identifier.
              schema:
                type: string
                example: attachment; filename="invoice.pdf"
            X-Hy-Filename:
              description: >-
                If a filename was provided during the file upload via the
                `X-Hy-Filename` request header, it will be returned in this
                header.
              schema:
                type: string
          content:
            application/pdf:
              schema:
                $ref: '#/components/schemas/BinaryFile'
            image/jpeg:
              schema:
                $ref: '#/components/schemas/BinaryFile'
            image/png:
              schema:
                $ref: '#/components/schemas/BinaryFile'
            image/tiff:
              schema:
                $ref: '#/components/schemas/BinaryFile'
            application/xml:
              schema:
                $ref: '#/components/schemas/BinaryFile'
        '404':
          description: No file with given identifier exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: File with given identifier does not exist
                status: 404
                title: File not found
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents:
    get:
      summary: Retrieve a list of documents
      operationId: documentsList
      description: Retrieve a list of documents.
      security:
        - OAuth2:
            - documents.read
      tags:
        - Documents
      parameters:
        - $ref: '#/components/parameters/projectId'
        - $ref: '#/components/parameters/pagingOffset'
        - $ref: '#/components/parameters/parameters-pagingLimit'
        - $ref: '#/components/parameters/sortByCreatedAtUpdatedAt'
        - in: query
          name: state
          schema:
            type: array
            items:
              $ref: '#/components/schemas/DocumentState'
          style: form
          explode: true
          required: false
          description: >-
            Used to retrieve documents that are in specific states only.
            Multiple states can be used for this filtering. By default,
            documents in all states are returned.
        - in: query
          name: fileId
          schema:
            type: string
          required: false
          description: >-
            File identifier to retrieve documents that were created from that
            file
      responses:
        '200':
          description: List of documents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsListResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InvalidProjectId:
                  value:
                    detail: >-
                      One of the given project identifier provided as projectId
                      query parameter is invalid
                    status: 400
                    title: Provided project identifier is invalid
                OffsetOutOfRange:
                  value:
                    detail: The provided offset is out of range
                    status: 400
                    title: Offset out of range
                LimitOutOfRange:
                  value:
                    detail: Limit is out of range
                    status: 400
                    title: Limit out of range
                InvalidSortDefinition:
                  value:
                    detail: Limit is out of range
                    status: 400
                    title: Limit out of range
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/process-file:
    post:
      summary: Request processing of a file
      operationId: processFileIntoDocument
      description: >
        Request a processing of a file that was previously uploaded. 

        The `fileId` in the request body is representing the identifier of the
        file that was returned by the upload endpoint. 

        As a result of this request a document will be created and its
        identifier will be returned in the response.

        The `projectId` in the request body is an identifier of the project to
        create the document in.
      security:
        - OAuth2:
            - documents.write
      tags:
        - Documents
      requestBody:
        description: Payload for processing the given file
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessFileRequest'
      responses:
        '202':
          description: Processing accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessingAccepted'
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}:
    get:
      summary: Retrieve a document by id
      operationId: documentsGetById
      description: Retrieve a document by id
      security:
        - OAuth2:
            - documents.read
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document to get.
      responses:
        '200':
          description: Document retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/transfer:
    post:
      summary: Provide information about a transfer of a document to the target system
      operationId: documentsUpdateTransfer
      description: Update information about the transfer for the given document
      security:
        - OAuth2:
            - documents.write
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of of the document to update.
      requestBody:
        description: Payload about the transfer
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateTransferRequest'
            examples:
              success:
                summary: Transferred  successfully
                value:
                  successful: true
              failure:
                summary: Transfer  failed
                value:
                  successful: false
                  message: Upload failed due to ERP being down
      responses:
        '202':
          description: Document transfer infor accepted
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/reject:
    post:
      summary: >-
        Provide information about the rejection of a document in the target
        system
      operationId: documentsUpdateReject
      description: Update information about the rejection for the given document
      security:
        - OAuth2:
            - documents.write
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of of the document to update.
      requestBody:
        description: Payload about the rejection
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateRejectionRequest'
            examples:
              success:
                summary: Rejected  successfully
                value:
                  message: Document was rejected!
      responses:
        '202':
          description: Document rejection request accepted
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/external-data:
    post:
      summary: Provide external data for a document with given id
      operationId: documentUpdateExternalData
      description: >
        Update the external data for a document with given identifier. The
        external data are provided as a flat JSON object. The payload of this
        requests completley overrides the existing external data of a document.
        To remove the data, justsend empty JSON object `{}` in the payload.


        Please note that the maximum lenght of an key is 50 characters. Any
        value with a longer key will be omitted. The maximum amount of key-value
        pairs is limited to 20.
      tags:
        - Documents
      security:
        - OAuth2:
            - documents.write
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document to update.
      requestBody:
        description: Payload containing the external data.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateExternalDataRequest'
      responses:
        '202':
          description: External data provided for the document accepted.
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/external-id:
    post:
      summary: Provide an external identifier for a document with given id
      operationId: documentsUpdateExternalId
      description: Provide an external identifier for a document with given id
      security:
        - OAuth2:
            - documents.write
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document to update.
      requestBody:
        description: Update external id for a given document.
        required: true
        content:
          text/plain:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateExternalIdRequest'
      responses:
        '202':
          description: External ID provided for the document accepted.
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/title:
    post:
      summary: Provide a title for a document with given id
      operationId: documentsUpdateTitle
      description: Provide a title for a document with given id.
      security:
        - OAuth2:
            - documents.write
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document to update.
      requestBody:
        description: Title for a given document.
        required: true
        content:
          text/plain:
            schema:
              $ref: '#/components/schemas/DocumentsUpdateTitleRequest'
      responses:
        '202':
          description: Document title provided for the document accepted.
        '400':
          $ref: '#/components/responses/DocumentErrorResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /documents/{id}/states:
    get:
      summary: Retrieve Document States
      operationId: retrieveDocumentStates
      description: >-
        Provides a list of states that the specified document has passed
        through. If the document is still being processed, the number of
        returned states should not be considered final. Subsequent calls to this
        endpoint may return additional states as the document continues to
        progress through the processing pipeline.
      security:
        - OAuth2:
            - documents.read
      tags:
        - Documents
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document to get states of.
      responses:
        '200':
          description: Document states.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentStatesResponse'
        '404':
          $ref: '#/components/responses/DocumentErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/invoices:
    post:
      tags:
        - Enrichment
      summary: Insert invoice including invoice lines
      security:
        - OAuth2:
            - enrichment.write
      operationId: insertInvoice
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/invoice'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/invoices/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update invoice
      operationId: patchInvoice
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/invoice'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/invoice'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete invoice
      operationId: deleteInvoice
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
        - in: query
          name: lineNumber
          description: |
            Line number of one of the line numbers inside the Invoice.
            Optional, omitting means the whole Invoice is deleted.
          schema:
            type: string
          required: false
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/companies:
    post:
      tags:
        - Enrichment
      summary: Insert company
      operationId: insertCompany
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/company'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/companies/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update company
      operationId: patchCompany
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/company'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/company'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete company
      operationId: deleteCompany
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/suppliers:
    post:
      tags:
        - Enrichment
      summary: Insert supplier including related subsidiaries
      operationId: insertSupplier
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/supplier'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/suppliers/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update supplier
      operationId: patchSupplier
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/supplier'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/supplier'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete supplier
      operationId: deleteSupplier
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/purchase-orders:
    post:
      tags:
        - Enrichment
      summary: Insert purchase order including purchase order lines
      operationId: insertPurchaseOrder
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/purchaseOrder'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/purchase-orders/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update purchase order
      operationId: patchPurchaseOrder
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/purchaseOrder'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/purchaseOrder'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete purchase Order
      operationId: deletePurchaseOrder
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
        - in: query
          name: lineNumber
          description: |
            Line number of one of the line numbers inside the PO.
            Optional, omitting means the whole PO is deleted.
          schema:
            type: string
          required: false
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/gl-accounts:
    post:
      tags:
        - Enrichment
      summary: Insert general ledger account
      operationId: insertGLAccount
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/glAccount'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/gl-accounts/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update general ledger account
      operationId: patchGLAccount
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/glAccount'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/glAccount'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete general ledger account
      operationId: deleteGlAccount
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/cost-centers:
    post:
      tags:
        - Enrichment
      summary: Insert cost center
      operationId: insertCostCenter
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/costCenter'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/cost-centers/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update cost center
      operationId: patchCostCenter
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/costCenter'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/costCenter'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete cost Center
      operationId: deleteCostCenter
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/approvers:
    post:
      tags:
        - Enrichment
      summary: Insert approver
      operationId: insertApprover
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/approver'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/approvers/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update approver
      operationId: patchApprover
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/approver'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/approver'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete approver
      operationId: deleteApprover
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/customers:
    post:
      tags:
        - Enrichment
      summary: Insert customer
      operationId: insertCustomer
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/customers/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update customer
      operationId: patchCustomer
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/customer'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete customer
      operationId: deleteCustomer
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/lookup-tables/{type}:
    post:
      tags:
        - Enrichment
      summary: Insert data row to lookup table
      operationId: insertLookupTableRow
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: type
          description: type of data being sent
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/lookup-table-row'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/lookup-tables/{type}/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update data row in lookup table
      operationId: patchLookupTableRow
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: type
          description: type of data being updated
          schema:
            type: string
          required: true
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/lookup-table-row'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lookup-table-row'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete data row in lookup table
      operationId: deleteLookupTableRow
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: type
          description: type of data from which we should delete the row
          schema:
            type: string
          required: true
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/contracts:
    post:
      tags:
        - Enrichment
      summary: Insert contract
      operationId: insertContract
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contract'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/contracts/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update contract
      operationId: patchContract
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/contract'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contract'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete contract
      operationId: deleteContract
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/sales-orders:
    post:
      tags:
        - Enrichment
      summary: Insert sales order
      operationId: insertSalesOrder
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/salesOrder'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/sales-orders/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update sales order
      operationId: patchSalesOrder
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/salesOrder'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/salesOrder'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete sales order
      operationId: deleteSalesOrder
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/products:
    post:
      tags:
        - Enrichment
      summary: Insert product
      operationId: insertProduct
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/product'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/products/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update product
      operationId: patchProduct
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/product'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/product'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete product
      operationId: deleteProduct
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/addresses:
    post:
      tags:
        - Enrichment
      summary: Insert address
      operationId: insertAddress
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/address'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/addresses/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update address
      operationId: patchAddress
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/address'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/address'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete address
      operationId: deleteAddress
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/quotes:
    post:
      tags:
        - Enrichment
      summary: Insert quotes
      operationId: insertQuotes
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/quote'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/quotes/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update quote
      operationId: patchQuotes
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/quote'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/quote'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete quote
      operationId: deleteQuotes
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/goods-receipts:
    post:
      tags:
        - Enrichment
      summary: Insert Goods Receipt
      operationId: insertGoodsReceipts
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/goodsReceipt'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/goods-receipts/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update Goods Receipt
      operationId: patchGoodsReceipt
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/goodsReceipt'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/goodsReceipt'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete Goods Receipt
      operationId: deleteGoodsReceipt
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/profit-centers:
    post:
      tags:
        - Enrichment
      summary: Insert Profit Center
      operationId: insertProfitCenter
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/profitCenter'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/profit-centers/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update Profit Center
      operationId: patchProfitCenter
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/profitCenter'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/profitCenter'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete Profit Center
      operationId: deleteProfitCenter
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/internal-orders:
    post:
      tags:
        - Enrichment
      summary: Insert Internal Order
      operationId: insertInternalOrder
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internalOrder'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/internal-orders/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update Internal Order
      operationId: patchInternalOrder
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/internalOrder'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internalOrder'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete Internal Order
      operationId: deleteInternalOrder
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/projects:
    post:
      tags:
        - Enrichment
      summary: Insert Project
      operationId: insertProject
      security:
        - OAuth2:
            - enrichment.write
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/project'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/successfullyInserted'
        '422':
          $ref: '#/components/responses/validationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /enrichment/projects/{externalId}:
    patch:
      tags:
        - Enrichment
      summary: Partially update Project
      operationId: patchProject
      security:
        - OAuth2:
            - enrichment.write
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/project'
        required: true
      responses:
        '200':
          description: Successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/project'
        '400':
          $ref: '#/components/responses/validationError'
        '404':
          $ref: '#/components/responses/notFound'
        '415':
          $ref: '#/components/responses/unsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
    delete:
      tags:
        - Enrichment
      summary: Delete Project
      operationId: deleteProject
      security:
        - OAuth2:
            - enrichment.delete
      parameters:
        - in: path
          name: externalId
          description: Previously sent `externalId`
          schema:
            type: string
          required: true
      responses:
        '204':
          description: Successfully deleted
        '404':
          $ref: '#/components/responses/notFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /companies/{id}:
    get:
      tags:
        - Companies
      summary: Retrieve a company by id
      operationId: companiesGetById
      security:
        - OAuth2:
            - companies.read
      parameters:
        - required: true
          schema:
            $ref: '#/components/schemas/CompaniesId'
          name: id
          in: path
          description: Id of the company to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompaniesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Invalid company ID
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Company does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
  /companies:
    get:
      tags:
        - Companies
      summary: Retrieve a list of companies
      description: 'Note: For now pagination is not implemented'
      operationId: companiesList
      security:
        - OAuth2:
            - companies.read
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompaniesListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /projects:
    post:
      summary: Create a project
      operationId: projectsCreate
      description: Creates a project based on the request
      security:
        - OAuth2:
            - projects.write
      tags:
        - Projects
      requestBody:
        description: Project data
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCreateRequest'
      responses:
        '201':
          description: Project created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '400':
          $ref: '#/components/responses/ProjectClientBadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
        '422':
          $ref: '#/components/responses/ProjectRequestValidationErrorResponse'
    get:
      tags:
        - Projects
      summary: Retrieve a projects list for given search criteria
      operationId: projectsList
      parameters:
        - $ref: '#/components/parameters/pagingOffset'
        - $ref: '#/components/parameters/parameters-pagingLimit'
        - $ref: '#/components/parameters/sortByCreatedAt'
        - $ref: '#/components/parameters/isLive'
        - required: false
          schema:
            title: Search text used to find projects.
            type: string
            description: Search text is used against projects name and id
          name: search
          in: query
      responses:
        '200':
          description: Projects list retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectListResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '422':
          $ref: '#/components/responses/ProjectRequestValidationErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
      security:
        - OAuth2:
            - projects.read
  /projects/{id}:
    get:
      summary: Retrieve a project by id
      operationId: projectsGetById
      description: Retrieve a project by id
      security:
        - OAuth2:
            - projects.read
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectIdPathParameter'
      responses:
        '200':
          description: Project by id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
    patch:
      summary: Update a project
      operationId: projectsUpdate
      description: >
        Update a project by id. This endpoint supports partial updates using
        PATCH semantics:

        - Only fields present in the request will be updated

        - Null values will clear optional fields (note, retentionDays)

        - Absent fields will remain unchanged

        - Required fields (name, extractionModelId, ocr, completion, duplicates,
        isLive, members, schema) cannot be set to null

        - At least one field must be provided in the request
      security:
        - OAuth2:
            - projects.write
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectIdPathParameter'
      requestBody:
        description: Project update data (all fields optional for partial update)
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdateRequest'
      responses:
        '200':
          description: Project updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '400':
          $ref: '#/components/responses/ProjectClientBadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
        '422':
          $ref: '#/components/responses/ProjectRequestValidationErrorResponse'
  /projects/{id}/schema:
    get:
      summary: Retrieve a schema by project id
      operationId: schemasGetByProjectId
      description: Retrieve a schema by project id
      security:
        - OAuth2:
            - projects.read
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectIdPathParameter'
      responses:
        '200':
          description: Schema retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schema'
        '400':
          $ref: '#/components/responses/SchemaClientBadRequestErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
  /emails/{id}/content:
    get:
      tags:
        - Emails
      summary: Retrieve an email merged content for given document ID
      operationId: emailsContentGetByDocumentId
      parameters:
        - required: true
          schema:
            title: Document identifier
            type: string
          example: 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Emails information does not exists
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - emails.read
  /emails/{id}:
    get:
      tags:
        - Emails
      summary: Retrieve an email metadata for given document ID
      operationId: emailsMetadataGetByDocumentId
      parameters:
        - required: true
          schema:
            title: Document identifier
            type: string
          example: 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Emails information does not exists
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - emails.read
  /emails/{id}/eml:
    get:
      tags:
        - Emails
      summary: Retrieve an email eml content for given document ID
      operationId: emailsEmlGetByDocumentId
      parameters:
        - required: true
          schema:
            title: Document identifier
            type: string
          example: 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Emails information does not exists
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - emails.read
  /routings/{id}:
    get:
      tags:
        - Document Routing
      summary: Retrieve document routing with given id
      operationId: routingsGetById
      parameters:
        - required: true
          schema:
            type: string
            title: Routing identifier
            example: 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.read
    put:
      tags:
        - Document Routing
      summary: Update document routing
      operationId: routingsUpdate
      parameters:
        - required: true
          schema:
            type: string
            title: Routing identifier 6295dcd39db1ab740c3e296c
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRoutingRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.write
    delete:
      tags:
        - Document Routing
      summary: Delete document routing
      operationId: routingsDelete
      parameters:
        - required: true
          schema:
            type: string
            title: Routing identifier 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '204':
          description: Successful Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.write
  /routings:
    get:
      tags:
        - Document Routing
      summary: Retrieve document routings list
      operationId: routingsList
      parameters:
        - required: false
          schema:
            type: integer
            minimum: 0
            title: The limit used for this page of results.
            default: 20
          name: limit
          in: query
        - required: false
          schema:
            type: integer
            minimum: 0
            title: The offset used for this page of results.
            default: 0
          name: offset
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.read
    post:
      tags:
        - Document Routing
      summary: Create document routing
      operationId: routingsCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRoutingRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.write
  /routings/{id}/order:
    post:
      tags:
        - Document Routing
      summary: Change document routing order
      operationId: routingsOrder
      parameters:
        - required: true
          schema:
            type: string
            title: Routing identifier 6295dcd39db1ab740c3e296c
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutingOrderRequest'
        required: true
      responses:
        '204':
          description: Successful Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 400
                title: Routing project does not exists
                detail: Error details
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: Document routing does not exists
                detail: Error details
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 422
                title: Request validation error
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - routings.write
  /e-invoices/{id}/preview:
    get:
      summary: Retrieve a document PDF preview for e-invoices
      operationId: retrieveEInvoicesPreview
      description: Provides a binary file of a document PDF preview for e-invoices
      security:
        - OAuth2:
            - e-invoices.read
      tags:
        - E-Invoices
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          description: Id of the document.
      responses:
        '200':
          description: Binary content of a file
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                documentNotFound:
                  summary: Document does not exist
                  value:
                    detail: The document with given identifier does not exist
                    status: 404
                    title: Document does not exist
                previewNotFound:
                  summary: Document preview does not exist
                  value:
                    detail: The document preview with given identifier does not exist
                    status: 404
                    title: Document preview does not exist
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
  /users/{id}:
    get:
      tags:
        - Users
      summary: Retrieve user information by id
      operationId: usersGetById
      parameters:
        - required: true
          schema:
            title: User identifier
            type: string
          example: 6295dcd39db1ab740c3e296c
          name: id
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: User does not exists
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - users.read
  /users:
    get:
      tags:
        - Users
      summary: Retrieve a users list for given search criteria
      operationId: usersList
      parameters:
        - required: false
          schema:
            type: string
            title: Search text used to find users.
          name: search
          in: query
        - required: false
          schema:
            type: boolean
            title: Is active flag used to filter users.
          name: active
          in: query
        - required: false
          schema:
            items:
              $ref: '#/components/schemas/RoleName'
            type: array
            title: User roles used to filter on.
          name: roles
          in: query
        - required: false
          schema:
            type: integer
            title: The limit used for this page of results.
            minimum: 0
            default: 20
          name: limit
          in: query
        - required: false
          schema:
            type: integer
            minimum: 0
            title: The offset used for this page of results.
            default: 0
          name: offset
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 401
                title: Invalid token
                detail: Error details
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                title: Forbidden
                detail: Error details
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                title: User does not exists
                detail: Error details
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 500
                title: Internal Server Error
                detail: Error details
      security:
        - OAuth2:
            - users.read
  /document-xml/documents:
    get:
      tags:
        - Documents XML
      summary: List documents for a project as XML
      description: |
        Fetches the list of documents from Studio scoped to `projectId`, then
        applies the transformation rule tagged `{projectId}-list` to produce
        XML. If the rule has `addBinaryFile` enabled, binary attachments are
        inlined as base64.
      operationId: listDocumentsXml
      security:
        - OAuth2:
            - documents.read
      parameters:
        - $ref: '#/components/parameters/ProjectIdQuery'
        - name: state
          in: query
          required: false
          description: Filter by one or more document states (forwarded to Studio).
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
        - name: limit
          in: query
          required: false
          description: Maximum number of documents to return.
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: offset
          in: query
          required: false
          description: Number of documents to skip.
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: sort
          in: query
          required: false
          description: |
            Sort expressions forwarded to Studio (e.g. `createdAt,desc`).
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
      responses:
        '200':
          description: Transformed XML document list.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/DocumentsXml'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /document-xml/documents/{id}:
    get:
      tags:
        - Documents XML
      summary: Get a single document as XML
      description: |
        Fetches a document by id from Studio and applies the transformation
        rule tagged `{projectId}` to produce XML. If the rule has
        `addBinaryFile` enabled, the binary attachment is inlined as base64.
      operationId: getDocumentXml
      security:
        - OAuth2:
            - documents.read
      parameters:
        - name: id
          in: path
          required: true
          description: Studio document identifier.
          schema:
            type: string
        - $ref: '#/components/parameters/ProjectIdQuery'
      responses:
        '200':
          description: Transformed XML document.
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/DocumentXml'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    AccessTokenRequest:
      type: object
      required:
        - grant_type
      properties:
        grant_type:
          type: string
          enum:
            - client_credentials
    AccessTokenResponse:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
      properties:
        access_token:
          type: string
          description: The access token issued by the authorization server
          example: MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3
        expires_in:
          type: integer
          description: The lifetime of the access token in seconds
          example: 3600
        token_type:
          type: string
          enum:
            - Bearer
        scope:
          type: string
          description: Scopes allowed for the client
          example: documents.write projects.write
    BinaryFile:
      type: string
      format: binary
    UploadResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          example: 6040dc9680b782b365ea77d5
    DocumentsUpdateExternalDataRequest:
      type: object
      description: >-
        External data to be associated with the document. The data are provided
        as a flat JSON object. The properties of that object are
        case-insensitive. The maximum amount of properties is limited to 20.
      properties:
        key1:
          type: string
          example: value1
        key2:
          type: string
          example: value2
    DocumentsUpdateExternalIdRequest:
      type: string
      description: External ID
      example: 15b884b0-d551-4865-bda9-4168800c9d87
    DocumentsUpdateTitleRequest:
      type: string
      description: New Title
      example: New Title of Document
      maxLength: 256
    DocumentsUpdateTransferRequest:
      type: object
      required:
        - successful
      properties:
        successful:
          type: boolean
          description: Indicates if the transfer was successful or not
          example: true
        message:
          type: string
          description: >-
            May be used to provide additional details about the transfer.
            Especially in the erroneous case this field is valueable.
    DocumentsUpdateRejectionRequest:
      type: object
      properties:
        message:
          type: string
          description: May be used to provide additional details about the rejection.
    DocumentsListResponse:
      type: object
      required:
        - documents
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DocumentResponse'
        limit:
          type: integer
          description: >-
            The limit used for this page of results. This will be the same as
            the limit query parameter unless it exceeds the maximal allowed
            value.
          example: 20
        offset:
          type: integer
          description: >-
            The offset used for this page of results. This will be the same as
            the offset query parameter
          example: 0
        totalCount:
          type: integer
          description: The total number of elements in the data attribute
          example: 1000
    DocumentResponse:
      type: object
      required:
        - id
        - createdAt
        - createdBy
        - state
        - title
      properties:
        id:
          type: string
          example: 6040dc9680b782b365ea77d5
        completedAt:
          type: string
          format: date-time
          example: '1990-12-31T15:59:60-08:00'
        completedBy:
          type: string
        createdAt:
          type: string
          format: date-time
          example: '1990-12-31T15:59:60-08:00'
        createdBy:
          type: string
        fileId:
          type: string
          description: Identifier of the primary file associated with this document.
          example: 5349b4ddd2781d08c09890f4
        files:
          type: array
          description: >-
            List of files associated with this document, each with their
            assigned role and main file flag.
          items:
            $ref: '#/components/schemas/DocumentFile'
          example:
            - id: 5349b4ddd2781d08c09890f4
              type: salesOrder
              mainFile: true
        entities:
          type: object
          example:
            currency: EUR
            items:
              - name: High quality cement for rabbit hole sealing
                qty: 1
            number: 2018-DE-0011122351
            qty: 2
        externalId:
          type: string
          example: doc-0001
        externalData:
          type: object
          example:
            internalSystemId: sap-01
        projectId:
          type: string
          example: 6040dc9680b782b365ea77d5
        state:
          $ref: '#/components/schemas/DocumentState'
        title:
          type: string
          example: scan-doc-1.jpg
        updatedAt:
          type: string
          format: date-time
          example: '1990-12-31T15:59:60-08:00'
        updatedBy:
          type: string
        url:
          type: string
          example: https://example.com/documents/6040dc9680b782b365ea77d5
          description: URL to access the document
    DocumentFile:
      type: object
      required:
        - id
        - type
        - mainFile
      properties:
        id:
          type: string
          description: Identifier of the file as returned by the upload endpoint.
          example: 5349b4ddd2781d08c09890f4
        type:
          type: string
          description: >-
            The role the file plays in the document (e.g. salesOrder,
            attachment). Must only contain letters from the Latin alphabet with
            no whitespace or special characters.
          pattern: ^[a-zA-Z]+$
          example: salesOrder
        mainFile:
          type: boolean
          description: Indicates whether this file is the main file of the document.
          example: true
    DocumentState:
      type: string
      enum:
        - done
        - doneAutomatically
        - extracted
        - failed
        - inCompletion
        - junk
        - new
        - processing
        - rejected
        - reviewRequired
        - split
        - transferFailed
        - transferred
    DocumentStatesResponse:
      type: array
      items:
        type: object
        properties:
          state:
            $ref: '#/components/schemas/DocumentState'
          updatedAt:
            type: string
            format: date-time
            example: '1990-12-31T15:59:60-08:00'
    ProcessFileRequest:
      type: object
      required:
        - fileId
        - projectId
      properties:
        fileId:
          type: string
          example: 5349b4ddd2781d08c09890f4
        projectId:
          type: string
          example: 00000020f51bb4362eee2a4d
        externalId:
          type: string
          description: >-
            External id of the file. Can be used if you want to link the file
            with an identifier in your system.
          example: doc-0001
        externalData:
          $ref: '#/components/schemas/DocumentsUpdateExternalDataRequest'
    ProcessingAccepted:
      type: object
      required:
        - documentId
        - fileId
        - projectId
      properties:
        documentId:
          type: string
          example: 6040dc9680b782b365ea77d5
        fileId:
          type: string
          example: 5349b4ddd2781d08c09890f4
        projectId:
          type: string
          example: 00000020f51bb4362eee2a4d
    validationError:
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          type: array
          items:
            type: string
        msg:
          type: string
        type:
          type: string
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/validationError'
    Problem:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: >
            A URI reference that uniquely identifies the problem type only in
            the context of the provided API. Opposed to the specification in
            RFC-7807, it is neither recommended to be dereferenceable and point
            to a human-readable documentation nor globally unique for the
            problem type.
          default: about:blank
          example: /some/uri-reference
        title:
          type: string
          description: >
            A short summary of the problem type. Written in English and readable
            for engineers, usually not suited for non technical stakeholders and
            not localized.
          example: some title for the error situation
        status:
          type: integer
          format: int32
          description: >
            The HTTP status code generated by the origin server for this
            occurrence of the problem.
          minimum: 100
          maximum: 599
        detail:
          type: string
          description: >
            A human readable explanation specific to this occurrence of the
            problem that is helpful to locate the problem and give advice on how
            to proceed. Written in English and readable for engineers, usually
            not suited for non technical stakeholders and not localized.
          example: some description for the error situation
        instance:
          type: string
          format: uri-reference
          description: >
            A URI reference that identifies the specific occurrence of the
            problem, e.g. by adding a fragment identifier or sub-path to the
            problem type. May be used to locate the root of this problem in the
            source code.
          example: /some/uri-reference#specific-occurrence-context
    CompaniesId:
      title: CompaniesId
      type: string
      example: 63e6663823b4c1f5287398bb
    CompaniesListResponse:
      title: CompaniesListResponse
      required:
        - data
        - limit
        - offset
        - totalCount
      type: object
      properties:
        data:
          title: Companies list
          type: array
          items:
            $ref: '#/components/schemas/CompaniesResponse'
        limit:
          title: >-
            The limit used for this page of results. This will be the same as
            the limit query parameter unless it exceeds the maximal allowed
            value.
          type: integer
          example: 20
        offset:
          title: >-
            The offset used for this page of results. This will be the same as
            the offset query parameter.
          type: integer
          example: 0
        totalCount:
          title: The total number of elements of the data attribute.
          type: integer
          example: 1000
    CompaniesResponse:
      title: CompaniesResponse
      required:
        - name
        - id
        - active
        - createdAt
      type: object
      properties:
        name:
          title: Companies display name
          type: string
          example: Companies Name Inc.
        id:
          title: Companies identifier
          type: string
          example: 63e6663823b4c1f5287398bb
        active:
          title: Companies activity flag
          type: boolean
          example: true
        createdAt:
          title: Companies creation date
          type: string
          example: '1990-12-31T15:46:19.384990Z'
    ProjectResponse:
      type: object
      description: Project response
      required:
        - id
        - name
        - ocr
        - extractionModelId
        - createdAt
        - createdBy
        - updatedAt
        - updatedBy
        - completion
        - duplicates
        - members
        - isLive
      properties:
        id:
          $ref: '#/components/schemas/ProjectId'
        createdAt:
          type: string
          format: date-time
          example: '1990-12-31T15:46:19.384990Z'
        createdBy:
          $ref: '#/components/schemas/ProjectMemberId'
        updatedAt:
          type: string
          format: date-time
          example: '1990-12-31T15:46:19.384990Z'
        updatedBy:
          $ref: '#/components/schemas/ProjectMemberId'
        name:
          $ref: '#/components/schemas/ProjectName'
        note:
          $ref: '#/components/schemas/ProjectNote'
        extractionModelId:
          $ref: '#/components/schemas/ProjectExtractionModelId'
        ocr:
          oneOf:
            - $ref: '#/components/schemas/ProjectOCRAbbyy'
            - $ref: '#/components/schemas/ProjectOCRGoogle'
          discriminator:
            propertyName: engine
            mapping:
              abbyy: '#/components/schemas/ProjectOCRAbbyy'
              google: '#/components/schemas/ProjectOCRGoogle'
        completion:
          $ref: '#/components/schemas/ProjectCompletion'
        duplicates:
          $ref: '#/components/schemas/ProjectDuplicates'
        members:
          oneOf:
            - $ref: '#/components/schemas/ProjectAllMembers'
            - $ref: '#/components/schemas/ProjectMembers'
          discriminator:
            propertyName: allow
            mapping:
              all: '#/components/schemas/ProjectAllMembers'
              members: '#/components/schemas/ProjectMembers'
        retentionDays:
          $ref: '#/components/schemas/ProjectRetentionDays'
        isLive:
          $ref: '#/components/schemas/ProjectIsLive'
    ProjectId:
      title: ProjectId
      description: Project ID
      type: string
      example: 63e6663823b4c1f5287398bb
    ProjectName:
      description: Project name
      type: string
      example: My Project
      minLength: 1
      maxLength: 60
    ProjectNote:
      description: Project note
      type: string
      example: My project description note
      minLength: 1
      maxLength: 1000
    ProjectExtractionModelId:
      title: ProjectExtractionModelId
      description: Extraction Model id
      type: string
      example: 63e6663823b4c1f5287398bb
    ProjectOCRAbbyy:
      type: object
      description: Abbyy OCR configuration
      required:
        - engine
        - features
        - languages
      properties:
        engine:
          type: string
          enum:
            - abbyy
        features:
          type: array
          items:
            $ref: '#/components/schemas/ProjectOCRAbbyyFeatures'
        languages:
          $ref: '#/components/schemas/ProjectOCRAbbyyLanguages'
    ProjectOCRAbbyyFeatures:
      type: string
      enum:
        - barcodes
    ProjectOCRAbbyyLanguages:
      type: array
      description: Array of abbyy ocr languages used within a project
      maxItems: 5
      minItems: 1
      items:
        $ref: '#/components/schemas/ProjectOCRAbbyyLanguage'
      example:
        - German
        - English
    ProjectOCRAbbyyLanguage:
      type: string
      description: Abbyy ocr supported languages
      enum:
        - Arabic
        - ArmenianEastern
        - ArmenianGrabar
        - ArmenianWestern
        - Bulgarian
        - Catalan
        - ChinesePRC
        - ChineseTaiwan
        - Croatian
        - Czech
        - Danish
        - Dutch
        - DutchBelgian
        - English
        - Estonian
        - Farsi
        - Finnish
        - French
        - German
        - Greek
        - Hebrew
        - Hungarian
        - Icelandic
        - Indonesian
        - Irish
        - Italian
        - Japanese
        - Korean
        - KoreanHangul
        - Latin
        - Latvian
        - Lithuanian
        - Macedonian
        - Malay
        - Mongol
        - Norwegian
        - Polish
        - PortugueseBrazilian
        - PortugueseStandard
        - Romanian
        - Russian
        - SerbianCyrillic
        - SerbianLatin
        - Slovenian
        - Spanish
        - Swedish
        - Thai
        - Turkish
        - UighurCyrillic
        - UighurLatin
        - Ukrainian
        - Vietnamese
        - Welsh
    ProjectOCRGoogle:
      type: object
      description: Google OCR configuration
      required:
        - engine
        - features
      properties:
        engine:
          type: string
          enum:
            - google
        features:
          type: array
          items:
            $ref: '#/components/schemas/ProjectOCRGoogleFeatures'
    ProjectOCRGoogleFeatures:
      type: string
      enum:
        - barcodes
        - disableBoxFilter
        - plainText
    ProjectCompletion:
      type: string
      description: |
        ProjectCompletion type
        * `automatic` - Mark documents as completed after succesfull validation
        * `manual` - Mark documents to review after succesfull validation
      enum:
        - automatic
        - manual
      example: manual
      default: manual
    ProjectDuplicates:
      type: string
      description: |
        How duplicates documents show be handle
        * `allow` - Allow documents duplicates to be processed
        * `fail` - Mark documents duplicates as failed
      enum:
        - allow
        - fail
      example: allow
      default: fail
    ProjectAllMembers:
      title: ProjectAllMembers
      description: Allow all users to access a project
      type: object
      properties:
        allow:
          type: string
          enum:
            - all
    ProjectMembers:
      title: ProjectMembers
      description: Allow provided members to access project
      type: object
      properties:
        allow:
          type: string
          enum:
            - members
        members:
          type: array
          items:
            $ref: '#/components/schemas/ProjectMemberId'
    ProjectMemberId:
      description: Project member id
      type: string
      example: 63e6663823b4c1f5287398bb
    ProjectRetentionDays:
      description: Project document retention in days
      type: integer
      example: 180
      minimum: 1
      maximum: 3650
    ProjectIsLive:
      description: Indicates if a project is live or not
      type: boolean
      default: false
    ProjectCreateRequest:
      type: object
      required:
        - name
        - ocr
        - extractionModelId
        - members
      properties:
        name:
          $ref: '#/components/schemas/ProjectName'
        note:
          $ref: '#/components/schemas/ProjectNote'
        ocr:
          oneOf:
            - $ref: '#/components/schemas/ProjectOCRAbbyy'
            - $ref: '#/components/schemas/ProjectOCRGoogle'
          discriminator:
            propertyName: engine
            mapping:
              abbyy: '#/components/schemas/ProjectOCRAbbyy'
              google: '#/components/schemas/ProjectOCRGoogle'
        extractionModelId:
          $ref: '#/components/schemas/ProjectExtractionModelId'
        completion:
          $ref: '#/components/schemas/ProjectCompletion'
        duplicates:
          $ref: '#/components/schemas/ProjectDuplicates'
        members:
          oneOf:
            - $ref: '#/components/schemas/ProjectAllMembers'
            - $ref: '#/components/schemas/ProjectMembers'
          discriminator:
            propertyName: allow
            mapping:
              all: '#/components/schemas/ProjectAllMembers'
              members: '#/components/schemas/ProjectMembers'
        schema:
          $ref: '#/components/schemas/Schema'
        retentionDays:
          allOf:
            - $ref: '#/components/schemas/ProjectRetentionDays'
            - default: 180
        isLive:
          $ref: '#/components/schemas/ProjectIsLive'
    ProjectUpdateRequest:
      type: object
      description: >
        Request for partial project update (PATCH). All fields are optional.

        - Fields not included in the request will remain unchanged

        - Fields explicitly set to null will clear the value (only for optional
        fields: note, retentionDays)

        - Required fields (name, extractionModelId, ocr, completion, duplicates,
        isLive, members, schema) cannot be set to null

        - At least one field must be provided
      properties:
        name:
          $ref: '#/components/schemas/ProjectName'
        note:
          allOf:
            - $ref: '#/components/schemas/ProjectNote'
        ocr:
          oneOf:
            - $ref: '#/components/schemas/ProjectOCRAbbyy'
            - $ref: '#/components/schemas/ProjectOCRGoogle'
          discriminator:
            propertyName: engine
            mapping:
              abbyy: '#/components/schemas/ProjectOCRAbbyy'
              google: '#/components/schemas/ProjectOCRGoogle'
        extractionModelId:
          $ref: '#/components/schemas/ProjectExtractionModelId'
        completion:
          $ref: '#/components/schemas/ProjectCompletion'
        duplicates:
          $ref: '#/components/schemas/ProjectDuplicates'
        retentionDays:
          allOf:
            - $ref: '#/components/schemas/ProjectRetentionDays'
        isLive:
          $ref: '#/components/schemas/ProjectIsLive'
        members:
          oneOf:
            - $ref: '#/components/schemas/ProjectAllMembers'
            - $ref: '#/components/schemas/ProjectMembers'
          discriminator:
            propertyName: allow
            mapping:
              all: '#/components/schemas/ProjectAllMembers'
              members: '#/components/schemas/ProjectMembers'
        schema:
          $ref: '#/components/schemas/Schema'
    ProjectListResponse:
      title: ProjectListResponse
      required:
        - data
        - totalCount
        - limit
        - offset
      type: object
      properties:
        data:
          title: Data
          type: array
          items:
            $ref: '#/components/schemas/ProjectResponse'
        limit:
          title: limit
          type: integer
          example: 20
        offset:
          title: offset
          type: integer
          example: 0
        totalCount:
          title: Totalcount
          type: integer
          example: 1
    Schema:
      title: Schema
      type: object
      properties:
        version:
          title: Version
          type: integer
          example: 1
        dataPoints:
          title: DataPoints
          type: array
          items:
            type: object
            properties:
              internalName:
                type: string
              displayName:
                type: string
              type:
                type: string
              normalization:
                type: array
                items:
                  type: object
              rules:
                type: object
          example:
            - internalName: type
              displayName: Type
              type: string
              source:
                type: extractor
              normalization: []
              rules: {}
            - internalName: number
              displayName: Number
              type: string
              source:
                type: extractor
              normalization: []
              rules: {}
            - internalName: issuedAt
              displayName: Issued At
              type: date
              preferDayOfMonth: last
              source:
                type: extractor
              normalization: []
              rules: {}
            - internalName: deliveredAt
              displayName: Delivered At
              type: date
              preferDayOfMonth: last
              source:
                type: extractor
              normalization: []
              rules: {}
            - internalName: currency
              displayName: Currency
              type: string
              source:
                type: extractor
              normalization: []
              rules: {}
        features:
          type: object
          properties:
            derivation:
              type: boolean
              example: false
        enrichment:
          type: object
        normalization:
          type: object
        validation:
          type: object
    EmailResponse:
      properties:
        id:
          type: string
          title: Document id
          example: 6040dc9680b782b365ea77d5
        senderAddresses:
          items:
            type: string
          type: array
          title: Email sender adresses
          example:
            - no-replay@hypatos.com
            - joe.doe@example.com
        subject:
          type: string
          title: Email subject
          example: Document from this month
      type: object
      required:
        - id
        - senderAddresses
      title: EmailResponse
    ConditionEdgesEvaluation:
      properties:
        type:
          type: string
          enum:
            - conditionalEdges
          title: Type
          default: conditionalEdges
        condition:
          $ref: '#/components/schemas/ConditionType'
      type: object
      required:
        - condition
      title: ConditionEdgesEvaluation
    ConditionType:
      type: string
      enum:
        - or
        - and
      title: ConditionType
      description: An enumeration.
    RoutingAction:
      oneOf:
        - $ref: '#/components/schemas/RoutingMoveAction'
        - $ref: '#/components/schemas/RoutingCopyAction'
      discriminator:
        propertyName: type
        mapping:
          move: '#/components/schemas/RoutingMoveAction'
          copy: '#/components/schemas/RoutingCopyAction'
      title: RoutingAction
    PostMoveAction:
      type: string
      enum:
        - none
        - refresh
        - reprocess
      title: PostMoveAction
      default: reprocess
      description: >-
        Defines the action to be executed for the document in the target
        project.
    PostCopyAction:
      type: string
      enum:
        - none
        - reprocess
        - resetState
      title: PostCopyAction
      default: reprocess
      description: >-
        Defines the action to be executed for the document in the target
        project.
    RoutingMoveAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - move
          default: move
          title: Type
        postMoveAction:
          $ref: '#/components/schemas/PostMoveAction'
      required:
        - type
        - postMoveAction
      title: RoutingMoveAction
      example:
        type: move
        postMoveAction: reprocess
    RoutingCopyAction:
      type: object
      properties:
        type:
          type: string
          enum:
            - copy
          default: copy
          title: Type
        postCopyAction:
          $ref: '#/components/schemas/PostCopyAction'
      required:
        - type
        - postCopyAction
      title: RoutingCopyAction
    RoutingRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Routing name
          example: Document routing name
        fromProjectId:
          type: string
          title: Identifier of a project where routings evaluation will happen
          example: 63e6663823b4c1f5287398bb
        toProjectId:
          type: string
          title: >-
            Identifier of a project where documents will be moved to if routings
            evaluation passes
          example: 63e6663823b4c1f5287398bb
        postRoutingAction:
          allOf:
            - $ref: '#/components/schemas/PostRoutingAction'
          title: Action done after document is routed
          default: reprocess
          description: Deprecated, use `routingAction` instead
        active:
          type: boolean
          title: Only active routings will be evaluated
          example: true
        routingNode:
          allOf:
            - $ref: '#/components/schemas/RoutingNode'
          title: Routing node evaluation definition
        routingAction:
          $ref: '#/components/schemas/RoutingAction'
      required:
        - name
        - fromProjectId
        - toProjectId
        - active
        - routingNode
        - routingAction
    CreateRoutingRequest:
      allOf:
        - $ref: '#/components/schemas/RoutingRequest'
        - type: object
          properties:
            createdBy:
              type: string
              title: Routing creator
              example: 671f771235cd520084dd655f
      title: CreateRoutingRequest
    UpdateRoutingRequest:
      allOf:
        - $ref: '#/components/schemas/RoutingRequest'
        - type: object
          properties:
            modifiedBy:
              type: string
              title: Routing modifier
              example: 671f771235cd520084dd655f
      title: UpdateRoutingRequest
    DocumentEvaluation:
      properties:
        type:
          type: string
          enum:
            - document
          title: Type
          default: document
        operator:
          $ref: '#/components/schemas/EvaluationOperator'
        evaluateWithValue:
          title: Evaluatewithvalue
          type: string
        evaluateIfMissing:
          type: boolean
          title: Evaluateifmissing
        documentPath:
          type: array
          items:
            $ref: '#/components/schemas/Path'
      type: object
      required:
        - operator
        - documentPath
      title: DocumentEvaluation
    EvaluationOperator:
      type: string
      enum:
        - contains
        - equal
        - notEqual
        - '=='
        - '!='
        - '>'
        - '>='
        - <
        - <=
      title: EvaluationOperator
      description: >-
        Evaluation operators. >, >=, <, <= are used only for numbers. ==/equal,
        !=/notEqual means same, consider equal/notEqual words as deprecated.
    OrderDirection:
      type: string
      enum:
        - up
        - down
      title: OrderDirection
      description: An enumeration.
    PostRoutingAction:
      type: string
      enum:
        - none
        - refresh
        - reprocess
      title: PostRoutingAction
      description: >-
        Defines the action to be executed for the routed document in the target
        project.
    RoutingListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/RoutingResponse'
          type: array
          title: Data
        totalCount:
          type: integer
          title: Totalcount
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
        - data
        - totalCount
        - limit
        - offset
      title: RoutingListResponse
    RoutingNode:
      properties:
        evaluation:
          anyOf:
            - $ref: '#/components/schemas/SchemaEvaluation'
            - $ref: '#/components/schemas/ConditionEdgesEvaluation'
            - $ref: '#/components/schemas/DocumentEvaluation'
          title: Evaluation
        edges:
          items:
            $ref: '#/components/schemas/RoutingNode'
          type: array
          title: Edges
          example: []
      type: object
      required:
        - evaluation
      title: RoutingNode
    RoutingOrderRequest:
      properties:
        direction:
          allOf:
            - $ref: '#/components/schemas/OrderDirection'
          title: Moving order direction
          example: down
        count:
          type: integer
          title: Moving order count in given direction
          example: 2
      type: object
      required:
        - direction
        - count
      title: RoutingOrderRequest
    RoutingResponse:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Routing name
          example: Document routing name
        fromProjectId:
          type: string
          title: Identifier of a project where routings evaluation will happen
          example: 263e6663823b4c1f5287398bb
        toProjectId:
          type: string
          title: >-
            Identifier of a project where documents will be moved to if routings
            evaluation passes
          example: 263e6663823b4c1f5287398bb
        postRoutingAction:
          allOf:
            - $ref: '#/components/schemas/PostRoutingAction'
          title: Action done after document is routed
          default: reprocess
          example: reprocess
        active:
          type: boolean
          title: Only active routings will be evaluated
          example: true
        routingNode:
          allOf:
            - $ref: '#/components/schemas/RoutingNode'
          title: Routing node evaluation definition
        id:
          type: string
          title: Routing identifier
          example: 63e6663823b4c1f5287398bb
        modifiedAt:
          type: string
          title: Routing last modification date
          example: '2023-02-10T15:46:19.384990Z'
        modifiedBy:
          type: string
          title: Routing last modification by
          example: 671f771235cd520084dd655f
        createdBy:
          type: string
          title: Routing last creation by
          example: 671f771235cd520084dd655f
        createdAt:
          type: string
          title: Routing last creation date
          example: '2023-02-10T15:46:19.384990Z'
        order:
          type: integer
          title: Routing order
          example: 0
        routingAction:
          $ref: '#/components/schemas/RoutingAction'
      type: object
      required:
        - name
        - fromProjectId
        - toProjectId
        - active
        - routingNode
        - id
        - order
        - routingAction
      title: RoutingResponse
    SchemaEvaluation:
      properties:
        type:
          type: string
          enum:
            - schema
          title: Type
          default: schema
        operator:
          $ref: '#/components/schemas/EvaluationOperator'
        evaluateWithValue:
          title: Evaluatewithvalue
          type: string
        evaluateIfMissing:
          type: boolean
          title: Evaluateifmissing
        dataPointPath:
          type: array
          items:
            $ref: '#/components/schemas/Path'
      type: object
      required:
        - operator
        - dataPointPath
      title: SchemaEvaluation
    Path:
      type: string
      title: Path
      description: Path location.
    CompanyAccess:
      title: CompanyAccess
      required:
        - companyId
        - companyName
        - active
        - createdAt
        - roles
      type: object
      properties:
        companyId:
          title: User identifier
          type: string
          example: 660572bc7a3cd6803f112252
        companyName:
          title: Company name
          type: string
          example: Company Inc.
        active:
          title: If user is active for particular company
          type: boolean
          example: true
        createdAt:
          title: User membership creation date
          type: string
          example: '2023-03-28T15:46:19.384990Z'
        roles:
          title: User roles in particular company
          type: array
          items:
            $ref: '#/components/schemas/RoleName'
          example:
            - clerk
    RoleName:
      title: RoleName
      enum:
        - installationAdmin
        - installationClerk
        - admin
        - clerk
        - manager
        - supportSpecialist
      type: string
      description: User role for particular company.
    UserListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/UserResponse'
          type: array
          title: Data
        totalCount:
          type: integer
          title: Totalcount
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
        - data
        - totalCount
        - limit
        - offset
      title: UserListResponse
    UserResponse:
      title: UserResponse
      required:
        - id
        - email
        - name
        - companiesAccess
        - active
        - isInternal
      type: object
      properties:
        id:
          title: User identifier
          type: string
          example: 660572bc7a3cd6803f112252
        email:
          title: User email
          type: string
          example: firstname.lastname@company.inc
        name:
          title: User display name
          type: string
          example: Firstname Lastname
        companiesAccess:
          title: User companies memberships
          type: array
          items:
            $ref: '#/components/schemas/CompanyAccess'
        active:
          title: If user is active
          type: boolean
          example: true
        isInternal:
          title: If user is considered internal Hypatos one
          type: boolean
          example: false
    DocumentsXml:
      type: string
      format: xml
      description: |
        XML document produced by applying the project-specific list
        transformation (XSLT) to the Studio response. The concrete element
        structure is defined per project.
      example: |
        <documents>
          <document id="..."/>
        </documents>
    DocumentXml:
      type: string
      format: xml
      description: |
        XML document produced by applying the project-specific single-document
        transformation (XSLT) to the Studio response. May include inlined
        base64 attachments when the rule has `addBinaryFile` enabled.
      example: |
        <document id="...">
          <attachment contentType="application/pdf">BASE64...</attachment>
        </document>
    GenericError:
      type: object
      description: Error envelope returned by the API.
      required:
        - status
        - title
        - detail
      properties:
        status:
          type: integer
          format: int32
          description: HTTP status code.
          example: 400
        title:
          type: string
          description: Short, human-readable summary of the error.
          example: Incorrect input
        detail:
          type: string
          description: Human-readable explanation specific to this occurrence.
          example: Required request parameter 'projectId' is not present.
        errorAt:
          type: string
          format: date-time
          description: Timestamp at which the error was produced.
    ValidationError:
      allOf:
        - $ref: '#/components/schemas/GenericError'
        - type: object
          properties:
            hypatosErrorMetaInfo:
              $ref: '#/components/schemas/ValidationErrorMetaInfo'
    ValidationErrorMetaInfo:
      type: object
      properties:
        invalidFields:
          type: array
          items:
            $ref: '#/components/schemas/ErrorField'
    ErrorField:
      type: object
      required:
        - status
        - title
        - detail
        - fieldName
      properties:
        status:
          type: integer
          format: int32
        title:
          type: string
        detail:
          type: string
        fieldName:
          type: string
          description: Name of the field that failed validation.
    Error:
      required:
        - detail
        - status
        - title
      properties:
        detail:
          type: string
          description: A human readable explanation of the error.
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 100
          maximum: 599
        title:
          type: string
          description: A short summary of the error
    document:
      type: object
      description: Reference to document uploaded to Hypatos Studio
      properties:
        id:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: 63cac12c37bb02accb396cae
          pattern: ^[0-9a-fA-F]{24}$
        type:
          type: string
          description: Document type that was assigned during upload to Hypatos
          example: invoice
          pattern: ^\S+$
    CurrencyCode:
      type: string
      nullable: true
      description: Three letter currency code as defined in ISO 4217
      example: EUR
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BOV
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHE
        - CHF
        - CHW
        - CLF
        - CLP
        - CNY
        - COP
        - COU
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MXV
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - USN
        - UYI
        - UYU
        - UYW
        - UZS
        - VED
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XAG
        - XAU
        - XBA
        - XBB
        - XBC
        - XBD
        - XCD
        - XDR
        - XOF
        - XPD
        - XPF
        - XPT
        - XSU
        - XTS
        - XUA
        - XXX
        - YER
        - ZAR
        - ZMW
        - ZWL
        - null
    LanguageCode:
      type: string
      nullable: true
      description: Two letter language code as defined in ISO 639-1
      example: en
      enum:
        - aa
        - ab
        - ae
        - af
        - ak
        - am
        - an
        - ar
        - as
        - av
        - ay
        - az
        - ba
        - be
        - bg
        - bh
        - bi
        - bm
        - bn
        - bo
        - br
        - bs
        - ca
        - ce
        - ch
        - co
        - cr
        - cs
        - cu
        - cv
        - cy
        - da
        - de
        - dv
        - dz
        - ee
        - el
        - en
        - eo
        - es
        - et
        - eu
        - fa
        - ff
        - fi
        - fj
        - fo
        - fr
        - fy
        - ga
        - gd
        - gl
        - gn
        - gu
        - gv
        - ha
        - he
        - hi
        - ho
        - hr
        - ht
        - hu
        - hy
        - hz
        - ia
        - id
        - ie
        - ig
        - ii
        - ik
        - io
        - is
        - it
        - iu
        - ja
        - jv
        - ka
        - kg
        - ki
        - kj
        - kk
        - kl
        - km
        - kn
        - ko
        - kr
        - ks
        - ku
        - kv
        - kw
        - ky
        - la
        - lb
        - lg
        - li
        - ln
        - lo
        - lt
        - lu
        - lv
        - mg
        - mh
        - mi
        - mk
        - ml
        - mn
        - mr
        - ms
        - mt
        - my
        - na
        - nb
        - nd
        - ne
        - ng
        - nl
        - nn
        - 'no'
        - nr
        - nv
        - ny
        - oc
        - oj
        - om
        - or
        - os
        - pa
        - pi
        - pl
        - ps
        - pt
        - qu
        - rm
        - rn
        - ro
        - ru
        - rw
        - sa
        - sc
        - sd
        - se
        - sg
        - si
        - sk
        - sl
        - sm
        - sn
        - so
        - sq
        - sr
        - ss
        - st
        - su
        - sv
        - sw
        - ta
        - te
        - tg
        - th
        - ti
        - tk
        - tl
        - tn
        - to
        - tr
        - ts
        - tt
        - tw
        - ty
        - ug
        - uk
        - ur
        - uz
        - ve
        - vi
        - vo
        - wa
        - wo
        - xh
        - yi
        - yo
        - za
        - zh
        - zu
        - null
    languagedText:
      type: object
      properties:
        text:
          type: string
          description: Text content
          example: Fish & Chips
        language:
          $ref: '#/components/schemas/LanguageCode'
    paymentTerms:
      type: object
      properties:
        paymentTermKey:
          type: string
          description: Key of the payment term as defined in the source system
          example: T10
        descriptions:
          type: array
          description: Descriptions of the payment terms in different languages
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Please pay us
              language: en
    customFields:
      type: object
      description: List of key value pairs containing custom fields from the source system
      additionalProperties:
        type: string
    JsonObject:
      type: object
      description: Any nested structure with metadata that source system needs to send
      additionalProperties: true
      example:
        someTopLevelProperty: value1
        someNestedProperty:
          nestedProperty: value2
        someArrayProperty:
          - value3
          - value4
    accountAssignment:
      type: object
      properties:
        externalGlAccountId:
          type: string
          description: >-
            External unique id of the general ledger account in the source
            system
          example: 0000100GL1
        externalCostCenterId:
          type: string
          description: External unique id of the cost center in the source system
          example: 0000100CO1
        glAccountCode:
          type: string
          description: General ledger account code
          example: GL1
        costCenterCode:
          type: string
          description: Cost center code
          example: CO1
        quantity:
          type: number
          description: >-
            Quantity of the invoice line (split of the quantity in case of
            several accountAssignments)
          example: 2
        externalProjectId:
          type: string
          description: External id for project assignment
          example: EPI1
        externalOrderId:
          type: string
          description: External id for order assignment
          example: EOI1
        costElementCode:
          type: string
          description: Cost element code assignment
          example: CE1
        externalProfitCenterId:
          type: string
          description: External unique id of the profit center in the source system
          example: EPCI1
        profitCenterCode:
          type: string
          description: Profit center code
          example: PCC1
    taxCode:
      type: object
      properties:
        code:
          type: string
          description: Unique code of the type of tax in the source system
          example: DEU_Standard
        description:
          type: string
          description: Description of the type of tax in the source system
          example: DEU - Standard (19%)
    invoiceLine:
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the invoice line that is globally unique across the
            provided invoice line data
          example: '00000001'
          pattern: ^\S+$
        externalCompanyId:
          type: string
          description: Company that the invoice line is assigned to
          example: DE01
        accountAssignments:
          type: array
          items:
            $ref: '#/components/schemas/accountAssignment'
        type:
          type: string
          description: type of the invoice line as defined in the source system
          example: Service
        quantity:
          type: number
          description: >-
            Quantity of the invoice line (sum of all quantity splits in case of
            several accountAssignments)
          example: 2
        netAmount:
          type: number
          description: Net amount of the invoice line
          example: 1.23
        totalTaxAmount:
          type: number
          description: Total tax amount of the invoice line
          example: 1.23
        grossAmount:
          type: number
          description: Gross amount of the invoice line
          example: 100.01
        unitOfMeasure:
          type: string
          description: Unit of measure of the invoice line
          example: kg
        unitPrice:
          type: number
          description: Price for one unit of the invoice line
          example: 19.0123
        taxCode:
          $ref: '#/components/schemas/taxCode'
        taxJurisdictionCode:
          type: string
          description: tax jurisdiction code assigned to the invoice
          example: PA0000000
        itemText:
          type: string
          description: Text describing the invoice line item
          example: Virtual Event ABC
        externalPurchaseOrderId:
          type: string
          description: Purchase order related to the invoice line item
          example: '4500016221'
        purchaseOrderLineNumber:
          type: string
          description: >-
            Reference to the purchase order line item assigned to the invoice
            line item
          example: '00010'
        centralBankIndicator:
          type: string
          description: >-
            State Central Bank Indicator for reporting foreign payment
            transactions according to the German Foreign Trade and Payments
            Ordinance (Außenwirtschaftsverordnung - AWV)
          example: '123'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    withholdingTax:
      type: object
      description: Withholding tax information related to a posted invoice
      properties:
        key:
          type: string
          description: >-
            Key that the source system uses to clearly identify the type of
            withholding tax that needs to be paid
          example: WHT-432
        baseAmount:
          type: number
          description: >-
            Base amount that the tax rate of the specific withholding tax type
            is applied to
          example: 632.78
        amount:
          type: number
          description: Tax amount that was paid for the specific withholding tax type
          example: 21.39
        currency:
          $ref: '#/components/schemas/CurrencyCode'
    invoice:
      required:
        - externalId
        - invoiceLines
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the invoice that is globally unique across the
            provided invoice data
          example: SUPPLIER_INVOICE-3-1
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        documentId:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: 63cac12c37bb02accb396cae
          pattern: ^[0-9a-fA-F]{24}$
        documents:
          type: array
          items:
            $ref: '#/components/schemas/document'
        supplierInvoiceNumber:
          type: string
          description: Invoice number provided by the issuing supplier
          example: '10000001'
        invoiceNumber:
          type: string
          description: >-
            Number of the invoice in the source system (not unique across
            clients)
          example: '12345'
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system
          example: DE01
        externalSupplierId:
          type: string
          description: External unique id of the supplier in the source system
          example: '0000100000'
        externalBankAccountId:
          type: string
          description: >-
            External unique id of the bank account that the invoice payment was
            transferred to
          example: '12341234'
        fiscalYearLabel:
          type: string
          description: >-
            Label used in the source system for the fiscal year that the invoice
            was posted in
          example: '2023'
        issuedDate:
          type: string
          description: >-
            Date when the invoice was issued by the supplier (printed on invoice
            document)
          format: date
          example: '2000-12-31'
        receivedDate:
          type: string
          description: Date when the invoice was recieved by the company
          format: date
          example: '2000-12-31'
        postingDate:
          type: string
          description: Date when the invoice was posted in the source system
          format: date
          example: '2000-12-31'
        isCanceled:
          type: boolean
          description: Indicator if the invoice is canceled
          example: false
        isCreditNote:
          type: boolean
          description: Indicator if the document is a credit note
        externalCustomerId:
          type: string
          description: External unique id of the customer in the source system
        relatedInvoice:
          type: string
          description: externalInvoiceId of related invoice
          example: SUPPLIER_INVOICE-3-2
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        totalNetAmount:
          type: number
          description: Total net amount of invoice (sum of line item net amounts)
          example: 81
        totalFreightCharges:
          type: number
          description: Sum of all freight charges
          example: 9
        totalOtherCharges:
          type: number
          description: Sum of all charges other than freight charges
          example: 10
        totalTaxAmount:
          type: number
          description: Total tax amount of invoice (sum of all taxes)
          example: 19
        totalGrossAmount:
          type: number
          description: >-
            Total gross amount of invoice (total net amount + total freight
            charges + total other charges + total tax amount)
          example: 119
        paymentTerms:
          $ref: '#/components/schemas/paymentTerms'
        externalApproverId:
          type: string
          description: >-
            External unique id of the first approver of an invoice in the source
            system
          example: UserID#1234
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        headerText:
          type: string
          description: Header Text describing the invoice
          example: doc header text
        type:
          type: string
          description: type of the invoice as defined in th source system
          example: FI
        invoiceLines:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/invoiceLine'
        withholdingTax:
          type: array
          items:
            $ref: '#/components/schemas/withholdingTax'
        documentType:
          type: string
          description: document type as defined in the source system
          example: supplier invoice
    CountryCode:
      type: string
      nullable: true
      description: Two letter country code as defined in ISO 3166-1 alpha-2
      example: DE
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MK
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - null
    vatId:
      type: object
      description: List of VAT IDs assigned to the company
      properties:
        id:
          type: string
        countryCode:
          $ref: '#/components/schemas/CountryCode'
      example:
        - id: DE123456789
          countryCode: DE
    taxId:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
      example:
        - id: 123-456-789
          type: TIN
    company:
      required:
        - name
        - externalId
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the company that is globally unique across the
            provided company data
          example: DE01
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: Code of the company in the source system (not unique across clients)
          example: CODE1
        name:
          type: string
          description: Name of the company
          example: Acmne Corp.
          pattern: ^[\S ]*\S[\S ]*$
        nameAlternative1:
          type: string
          description: Alternative name of the company
          example: Acmne Corp.
        nameAlternative2:
          type: string
          description: Alternative name of the company
          example: Acmne Corp.
        nameAlternative3:
          type: string
          description: Alternative name of the company
          example: Acmne Corp.
        nameAlternative4:
          type: string
          description: Alternative name of the company
          example: Acmne Corp.
        street:
          type: string
          description: Street and street number where the company is located
          example: Hauptstr. 1
        addressAdditional:
          type: string
          description: Additional address data (e.g. apartment or suite)
          example: Eingang B
        postcode:
          type: string
          description: Postcode where the company is located
          example: '10001'
        city:
          type: string
          description: City where the company is located
          example: Berlin
        state:
          type: string
          description: State where the company is located
          example: Berlin
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        vatIds:
          type: array
          description: List of VAT IDs assigned to the company
          example:
            - id: DE123456789
              countryCode: DE
          items:
            $ref: '#/components/schemas/vatId'
        taxIds:
          type: array
          description: List of Tax IDs assigned to the company
          example:
            - id: 123-456-789
              type: TIN
          items:
            $ref: '#/components/schemas/taxId'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    defaultAssignments:
      type: object
      properties:
        defaultAccountAssignment:
          type: object
          properties:
            glAccountCode:
              type: string
              description: Default general ledger account that is assigned to the supplier
              example: 0000100GL1
            costCenterCode:
              type: string
              description: Default cost center account that is assigned to the supplier
              example: 0000100CC1
            externalApproverId:
              type: string
              description: Default external approver ID that is assigned to the supplier
              example: MMUSTERMANN
            externalProjectId:
              type: string
              description: Default external project ID that is assigned to the supplier
              example: PROJ1234
            externalOrderId:
              type: string
              description: Default external order ID that is assigned to the supplier
              example: ORDER1234
    withholdingTaxInfo:
      type: object
      description: Withholding tax information related to a supplier
      properties:
        key:
          type: string
          description: >-
            Key that the source system uses to clearly identify the type of
            withholding tax that needs to be paid
          example: WHT-432
        descriptions:
          type: array
          description: Descriptions of the type of withholding tax
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Some very deep description of the type of withholding tax
              language: en
    subsidiary:
      allOf:
        - $ref: '#/components/schemas/defaultAssignments'
        - type: object
          required:
            - externalCompanyId
          properties:
            externalCompanyId:
              type: string
              description: >-
                External unique id of the company that the subsidiary is
                assigned to
              example: DE01
            paymentTerms:
              $ref: '#/components/schemas/paymentTerms'
            blockedForPosting:
              type: boolean
              description: Indicator if the subsidiary is blocked for posting
              example: false
            blockedForPayment:
              type: boolean
              description: Indicator if the subsidiary is blocked for payment
              example: false
            enabledForAutoPosting:
              type: boolean
              description: Indicator if the subsidiary is enabled for auto posting
              example: true
            withholdingTaxInfo:
              type: array
              items:
                $ref: '#/components/schemas/withholdingTaxInfo'
    bankAccount:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the bank account that is globally unique across the
            provided bank account data
          example: '12341234'
          pattern: ^\S+$
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        bankAccountNumber:
          type: string
          description: Bank account number of the bank account
          example: '78090'
        bankAccountHolder:
          type: string
          description: Name of the bank account holder
          example: Maximilian Mustermann
        iban:
          type: string
          description: IBAN of the bank account
          example: DE91100000000123456789
        bic:
          type: string
          description: Bank identifier code
          example: CHASUS33XXX
        bankName:
          type: string
          description: Name of the bank where the bank account is held
          example: Deutsche Bank
        bankStreet:
          type: string
          description: Street and street number where the bank is located
          example: Hauptstr. 1
        bankPostcode:
          type: string
          description: Postcode where the bank is located.
          example: '10001'
        bankCity:
          type: string
          description: City where the bank is located.
          example: Berlin
        isActive:
          type: boolean
          example: true
        type:
          type: string
          description: Type of bank account.
          example: SAVINGS
        bankKey:
          type: string
          description: Unique key of the bank.
          example: 60-16-13
    supplier:
      allOf:
        - $ref: '#/components/schemas/defaultAssignments'
        - type: object
          required:
            - name
            - externalId
          properties:
            externalId:
              type: string
              description: >-
                External id of the supplier that is globally unique across the
                provided supplier data
              example: '0000100000'
              pattern: ^\S+$
            externalClientId:
              type: string
              description: >-
                Identifier of the client entity in the source system which can
                be used to separate data
              example: EXTERNAL_CLIENT_ID
            code:
              type: string
              description: >-
                Code of the supplier in the source system (not unique across
                clients)
              example: CODE1
            name:
              type: string
              description: Name of the supplier
              example: Acmne Corp.
              pattern: ^[\S ]*\S[\S ]*$
            nameAlternative1:
              type: string
              description: Alternative name of the supplier
              example: Acmne Corp.
            nameAlternative2:
              type: string
              description: Alternative name of the supplier
              example: Acmne Corp.
            nameAlternative3:
              type: string
              description: Alternative name of the supplier
              example: Acmne Corp.
            nameAlternative4:
              type: string
              description: Alternative name of the supplier
              example: Acmne Corp.
            alternativePayee:
              type: string
              pattern: ^\S+$
              description: >-
                externalId of the supplier which is the alternative payee for
                this supplier
            street:
              type: string
              description: Street and street number where the supplier is located
              example: Hauptstr. 1
            addressAdditional:
              type: string
              description: Additional address data (e.g. apartment or suite)
              example: Eingang B
            postcode:
              type: string
              description: Postcode where the supplier is located
              example: '10001'
            city:
              type: string
              description: City where the supplier is located
              example: Berlin
            state:
              type: string
              description: State where the company is located
              example: Berlin
            countryCode:
              $ref: '#/components/schemas/CountryCode'
            vatIds:
              type: array
              description: List of VAT IDs assigned to the supplier
              example:
                - id: DE123456789
                  countryCode: DE
              items:
                $ref: '#/components/schemas/vatId'
            taxIds:
              type: array
              description: List of Tax IDs assigned to the supplier
              example:
                - id: 123-456-789
                  type: TIN
              items:
                $ref: '#/components/schemas/taxId'
            blockedForPosting:
              type: boolean
              description: Indicator if the supplier is blocked for posting
              example: false
            blockedForPayment:
              type: boolean
              description: Indicator if the supplier is blocked for payment
              example: false
            supplierSubsidiaries:
              type: array
              items:
                $ref: '#/components/schemas/subsidiary'
            supplierBankAccounts:
              type: array
              items:
                $ref: '#/components/schemas/bankAccount'
            customFields:
              $ref: '#/components/schemas/customFields'
            customMetadata:
              $ref: '#/components/schemas/JsonObject'
    material:
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the material that is globally unique across the
            provided material data
          example: 2a6300181f08402e710ea3f180214bc1
          pattern: ^\S+$
        supplierNumber:
          type: string
          description: Number of the material as defined by the supplier
          example: '123456789'
        type:
          type: string
          description: >-
            Type of the material as defined in the material master of the
            company
          example: Operating Supplies
        group:
          type: string
          description: >-
            Group of the material as defined in the material master of the
            company
          example: Electronics
        description:
          type: string
          description: Description of the material
          example: Dell Laptop Latitude D630
        manufacturer:
          type: string
          description: Name of the manufacturer of the material
          example: Acme Corporation
        manufacturerNumber:
          type: string
          description: Number of the material as defined by the manufacturer
          example: ACME-12345
        unspsc:
          type: string
          description: United Nations Standard Products and Services Code of the material
          example: '43211508'
    deliveryAddress:
      type: object
      description: >-
        Delivery address associated with the purchase order line. Represents the
        physical destination where goods or services are delivered
      properties:
        street:
          type: string
          description: Street name and house number of the delivery address
          example: 123 Industrial Way
        addressAdditional:
          type: string
          description: Additional address data (e.g. apartment or suite)
          example: Suite 500, Dock 4
        postcode:
          type: string
          description: Postcode of the delivery address
          example: '90001'
        city:
          type: string
          description: City of the delivery address
          example: Los Angeles
        state:
          type: string
          description: State of the delivery address
          example: CA
        countryCode:
          $ref: '#/components/schemas/CountryCode'
    orderConfirmation:
      type: object
      description: >-
        Object containing order confirmation details provided by the supplier
        for the purchase order line
      properties:
        lineNumber:
          type: string
          description: >-
            Number of the order conformation line assigned (unique within the
            order confirmation)
          example: '0090'
        deliveryDate:
          type: string
          description: Confirmed delivery date provided by the supplier (YYYY-MM-DD)
          format: date
          example: '2024-10-15'
        quantity:
          type: number
          description: Quantity confirmed by the supplier for the specified delivery date
          example: 95
        supplierReference:
          type: string
          description: Reference number assigned by the supplier for the order confirmation
          example: SUP-REF-00192
        createdAt:
          type: string
          description: >-
            Date when the order confirmation was created in the source system
            (YYYY-MM-DD)
          format: date
          example: '2024-09-01'
    purchaseOrderLine:
      required:
        - purchaseOrderLineNumber
      type: object
      properties:
        purchaseOrderLineNumber:
          type: string
          description: >-
            Number of the purchase order line assigned to the invoice line item
            (unique within the purchase order)
          example: '00010'
        externalCompanyId:
          type: string
          description: Company that the purchase order line is assgined to
          example: DE01
        accountAssignments:
          type: array
          items:
            $ref: '#/components/schemas/accountAssignment'
        type:
          type: string
          description: type of the purchase order line as defined in the source system
          example: Service
        subType:
          type: string
          description: subtype of the purchase order as defined in the source system
          example: Extra Qualifier
        quantity:
          type: number
          description: >-
            Quantity of the purchase order line (sum of all quantity splits in
            case of several accountAssignments)
          example: 2
        status:
          type: string
          description: Status of purchase order line as defined in source system
          example: OPEN
        netAmount:
          type: number
          description: Net amount of the purchase order line
          example: 1.23
        totalTaxAmount:
          type: number
          description: Total tax amount of the purchase order line
          example: 1.23
        grossAmount:
          type: number
          description: Gross amount of the purchase order line
          example: 100.01
        unitOfMeasure:
          type: string
          description: Unit of measure of the purchase order line
          example: kg
        unitPrice:
          type: number
          description: Price for one unit of the purchase order line
          example: 19.0123
        taxCode:
          $ref: '#/components/schemas/taxCode'
        itemText:
          type: string
          description: Text describing the purchase order line
          example: Dell Laptop Latitude D630
        material:
          $ref: '#/components/schemas/material'
        plant:
          type: string
          description: Location where purchased goods and services are consumed
          example: PLANT-001
        delivered:
          type: boolean
          description: Indicator if the purchase order line item was delivered
          example: true
        completelyInvoiced:
          type: boolean
          description: Indicator if the purchase order line item was fully invoiced
          example: true
        approved:
          type: boolean
          description: Indicator if the purchase order line item has been approved
          example: true
        plannedDeliveryDate:
          type: string
          description: Planned delivery date (YYYY-MM-DD)
          format: date
          example: '2025-08-27'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        deliveryAddress:
          $ref: '#/components/schemas/deliveryAddress'
        deliveredQuantity:
          type: number
          description: Quantity that has already been delivered for the purchase order line
          example: 55
        orderConfirmations:
          type: array
          items:
            $ref: '#/components/schemas/orderConfirmation'
        externalPlannerId:
          type: string
          description: >-
            External unique id of the responsible planner / dispatcher in the
            source system
          example: PLAN-4410-B
        accountAssignmentType:
          type: string
          description: >-
            Account assignment type of the purchase order line which defines the
            type of accounting object (e.g. cost center, asset, project) the
            costs of the line are assigned to
          example: K
    deliveryTerms:
      type: object
      description: >-
        Object containing delivery terms information as defined in the source
        system
      properties:
        deliveryTermKey:
          type: string
          description: >-
            Key of the delivery terms as defined in the source system (e.g.
            Incoterms or internal delivery condition codes)
          example: FOB
        descriptions:
          type: array
          description: Descriptions of the delivery terms in different languages
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Free on Board - Port of Los Angeles
              language: en
            - text: Franco a bordo - Puerto de Los Ángeles
              language: es
        additionalInfo:
          type: string
          description: Additional info on the delivery terms (e.g. port or packaging)
          example: Some additional info
    purchaseOrder:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the purchase order that is globally unique across the
            provided purchase order data
          example: '4500016221'
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        purchaseOrderNumber:
          type: string
          description: >-
            Number of the purchase order in the source system (not unique across
            clients)
          example: PoNumber123
        createdDate:
          type: string
          description: Date when the purchase order was created in the external system
          format: date
          example: '2000-12-31'
        fiscalYearLabel:
          type: string
          description: >-
            Label used in the source system for the fiscal year that the
            purchase order was created in
          example: '2023'
        language:
          allOf:
            - $ref: '#/components/schemas/LanguageCode'
            - description: >-
                Language assigned to the purchase order. If the source system
                allows for storing data of text fields in different languages,
                the data should be transferred to Hypatos in the language that
                is assigned to the purchase order (exception: for payment terms
                all languages should be transferred).
        externalCompanyId:
          type: string
          description: Company that the purchase order is assigned to
          example: DE01
        type:
          description: type of the purchase order as defined in the source system
          type: string
          example: Service
        externalSupplierId:
          type: string
          description: External unique id of the supplier in the source system
          example: '0000100000'
        status:
          type: string
          description: Status of purchase order as defined in source system
          example: OPEN
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        totalNetAmount:
          type: number
          description: Total net amount of purchase order (sum of line item net amounts)
          example: 81
        totalFreightCharges:
          type: number
          description: Sum of all freight charges as defined on the purchase order
          example: 9
        totalOtherCharges:
          type: number
          description: >-
            Sum of all charges other than freight charges as defined on the
            purchase order
          example: 10
        totalTaxAmount:
          type: number
          description: Total tax amount of purchase order (sum of all taxes)
          example: 19
        totalGrossAmount:
          type: number
          description: >-
            Total gross amount of purchase order (total net amount + total
            freight charges + total other charges + total tax amount)
          example: 119
        paymentTerms:
          $ref: '#/components/schemas/paymentTerms'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        purchaseOrderLines:
          type: array
          items:
            $ref: '#/components/schemas/purchaseOrderLine'
        productNumber:
          type: string
          description: Number of the product as defined by the purchaser
          example: '123456789'
        externalPurchaserId:
          type: string
          description: External unique id of the responsible purchaser in the source system
          example: PUR-88293-X
        deliveryTerms:
          $ref: '#/components/schemas/deliveryTerms'
    languagedTextWithValue:
      type: object
      properties:
        value:
          type: string
          description: Text Value
          example: OE
        labels:
          type: array
          items:
            $ref: '#/components/schemas/languagedText'
    glAccount:
      type: object
      required:
        - externalId
        - code
      properties:
        externalId:
          type: string
          description: >-
            External id of the general ledger account that is globally unique
            across the provided general ledger account data
          example: 0000100GL1
          pattern: ^\S([\S ]*\S)?$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Code of the general ledger account in the source system (not unique
            across clients)
          example: GL1
          pattern: ^\S([\S ]*\S)?$
        companyAssignment:
          type: array
          description: List of externalCompanyIds that the approver is assigned to
          example:
            - DE01
            - US01
          items:
            type: string
        type:
          $ref: '#/components/schemas/languagedTextWithValue'
        category:
          $ref: '#/components/schemas/languagedTextWithValue'
        label:
          type: array
          description: Label describing the general ledger account
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Entertainment Expenses
              language: en
        accountGroup:
          type: object
          properties:
            value:
              type: string
              description: Alphanumeric value of the general ledger account group
              example: '123'
            labels:
              type: array
              description: Label describing the general ledger account
              items:
                $ref: '#/components/schemas/languagedText'
              example:
                - text: Entertainment Expenses
                  language: en
        shortLabel:
          type: array
          description: Short label describing the general ledger account
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Entertainment Exp.
              language: en
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    costCenter:
      type: object
      required:
        - externalId
        - code
      properties:
        externalId:
          type: string
          description: >-
            External id of the cost center that is globally unique across the
            provided cost center data
          example: 0000100CO1
          pattern: ^\S([\S ]*\S)?$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Code of the cost center in the source system (not unique across
            clients)
          example: CO1
          pattern: ^\S([\S ]*\S)?$
        companyAssignment:
          type: array
          description: List of externalCompanyIds that the approver is assigned to
          example:
            - DE01
            - US01
          items:
            type: string
        type:
          $ref: '#/components/schemas/languagedTextWithValue'
        category:
          $ref: '#/components/schemas/languagedTextWithValue'
        label:
          type: array
          description: Label describing the cost center
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Sales Engineers
              language: en
        shortLabel:
          type: array
          description: Short label describing the cost center
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Sales Eng.
              language: en
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    approver:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the approver that is globally unique across the
            provided approver data
          example: UserID#1234
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Code of the approver in the source system (not unique across
            clients)
          example: CODE1
        companyAssignment:
          type: array
          description: List of externalCompanyIds that the approver is assigned to
          example:
            - DE01
            - US01
          items:
            type: string
        isActive:
          type: boolean
          example: true
        firstName:
          type: string
          description: First name of the approving person
          example: Koala
        lastName:
          type: string
          description: Last name of the approving person
          example: Hinze
        email:
          type: string
          description: Email address of the approving person
          format: email
          example: accountant@sap.com
        phoneNumber:
          type: string
          description: Phone number of the approving person
          example: '+491001234567891'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    salesOrganizationInfo:
      type: object
      description: Details of the sales organization associated with the contract
      properties:
        externalSalesOrganizationId:
          type: string
          description: External identifier for the sales organization
          example: '1000'
        distributionChannel:
          type: string
          description: Distribution channel for sales
          example: '2000'
        division:
          type: string
          description: Division under which the sales organization operates
          example: '3000'
        salesGroup:
          type: string
          description: Sales group associated with the contract
          example: '4000'
        salesOffice:
          type: string
          description: Sales office responsible for the contract
          example: '5000'
        blockedForOrdering:
          type: boolean
          description: >-
            Indicator if the customer is blocked for ordering in a sales
            organization
          example: true
        blockedForDelivery:
          type: boolean
          description: Indicator if the subsidiary is blocked for delivery
          example: false
        shippingAddresses:
          type: array
          description: List of external id of the related shipping addresses
          example:
            - ADDR001
            - ADDR002
          items:
            type: string
        billingAddresses:
          type: array
          description: List of external id of the related billing addresses
          example:
            - ADDR003
          items:
            type: string
        salesOrganizationCode:
          type: string
          description: >-
            Code of the sales organization in the source system (not unique
            across clients)
          example: SO001
        salesUnit:
          type: object
          properties:
            unitOfMeasure:
              type: string
              description: Unit in which the product is sold, different from base unit
              example: PK
            conversionFactorToBaseUnit:
              type: number
              description: >-
                Number of base units per sales unit (e.g., 10 means 1 PK = 10
                PC)
              example: 1000
            description:
              type: string
              description: Description of the sales unit packaging
              example: Package of 10 units
    customer:
      type: object
      required:
        - name
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the customer that is globally unique across the
            provided customer data
          example: '0000100000'
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Code of the customer in the source system (not unique across
            clients)
          example: CODE1
        name:
          type: string
          description: Name of the customer
          example: Acmne Corp.
          pattern: ^[\S ]*\S[\S ]*$
        nameAlternative1:
          type: string
          description: Alternative name of the customer
          example: Acmne Corp.
        nameAlternative2:
          type: string
          description: Alternative name of the customer
          example: Acmne Corp.
        nameAlternative3:
          type: string
          description: Alternative name of the customer
          example: Acmne Corp.
        nameAlternative4:
          type: string
          description: Alternative name of the customer
          example: Acmne Corp.
        street:
          type: string
          description: Street and street number where the customer is located
          example: Hauptstr. 1
        addressAdditional:
          type: string
          description: Additional address data (e.g. apartment or suite)
          example: Eingang B
        postcode:
          type: string
          description: Postcode where the customer is located
          example: '10001'
        city:
          type: string
          description: City where the customer is located
          example: Berlin
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        vatIds:
          type: array
          description: List of VAT IDs assigned to the customer
          example:
            - id: DE123456789
              countryCode: DE
          items:
            $ref: '#/components/schemas/vatId'
        taxIds:
          type: array
          description: List of Tax IDs assigned to the customer
          example:
            - id: 123-456-789
              type: TIN
          items:
            $ref: '#/components/schemas/taxId'
        blockedForPosting:
          type: boolean
          description: Indicator if the customer is blocked for posting
          example: false
        blockedForPayment:
          type: boolean
          description: Indicator if the customer is blocked for payment
          example: false
        blockedForOrdering:
          type: boolean
          description: Indicator if the customer is blocked for ordering globally
          example: false
        blockedForDelivery:
          type: boolean
          description: Indicator if the customer is blocked for delivery globally
          example: false
        customerSubsidiaries:
          type: array
          items:
            $ref: '#/components/schemas/subsidiary'
        customerBankAccounts:
          type: array
          items:
            $ref: '#/components/schemas/bankAccount'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        salesOrganizationInfo:
          type: array
          items:
            $ref: '#/components/schemas/salesOrganizationInfo'
    lookup-table-row:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the lookup-table-row that is globally unique across
            the provided lookup-table-row data
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Number of the lookup table record in the source system (not unique
            across clients)
          example: CODE1
      additionalProperties:
        type: string
        maxProperties: 20
        description: externalClientId and code counts for maximum 20 additional properties
      example:
        externalId: '12345'
        externalClientId: EXTERNAL_CLIENT_ID
        dimension1: someValue
        dimension2: anotherValue
        customField: dynamicValue
    contractStatus:
      type: string
      nullable: true
      description: Indicates the current lifecycle state of the contract
      example: active
      enum:
        - draft
        - active
        - pending
        - suspended
        - cancelled
        - expired
        - terminated
        - null
      x-enum-descriptions:
        - >-
          The contract is in draft mode and has not been finalized. It can still
          be edited
        - The contract is currently in effect and legally binding
        - >-
          The contract has been submitted for approval or is awaiting
          finalization
        - The contract is temporarily on hold but not yet terminated
        - The contract has been cancelled before becoming active
        - The contract has reached its end date and is no longer valid
        - The contract was ended before its expiration date
    businessPartnerType:
      type: string
      nullable: true
      description: Type of business partner (e.g., Supplier, Customer)
      example: supplier
      enum:
        - supplier
        - customer
        - null
    businessPartner:
      type: object
      description: Details of the business partner associated with the contract
      properties:
        externalId:
          type: string
          description: >-
            External id of the business partner that is globally unique across
            the provided business partner data
          example: '0000100000'
        type:
          $ref: '#/components/schemas/businessPartnerType'
    parentContract:
      type: object
      description: Details of the business partner associated with the contract
      properties:
        externalId:
          type: string
          description: >-
            External id of the parent contract that is globally unique across
            the provided parent contract data
          example: PARENT-2024-0005
        contractNumber:
          type: string
          description: Contract number of the parent contract
          example: CN-2024-005
    contractItem:
      type: object
      properties:
        itemNumber:
          type: string
          description: Unique identifier for the contract item
          example: '001'
        category:
          type: string
          description: Category of the contract item (e.g., Service, Product)
          example: Service
        description:
          type: string
          description: Description of the contract item
          example: Annual software maintenance
        netAmount:
          type: number
          description: Net amount of the contract item
          example: 25000
        taxAmount:
          type: number
          description: Tax amount applicable to the contract item
          example: 4750
        grossAmount:
          type: number
          description: Gross amount of the contract item (net + tax)
          example: 29750
        unitPrice:
          type: number
          description: Price per unit of the contract item
          example: 25000
        quantity:
          type: number
          description: Quantity of the contract item
          example: 1
        unitOfMeasure:
          type: string
          description: Unit of measure for the contract item
          example: EA
        billingCycle:
          type: string
          description: Purchase order related to the invoice line item
          example: Billing cycle for the contract item
        durationMonths:
          type: number
          description: Duration of the contract item in months
          example: 12
        taxCode:
          $ref: '#/components/schemas/taxCode'
    additionalAgreement:
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the agreement that is globally unique across the
            provided agreement data
          example: AGREEMENT-001
        type:
          type: string
          description: Type of agreement
          example: downPaymentAllowed
        value:
          type: boolean
          description: Value of the agreement condition
          example: true
    obligation:
      type: object
      properties:
        party:
          type: string
          description: Party responsible for the obligation
          example: Company A
        description:
          type: string
          description: Description of the obligation
          example: Company A will deliver 1000 units of Product X per quarter
    contactItem:
      type: object
      properties:
        firstName:
          type: string
          description: First name of the contact person
          example: Koala
        lastName:
          type: string
          description: Last name of the contact person
          example: Hinze
        email:
          type: string
          description: Email address of the contact person
          example: accountant@sap.com
        phoneNumber:
          type: number
          description: Phone number of the contact person
          example: 491001234567891
    contract:
      required:
        - externalId
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the contract that is globally unique across the
            provided contract data
          example: CONTRACT-2025-0001
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: CONTRACT-2025-0001
        documentId:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: 67c02594d4aa80eecbd39bbe
          pattern: ^[0-9a-fA-F]{24}$
        documents:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/document'
        contractNumber:
          type: string
          description: Contract number assigned in the source system
          example: CN-2025-001
        status:
          $ref: '#/components/schemas/contractStatus'
        businessPartnerContractNumber:
          type: string
          description: Contract number assigned by the business partner
          example: K9120-12
        externalCompanyId:
          type: string
          description: External unique identifier of the company in the source system
          example: DE01
        salesOrganizationInfo:
          type: array
          items:
            $ref: '#/components/schemas/salesOrganizationInfo'
        businessPartner:
          $ref: '#/components/schemas/businessPartner'
        title:
          type: string
          description: Title or name of the contract
          example: Software Maintenance Agreement
        description:
          type: string
          description: Description of the contract and its purpose
          example: Annual software maintenance contract for Acme Corp
        createdDate:
          type: string
          description: Date when the contract was created (YYYY-MM-DD)
          format: date
          example: '2025-01-15'
        startDate:
          type: string
          description: Date when the contract becomes effective (YYYY-MM-DD)
          format: date
          example: '2025-02-01'
        endDate:
          type: string
          description: Date when the contract expires (YYYY-MM-DD)
          format: date
          example: '2026-01-31'
        fiscalYearLabel:
          type: string
          description: Fiscal year label associated with the contract
          example: '2023'
        type:
          type: string
          description: Type of contract
          example: Service Agreement
        subType:
          type: string
          description: Subtype of contract
          example: Quantity
        currency:
          type: string
          description: Currency in which the contract amounts are denominated
          example: EUR
        totalNetAmount:
          type: number
          description: Total net amount of the contract
          example: 50000
        totalTaxAmount:
          type: number
          description: Total tax amount applicable to the contract
          example: 9500
        totalGrossAmount:
          type: number
          description: Total gross amount of the contract (net amount + tax)
          example: 59500
        paymentTerms:
          $ref: '#/components/schemas/paymentTerms'
        parentContract:
          $ref: '#/components/schemas/parentContract'
        targetQuantity:
          type: number
          description: Target quantity specified in the contract
          example: 1000
        targetValue:
          type: number
          description: Target value of the contract in the specified currency
          example: 200000
        contractItems:
          type: array
          description: List of items included in the contract
          items:
            $ref: '#/components/schemas/contractItem'
        additionalAgreements:
          type: array
          description: List of additional agreements linked to the contract
          items:
            $ref: '#/components/schemas/additionalAgreement'
        obligations:
          type: array
          description: List of obligations specified in the contract
          items:
            $ref: '#/components/schemas/obligation'
        contacts:
          type: array
          description: List of contact persons associated with the contract
          items:
            $ref: '#/components/schemas/contactItem'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    salesOrderLine:
      type: object
      properties:
        plannedDeliveryDate:
          type: string
          description: Planned delivery date (YYYY-MM-DD)
          format: date
          example: '2025-08-27'
        orderLineNumber:
          type: string
          description: External unique id of the sales order line in the source system
          example: '00000001'
        externalCompanyId:
          type: string
          description: Company that the sales order is assigned to
          example: DE01
        externalProductId:
          type: string
          description: External unique id of the product in the source system
          example: PO01
        quantity:
          type: number
          description: Ordered quantity of the sales order line
          example: 2
        unitOfMeasure:
          type: string
          description: Unit of measure of the sales order line
          example: kg
        unitPrice:
          type: number
          description: Unit price of the sales order line
          example: 100
        netAmount:
          type: number
          description: Net amount of the sales order line
          example: 200
        totalTaxAmount:
          type: number
          description: Tax amount of the sales order line
          example: 38
        grossAmount:
          type: number
          description: Gross amount of the sales order line
          example: 238
        taxCode:
          $ref: '#/components/schemas/taxCode'
        description:
          type: string
          description: Description of the type of tax in the source system
          example: DEU - Standard (19%)
        plant:
          type: string
          description: Plant responsible for fulfilling the sales order line
          example: PLANT-001
        storageLocation:
          type: string
          description: Storage location of the sales order line
          example: BOX-001
        externalShippingAddressId:
          type: string
          description: Shipping address for the sales order line
          example: DE-123E
        externalBillingAddressId:
          type: string
          description: Billing address related to the sales order line
          example: DE-123E
        itemText:
          type: string
          description: Text describing the sales order line
          example: Sold item ABC
        type:
          type: string
          description: Type of the sales order line
          example: Item type
        externalQuoteId:
          type: string
          description: Quote that the sales order line was ordered from
          example: EQ01
        quoteLineNumber:
          type: string
          description: Line number from the linked quote
          example: LN01
        externalContractId:
          type: string
          description: Contract that the sales order line is related to
          example: ECID01
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    salesOrder:
      required:
        - externalId
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External id of the sales order that is globally unique across the
            provided sales order data
          example: DE01
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        documentId:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: 63cac12c37bb02accb396cae
          pattern: ^[0-9a-fA-F]{24}$
        documents:
          type: array
          items:
            $ref: '#/components/schemas/document'
        customerOrderNumber:
          type: string
          description: Sales order number provided by the issuing customer
          example: CUSTOMER_ORDER_NUMBER
        salesOrderNumber:
          type: string
          description: >-
            Number of the sales order in the source system (not unique across
            clients)
          example: SALES_ORDER_NUMBER
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system
          example: DE01
        externalCustomerId:
          type: string
          description: External unique id of the customer in the source system
          example: CO01
        salesOrganizationCode:
          type: string
          description: Sales organization code
          example: SO001
        distributionChannel:
          type: string
          description: Distribution channel code
          example: CH1
        division:
          type: string
          description: Division code
          example: DIV01
        salesGroup:
          type: string
          description: Sales group responsible for the order
          example: '123456'
        salesOffice:
          type: string
          description: Sales office responsible for the order
          example: '98765'
        type:
          type: string
          description: Type of the invoice as defined in the source system
          example: OR
        subType:
          type: string
          description: Sub type of the invoice as defined in the source system
          example: recurring
        issuedDate:
          type: string
          description: >-
            Date when the invoice was issued by the supplier (printed on invoice
            document)
          format: date
          example: '2000-12-31'
        receivedDate:
          type: string
          description: Date when the invoice was received by the company
          format: date
          example: '2000-12-31'
        fiscalYearLabel:
          type: string
          description: >-
            Label used in the source system for the fiscal year that the invoice
            was posted in
          example: '2023'
        requestedDeliveryDate:
          type: string
          description: Requested delivery date
          format: date
          example: '2000-12-31'
        isCanceled:
          type: boolean
          description: Indicator if the invoice is canceled
          example: false
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        totalNetAmount:
          type: number
          description: Total net amount of sales order (sum of line item net amounts)
          example: 100
        totalTaxAmount:
          type: number
          description: Total tax amount of sales order (sum of all taxes)
          example: 19
        totalGrossAmount:
          type: number
          description: >-
            Total gross amount of sales order (total net amount + total tax
            amount)
          example: 119
        paymentTerms:
          $ref: '#/components/schemas/paymentTerms'
        headerText:
          type: string
          description: Header Text describing the invoice
          example: doc header text
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        salesOrderLines:
          type: array
          items:
            $ref: '#/components/schemas/salesOrderLine'
    productSalesOrganizationInfo:
      allOf:
        - $ref: '#/components/schemas/salesOrganizationInfo'
        - type: object
          properties:
            productGroup1:
              type: string
              description: >-
                Customer- or ERP-defined sales product classification 1. Can be
                used for reporting, pricing, segmentation, routing, or
                sales-specific product grouping.
              example: ELECTRONICS
            productGroup2:
              type: string
              description: >-
                Customer- or ERP-defined sales product classification 2. Can be
                used for reporting, pricing, segmentation, routing, or
                sales-specific product grouping.
              example: COMPUTERS
            productGroup3:
              type: string
              description: >-
                Customer- or ERP-defined sales product classification 3. Can be
                used for reporting, pricing, segmentation, routing, or
                sales-specific product grouping.
              example: LAPTOPS
            productGroup4:
              type: string
              description: >-
                Customer- or ERP-defined sales product classification 4. Can be
                used for reporting, pricing, segmentation, routing, or
                sales-specific product grouping.
              example: B2B_DIRECT
            productGroup5:
              type: string
              description: >-
                Customer- or ERP-defined sales product classification 5. Can be
                used for reporting, pricing, segmentation, routing, or
                sales-specific product grouping.
              example: B2B_DIRECT
            productCategoryGroup:
              type: string
              description: >-
                Sales-specific product category or item category group used to
                determine how the product is handled in sales processes, such as
                order processing, item categorization, pricing, or fulfillment
                logic.
              example: STANDARD_GOOD
    product:
      required:
        - externalId
      type: object
      properties:
        externalId:
          type: string
          description: >-
            External ID of the product that is globally unique across the
            provided product data
          example: DE01
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        productNumber:
          type: string
          description: Number of the product as defined by the supplier
          example: NO123
        type:
          type: string
          description: >-
            Type of the product as defined in the company’s product master
            (e.g., Operating Supplies)
          example: Operating Supplies
        group:
          type: string
          description: Group of the product as defined in the product master of the company
          example: Electronics
        description:
          type: string
          description: Description of the product
          example: A Laptop XP
        shortDescription:
          type: string
          description: Shortened version of the product description
          example: A great laptop
        manufacturer:
          type: string
          description: Name of the product manufacturer
          example: Corporation ABC
        unspsc:
          type: string
          description: Universal Product Code (UPC-A)
          example: '43211508'
        ean:
          type: string
          description: European Article Number (EAN-13)
          example: '4006381333931'
        upc:
          type: string
          description: Universal Product Code (UPC-A)
          example: '036000291452'
        baseUnitOfMeasure:
          type: string
          description: The base unit in which the product is managed in the system
          example: kg
        customsTariffNumber:
          type: string
          description: >-
            Customs tariff number (HS/TARIC code) used for cross-border trade
            and customs
          example: '8471300000'
        plants:
          type: array
          items:
            type: string
            description: Identifier of the plants where the product is stored or managed
            example: PLANT-001
        status:
          type: string
          description: Current status of the product
          example: ACTIVE
          enum:
            - ACTIVE
            - INACTIVE
            - DISCONTINUED
        grossWeight:
          type: number
          description: Gross weight of the product including packaging
          example: 2.5
        netWeight:
          type: number
          description: Net weight of the product excluding packaging
          example: 2.3
        weightUnit:
          type: string
          description: Unit for weight values
          example: KG
        volume:
          type: number
          description: Volume of the product
          example: 0.015
        volumeUnit:
          type: string
          description: Unit for volume values
          example: M3
        salesOrganizationInfo:
          type: array
          items:
            $ref: '#/components/schemas/productSalesOrganizationInfo'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    address:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: >-
            External id of the address that is globally unique across the
            provided address data
          pattern: ^\S+$
          example: ADDR12345
        businessPartnerNumber:
          type: string
          description: >-
            Number of the business partner related to this address (e.g.
            customer number)
          example: BP12345
        parentBusinessPartnerNumber:
          type: string
          description: >-
            Number of the parent business partner of this address (e.g. customer
            number)
          example: PBP12345
        type:
          type: string
          description: Type of the address
          enum:
            - shippingAddress
            - billingAddress
          example: shippingAddress
        addressOrder:
          type: number
          description: >-
            Order of the address (in case there’s several addresses of the same
            type)
          example: 1
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: CLIENT123
        globalLocationNumber:
          type: string
          description: >-
            13-digit Global Location Number (GLN) used for unique location
            identification in B2B transactions
          example: '1234567890123'
        companyName:
          type: string
          description: Name of the company associated with the address
          pattern: ^[\S ]*\S[\S ]*$
          example: Acme Corporation
        nameAlternative1:
          type: string
          description: Alternative name of the company (e.g. trade name or local language)
          example: Acme Corp.
        nameAlternative2:
          type: string
          description: Alternative name of the company
          example: Acme Inc.
        nameAlternative3:
          type: string
          description: Alternative name of the company
          example: Acme Ltd.
        nameAlternative4:
          type: string
          description: Alternative name of the company
          example: Acme GmbH
        street:
          type: string
          description: Street and street number where the address is located
          example: 123 Main St
        addressAdditional:
          type: string
          description: >-
            Additional address data (e.g. building, entrance, apartment, or
            suite)
          example: Building A, Suite 101
        postcode:
          type: string
          description: Postcode where the address is located
          example: '12345'
        city:
          type: string
          description: City where the address is located
          example: Berlin
        postOfficeBox:
          type: string
          description: Post office box number, if used instead of street address
          example: PO Box 123
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        region:
          type: string
          description: >-
            Region, state, or province of the address (e.g. "CA" for California
            or "BE" for Berlin)
          example: BE
        transportationZone:
          type: string
          description: >-
            Code identifying the transportation or logistics zone relevant for
            shipping or route planning
          example: TZ123
        phoneNumber:
          type: string
          description: Phone number of the location or contact point
          example: '+491234567890'
        faxNumber:
          type: string
          description: Fax number of the location or contact point
          example: '+491234567891'
        email:
          type: string
          description: Email address associated with the location or contact point
          example: contact@acme.com
        validFrom:
          type: string
          format: date
          description: >-
            Start date from which the address is considered valid (format:
            YYYY-MM-DD)
          example: '2023-01-01'
        validTo:
          type: string
          format: date
          description: >-
            End date until which the address is considered valid (format:
            YYYY-MM-DD)
          example: '2023-12-31'
        isDefault:
          type: boolean
          description: >-
            Indicator whether this address is the default for the given type
            (e.g., default ship-to address)
          example: true
        latitude:
          type: number
          description: Geographical latitude coordinate of the address (in decimal degrees)
          example: 52.520008
        longitude:
          type: number
          description: >-
            Geographical longitude coordinate of the address (in decimal
            degrees)
          example: 13.404954
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    quote:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          pattern: ^\S+$
          description: >-
            External id of the sales order that is globally unique across the
            provided sales order data
          example: QUOTE12345
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: CLIENT123
        documentId:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: DOC12345
        documents:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Document id that was assigned during upload to Hypatos
                example: DOC12345
              type:
                type: string
                description: Document type that was assigned during upload to Hypatos
                example: invoice
        quoteNumber:
          type: string
          description: Quote number from the source system
          example: Q12345
        customerOrderNumber:
          type: string
          description: Customer order number the quote refers to
          example: CO12345
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system
          example: COMP123
        externalCustomerId:
          type: string
          description: External unique id of the customer in the source system
          example: CUST123
        status:
          type: string
          description: Status of the quote
          example: approved
        salesOrganizationCode:
          type: string
          description: Sales organization code
          example: SO123
        distributionChannel:
          type: string
          description: Distribution channel code
          example: DC123
        division:
          type: string
          description: Division code
          example: DIV123
        salesGroup:
          type: string
          description: Sales group responsible for the quote
          example: '123'
        salesOffice:
          type: string
          description: Sales office responsible for the quote
          example: '456'
        type:
          type: string
          description: Type of the quote as defined in the source system
          example: standard
        subType:
          type: string
          description: Sub-type of the quote as defined in the source system
          example: recurring
        issuedDate:
          type: string
          format: date
          description: Date when the quote was issued
          example: '2023-01-01'
        validUntilDate:
          type: string
          format: date
          description: Date until the quote is valid
          example: '2023-12-31'
        fiscalYearLabel:
          type: string
          description: Fiscal year label used in the source system
          example: FY2023
        isCanceled:
          type: boolean
          description: Indicator if the quote is canceled
          example: false
        currency:
          type: string
          description: Three letter currency code as defined in ISO 4217
          example: USD
        totalNetAmount:
          type: number
          description: Total net amount of the quote
          example: 1000
        totalTaxAmount:
          type: number
          description: Total tax amount of the quote
          example: 190
        totalGrossAmount:
          type: number
          description: Total gross amount of the quote
          example: 1190
        paymentTerms:
          $ref: '#/components/schemas/paymentTerms'
        headerText:
          type: string
          description: Header text describing the quote
          example: This is a sample quote.
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        quoteLines:
          type: array
          items:
            type: object
            properties:
              quoteLineNumber:
                type: string
                description: Quote line number
                example: QL12345
              externalCompanyId:
                type: string
                description: Company the quote line is assigned to
                example: COMP123
              product:
                type: object
                properties:
                  externalId:
                    type: string
                    description: External ID of the quoted product
                    example: PROD123
                  productNumber:
                    type: string
                    description: Product number
                    example: PN123
                  customerProductNumber:
                    type: string
                    description: Customer-specific product number
                    example: CPN123
                  type:
                    type: string
                    description: Product type
                    example: standard
                  group:
                    type: string
                    description: Product group
                    example: electronics
                  description:
                    type: string
                    description: Product description
                    example: A high-quality electronic product.
                  manufacturer:
                    type: string
                    description: Manufacturer of the product
                    example: Acme Corp.
                  manufacturerNumber:
                    type: string
                    description: Manufacturer-specific number
                    example: MN123
                  unspsc:
                    type: string
                    description: UNSPSC classification code
                    example: '43211508'
                  ean:
                    type: string
                    description: European Article Number (EAN-13)
                    example: '4006381333931'
                  upc:
                    type: string
                    description: Universal Product Code (UPC-A)
                    example: '036000291452'
              status:
                type: string
                description: Status of the quote line
                example: approved
              quantity:
                type: number
                description: Quoted quantity
                example: 10
              unitOfMeasure:
                type: string
                description: Unit of measure
                example: kg
              unitPrice:
                type: number
                description: Unit price
                example: 100
              netAmount:
                type: number
                description: Net amount of the quote line
                example: 1000
              totalTaxAmount:
                type: number
                description: Tax amount of the quote line
                example: 190
              grossAmount:
                type: number
                description: Gross amount of the quote line
                example: 1190
              taxCode:
                $ref: '#/components/schemas/taxCode'
              description:
                type: string
                description: Quote line description
                example: This is a sample quote line.
              plant:
                type: string
                description: Plant code
                example: PLANT123
              storageLocation:
                type: string
                description: Storage location
                example: LOC123
              externalShippingAddressId:
                type: string
                description: External shipping address ID
                example: ADDR123
              externalBillingAddressId:
                type: string
                description: External billing address ID
                example: ADDR456
              itemText:
                type: string
                description: Text describing the quote item
                example: Sample item text.
              type:
                type: string
                description: Type of the quote item
                example: standard
              externalContractId:
                type: string
                description: Related external contract ID
                example: CONTRACT123
              customFields:
                $ref: '#/components/schemas/customFields'
              customMetadata:
                $ref: '#/components/schemas/JsonObject'
    goodsReceiptLine:
      type: object
      description: Represents a single line item within a goods receipt.
      properties:
        goodsReceiptLineNumber:
          type: string
          description: Number of the goods receipt line (unique within the purchase order)
          example: GRLINE-0001
        externalCompanyId:
          type: string
          description: Company ID associated with the line item.
          example: DE01
        externalPurchaseOrderId:
          type: string
          description: ID of the related purchase order.
          example: '4500016221'
        purchaseOrderLineNumber:
          type: string
          description: Line number of the purchase order being received.
          example: '00010'
        type:
          type: string
          description: Type of item received (e.g., Material, Service).
          example: Service
        quantity:
          type: number
          format: double
          description: Quantity of items received.
          example: 2
        unitOfMeasure:
          type: string
          description: Unit of measure for the quantity.
          example: kg
        itemText:
          type: string
          description: Descriptive text for the line item.
          example: Dell Laptop Latitude D630
        status:
          type: string
          description: >-
            Status of goods receipt line as defined in source system (e.g.
            “invoiced” or “open”)
          example: invoiced
        material:
          $ref: '#/components/schemas/material'
        plant:
          type: string
          description: Receiving plant or location.
          example: PLANT-001
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    goodsReceipt:
      type: object
      required:
        - externalId
        - goodsReceiptLines
      properties:
        externalId:
          type: string
          description: >-
            External id of the goods receipt that is globally unique across the
            provided goods receipt data
          example: GOODS_RECEIPT-0001
          pattern: ^\S+$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        documentId:
          type: string
          description: Document id that was assigned during upload to Hypatos
          example: 63cac12c37bb02accb396cbf
          pattern: ^[0-9a-fA-F]{24}$
        documents:
          type: array
          items:
            $ref: '#/components/schemas/document'
        goodsReceiptNumber:
          type: string
          description: Goods receipt number provided in the source system
          example: GR123456789
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system
          example: DE01
        externalSupplierId:
          type: string
          description: External unique id of the supplier in the source system
          example: '0000100000'
        fiscalYearLabel:
          type: string
          description: >-
            Label used in the source system for the fiscal year that the goods
            receipt was posted in
          example: '2023'
        issuedDate:
          type: string
          description: Date when the good receipt document was issued
          format: date
          example: '2024-12-31'
        createdDate:
          type: string
          description: Date when the goods receipt was created in the source system
          format: date
          example: '2025-06-30'
        postingDate:
          type: string
          description: Date when the goods receipt was posted
          format: date
          example: '2025-06-30'
        headerText:
          type: string
          description: Header text describing the goods receipt
          example: doc header text
        status:
          type: string
          description: Status of the goods receipt as defined in the source system
          example: POSTED
        deliveryNoteNumber:
          type: string
          description: Delivery note number associated with the goods receipt
          example: DN789456123
        isReversal:
          type: boolean
          description: Indicator if the goods receipt is a reversal
          example: false
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
        goodsReceiptLines:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/goodsReceiptLine'
    profitCenter:
      type: object
      required:
        - externalId
        - code
      properties:
        externalId:
          type: string
          description: >-
            External id of the profit center that is globally unique across the
            provided profit center data
          example: 0000100CO1
          pattern: ^\S([\S ]*\S)?$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: EXTERNAL_CLIENT_ID
        code:
          type: string
          description: >-
            Code of the profit center in the source system (not unique across
            clients)
          example: CO1
          pattern: ^\S([\S ]*\S)?$
        companyAssignment:
          type: array
          description: List of externalCompanyIds that the profit center is assigned to
          example:
            - DE01
            - US01
          items:
            type: string
        department:
          type: string
          description: >-
            Department/functional area associated with the profit center as
            defined in the source system
          example: finance
        label:
          type: array
          description: Label describing the profit center
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Sales Engineers
              language: en
        shortLabel:
          type: array
          description: Short label describing the profit center
          items:
            $ref: '#/components/schemas/languagedText'
          example:
            - text: Sales Eng.
              language: en
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    internalOrder:
      type: object
      required:
        - externalId
        - internalOrderCode
      properties:
        externalId:
          type: string
          description: >-
            External id of the internal order that is globally unique across the
            provided order data
          example: SAP:AUFK:000300123456
          pattern: ^\S([\S ]*\S)?$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: '100'
        internalOrderCode:
          type: string
          description: >-
            Internal order code/number from the source system (not unique across
            clients)
          example: '000300123456'
          pattern: ^\S([\S ]*\S)?$
        internalOrderReferenceNumber:
          type: string
          description: Additional internal order reference number from the source system
          example: ABC1234
        createdDate:
          type: string
          description: >-
            Date when the internal order record was created in the source system
            (YYYY-MM-DD)
          format: date
          example: '2025-02-10'
        fiscalYearLabel:
          type: string
          description: >-
            Label used in the source system for the fiscal year relevant to the
            internal order
          example: '2023'
        language:
          $ref: '#/components/schemas/LanguageCode'
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system.
          example: DE01
        status:
          type: string
          description: Lifecycle status of the internal order
          example: OPEN
        type:
          type: string
          description: Order type/category as defined in the source system
          example: overhead
        subType:
          type: string
          description: >-
            Sub-classification of the internal order as defined in the source
            system
          example: category
        description:
          type: string
          description: Long description of the internal order
          example: Marketing campaign Q2 2025 – brand awareness and lead generation
        shortDescription:
          type: string
          description: Short description used in UIs and search
          example: MKT Q2/2025
        profitCenterCode:
          type: string
          description: Assigned profit center code
          example: PC4100
        costCenterCodeForSettlement:
          type: string
          description: >-
            Default receiver cost center used when settling the internal order
            (if applicable)
          example: CC4105
        glAccountCodeForSettlement:
          type: string
          description: >-
            Default G/L account (or cost element) used for settlement postings
            where relevant
          example: GL3094
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
    project:
      type: object
      required:
        - externalId
        - code
      properties:
        externalId:
          type: string
          description: >-
            External id of the project that is globally unique across the
            provided project data
          example: SAP:PRPS:0000123456
          pattern: ^\S([\S ]*\S)?$
        externalClientId:
          type: string
          description: >-
            Identifier of the client entity in the source system which can be
            used to separate data
          example: '100'
        code:
          type: string
          description: Code of the project in the source system (not unique across clients)
          example: PROJ1234
        projectReferenceNumber:
          type: string
          description: Use for converted WBS Element number
          example: PRJ-2025-BER-GRID
        createdDate:
          type: string
          description: Date when the project was created
          format: date
          example: '2025-01-15'
        fiscalYearLabel:
          type: string
          description: Label used in the source system for the fiscal year
          example: '2025'
        language:
          $ref: '#/components/schemas/LanguageCode'
        externalCompanyId:
          type: string
          description: External unique id of the company in the source system
          example: DE01
        status:
          type: string
          description: Current status of the project
          example: OPEN
        startDate:
          type: string
          description: Project start date
          format: date
          example: '2025-01-01'
        endDate:
          type: string
          description: Project end date
          format: date
          example: '2025-01-01'
        type:
          type: string
          description: Type of the project
          example: consulting
        description:
          type: string
          description: Detailed description of the project
          example: >-
            Reinforcement of Berlin transmission grid, including substation
            upgrades and cable replacements.
        shortDescription:
          type: string
          description: Short description of the project
          example: Berlin Grid Upgrade
        profitCenterCode:
          type: string
          description: Code of the profit center associated with the project
          example: PC1001
        responsibleCostCenterCode:
          type: string
          description: Code of the responsible cost center
          example: CC2005
        costCenterCodeForPosting:
          type: string
          description: Code of the cost center for posting transactions
          example: CC3002
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        subProjectCode:
          type: string
          description: Code of the sub-project if applicable
          example: BER-GRID-01
        parentProjectCode:
          type: string
          description: Code of the parent project if applicable
          example: PRJ-2025-INFRA
        customFields:
          $ref: '#/components/schemas/customFields'
        customMetadata:
          $ref: '#/components/schemas/JsonObject'
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /auth/token
          scopes:
            companies.read: Read companies
            documents.read: Read documents
            documents.write: Edit your documents
            enrichment.read: Read enrichment training data
            enrichment.write: Create/edit enrichment training data
            enrichment.delete: Delete enrichment training data
            files.read: Uploading files for processing
            files.write: Downloading uploaded files
            projects.write: Create/edit projects data
            projects.read: Read projects data
            emails.read: Read emails data
    Basic:
      type: http
      scheme: basic
  responses:
    DocumentErrorResponse:
      description: Error occured while processing request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: The document with given identifier does not exist
            status: 404
            title: Document does not exist
    successfullyInserted:
      description: Successfully inserted
      content:
        application/json:
          schema:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                example: 3a429dc8-56d4-42ef-a4cf-2ebc9ad1ef38
    validationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
    unsupportedMediaType:
      description: Unsupported media type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
    notFound:
      description: Not Found error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            status: 404
            title: Not found
    UnauthorizedErrorResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Provided no credentials or invalid credentials
            status: 401
            title: Unauthorized
    ForbiddenErrorResponse:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Not enough privileges to perform an action on a resource
            status: 403
            title: Forbidden
    ProjectClientBadRequestErrorResponse:
      description: Response when client request is wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Invalid request parameter:
              value:
                detail: One of the given query parameters is invalid
                status: 400
                title: Provided project identifier is invalid
            Invalid payload data:
              value:
                detail: Payload data couldn't be deserialised
                status: 400
                title: Payload data is invalid
    ProjectRequestValidationErrorResponse:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Request validation error:
              value:
                detail: Error details
                status: 422
                title: Request validation error
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 500
            title: Internal Server Error
            detail: Error details
    SchemaClientBadRequestErrorResponse:
      description: Response when client request is wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Invalid request parameter:
              value:
                detail: One of the given query parameters is invalid
                status: 400
                title: Provided project identifier is invalid
            Invalid payload data:
              value:
                detail: One or more of the payload parameters are invalid
                status: 400
                title: Provided payload is invalid
    NotFoundErrorResponse:
      description: Response when resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            Project not found:
              value:
                detail: The project with given identifier does not exist
                status: 404
                title: Project does not exist
    BadRequest:
      description: The request was malformed or missing required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    Forbidden:
      description: The caller is not permitted to access the resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    NotFound:
      description: |
        The requested document, or a transformation rule for the given
        `projectId`, was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    UnprocessableEntity:
      description: One or more request fields failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    InternalServerError:
      description: |
        An unexpected error occurred. For failures propagated from Studio, the
        original upstream payload is returned as XML rather than this JSON
        envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-reset:
          $ref: '#/components/headers/x-ratelimit-reset'
  parameters:
    ProjectIdPathParameter:
      in: path
      name: id
      schema:
        $ref: '#/components/schemas/ProjectId'
      required: true
      description: Project id
    pagingOffset:
      in: query
      name: offset
      schema:
        type: integer
        minimum: 0
      required: false
      description: A zero-based offset of the first item in the data collection to return.
    sortByCreatedAt:
      in: query
      name: sort
      schema:
        type: string
        enum:
          - '-createdAt'
          - +createdAt
        default: '-createdAt'
      required: false
      description: The field to sort reponse items by.
    isLive:
      in: query
      name: isLive
      required: false
      schema:
        type: boolean
    ProjectIdQuery:
      name: projectId
      in: query
      required: true
      description: |
        Project identifier. Also selects the XSLT transformation rule applied
        to the Studio response (`{projectId}` for single documents,
        `{projectId}-list` for lists).
      schema:
        type: string
    projectId:
      in: query
      name: projectId
      schema:
        type: array
        items:
          type: string
      style: form
      explode: true
      required: false
      description: >-
        Project ids to to find items by. If ommitted, items from all existing
        projects are returned.
    parameters-pagingLimit:
      in: query
      name: limit
      schema:
        type: integer
        default: 20
        minimum: 0
        maximum: 50
      required: false
      description: >-
        Limit the amount of items returned in the response. If the value exceeds
        the maximum, then the maximum value will be used.
    sortByCreatedAtUpdatedAt:
      in: query
      name: sort
      schema:
        type: string
        enum:
          - createdAt
          - '-createdAt'
          - +createdAt
          - updatedAt
          - '-updatedAt'
          - +updatedAt
        default: '-createdAt'
      required: false
      description: The field to sort reponse items by.
  headers:
    x-ratelimit-limit:
      description: >-
        Indicates the request-quota associated to the client in the current
        time-window followed by the description of the quota policy.
      schema:
        type: string
      example: 10, 10;w=1
    x-ratelimit-remaining:
      description: The number of remaining requests in the current time-window
      schema:
        type: integer
      example: 94
    x-ratelimit-reset:
      description: The number of seconds until quota reset of the current time-window
      schema:
        type: integer
      example: 21
