openapi: 3.1.0
info:
  title: e-Financials
  version: '1.0'
  summary: e-Financials API
  description: |
    API for interfacing with e-Financials

    ### 01.10.2026

      - Journal, posting and invoice responses are now built from explicit field lists.
        The returned fields are otherwise unchanged, except that sale- and purchase-invoice
        items no longer include the internal `andmesild_classifiers` field.
      - `Journals` documents `register_date` and `is_deleted`, which the API already
        returned.
      - `PurchaseInvoicesItems` documents `vat_amount`, which the API already returned.
      - Sale- and purchase-invoice items ignore an `andmesild_classifiers` field on
        input. The classifiers are derived from product, account, client and company
        settings when the invoice is registered.
      - When a mandatory line classifier is missing or not allowed, registering a sale or
        purchase invoice returns 409. The first message explains that line classifiers are
        derived from settings. The following messages name the failed checks.
      - Purchase-invoice items default `cl_fringe_benefits_id` to 1 (no fringe benefit) when the
        field is omitted or null. Previously the create or update failed with HTTP 500. An update
        replaces all items, so send the field again to keep an existing fringe benefit.

    ### 22.06.2026

      - `GET /journals` includes opening-balance entries (`operation_type=INITIAL`); previously they were filtered out, 
        so any account balance computed from `/journals` data was missing the opening figures.
      - Opening-balance postings are normalized in API responses: the on-disk `type='I'` signed-amount encoding is 
        translated to explicit `D`/`C` with non-negative `amount`/`base_amount`, so consumers can sum postings uniformly
        across all operation types.
      - `PATCH /journals/{id}` accepts the same normalized `D`/`C` posting shape for opening-balance entries — 
        the API translates back to the on-disk signed-amount encoding using each account's `balance_type`. 
        Editing a registered INITIAL journal still requires the usual `invalidate` → `PATCH` → `register` round-trip.
      - `POST /journals` cannot create an INITIAL journal — the `operation_type` field is ignored on input (it stays 
        UI-managed because only one INITIAL is allowed per company).
      - `Postings.type` is now declared as an `enum` of `C` / `D`.
      - `GET /journals` accepts an `operation_type` query parameter to filter by entry type.
      - `Journals.operation_type` now declares an `enum` of every value the API may return.
      - The internal `sys_last_updated` field (never part of the `Postings` schema) is no longer included on postings
        in the `GET /journals` list response, matching `GET /journals/{id}`.

    ### 08.05.2026

      - `Postings.journals_id` is now `readOnly` and no longer listed in the request body's `required`; 
        the API derives it from the parent journal.
      - `ApiFile.required` lists `name` and `contents` instead of a nonexistent `code` field (affects every document 
        upload/download endpoint).
      - `SaleInvoicesDeliveryRequest.required` lists `send_einvoice` and `send_email` (previously listed `can_send_*` 
        variants that don't exist on the request schema).
      - `DELETE /sale_invoices/{id}/document` documents the correct response shapes: `200` returns 
        `SaleInvoicesDeliveryOptions`, `409` returns `ApiResponse` (previously swapped).
      - Several array `items: integer` shorthands corrected to a proper `items` object with `type: integer` so strict
        OAS 3.1 validators accept the spec.

    ### 31.01.2022

      Added the /templates service for querying sales invoice templates

    ### 27.01.2022

      First public version
  contact:
    name: e-Financials API support
    url: 'https://abiinfo.rik.ee/e-arveldaja/e-arveldaja-api'
    email: earveldaja.api@rik.ee
  termsOfService: 'https://e-arveldaja.rik.ee/static/web/contracts/API_kasutustingimused.pdf'
  license:
    name: e-Financials API License
    url: 'https://e-arveldaja.rik.ee/static/web/contracts/API_kasutustingimused.pdf'
servers:
  - url: 'https://rmp-api.rik.ee/v1'
    description: e-Financials API server
paths:
  /clients:
    get:
      operationId: get-clients
      summary: Get Clients
      description: Retrieve the client list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfClients'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
    post:
      operationId: post-clients
      summary: Create Client
      description: Create a new client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Clients'
        description: Description
  '/clients/{clients_id}':
    get:
      operationId: get-clients_one
      summary: Get Client
      description: Retrieve one specific client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Clients'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: clients_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-clients_one
      summary: Update Client
      description: Modify one specific client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Clients'
        description: Description
      parameters:
        - schema:
            type: integer
          name: clients_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-clients_one
      summary: Delete Client
      description: Delete one specific client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: clients_id
          in: path
          required: true
          description: Object identificator
  '/clients/{clients_id}/deactivate':
    patch:
      operationId: patch-clients_one_deactivate
      summary: Deactivate Client
      description: Deactivate one specific client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: clients_id
          in: path
          required: true
          description: Object identificator
  '/clients/{clients_id}/reactivate':
    patch:
      operationId: patch-clients_one_reactivate
      summary: Reactivate Client
      description: Reactivate one specific client of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: clients_id
          in: path
          required: true
          description: Object identificator
  /products:
    get:
      operationId: get-products
      summary: Get Products
      description: Retrieve the product list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfProducts'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
    post:
      operationId: post-products
      summary: Create Product
      description: Create a new product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Products'
        description: Description
  '/products/{products_id}':
    get:
      operationId: get-products_one
      summary: Get Product
      description: Retrieve one specific product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Products'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: products_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-products_one
      summary: Update Product
      description: Modify one specific product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Products'
        description: Description
      parameters:
        - schema:
            type: integer
          name: products_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-products_one
      summary: Delete Product
      description: Delete one specific product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: products_id
          in: path
          required: true
          description: Object identificator
  '/products/{products_id}/deactivate':
    patch:
      operationId: patch-products_one_deactivate
      summary: Deactivate Product
      description: Deactivate one specific product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: products_id
          in: path
          required: true
          description: Object identificator
  '/products/{products_id}/reactivate':
    patch:
      operationId: patch-products_one_reactivate
      summary: Reactivate Product
      description: Reactivate one specific product of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: products_id
          in: path
          required: true
          description: Object identificator
  /projects:
    get:
      operationId: get-projects
      summary: Get Cost/Profit Centres
      description: Retrieve the cost/profit centres list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfProjects'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
  /journals:
    get:
      operationId: get-journals
      summary: Get Journals
      description: |-
        Retrieve the journal entry list of the specified company.

        Opening-balance entries ("algbilansi kanded") are returned alongside
        regular entries and can be distinguished by `operation_type=INITIAL`.
        Use the `operation_type` query parameter to filter to one type.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfJournals'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
        - schema:
            type: string
            format: date
          in: query
          name: start_date
          description: Effective date on given date or later
        - schema:
            type: string
            format: date
          in: query
          name: end_date
          description: Effective date on given date or before
        - schema:
            type: string
          in: query
          name: operation_type
          description: |-
            Return only entries with this operation_type
            (e.g. `INITIAL` for opening-balance entries, `ENTRY` for manual
            entries). See the `operation_type` enum on the `Journals` schema.
    post:
      operationId: post-journals
      summary: Create Journal Entry
      description: Create a new journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Journals'
        description: Description
  '/journals/{journals_id}':
    get:
      operationId: get-journals_one
      summary: Get Journal
      description: Retrieve one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Journals'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-journals_one
      summary: Update Journal Entry
      description: |-
        Modify one specific journal entry of the specified company.

        Opening-balance entries (`operation_type=INITIAL`) accept the same
        `D`/`C` posting shape every other endpoint uses; the API translates
        them into the on-disk signed-amount encoding based on each account's
        `balance_type`, so callers can GET an opening balance, adjust an
        amount, and PATCH it back without thinking about the internal `I`
        encoding.

        Registered journals only accept `title` / `document_number` changes
        here; to edit postings on a registered INITIAL journal, first
        `PATCH /journals/{id}/invalidate` to un-register it, then PATCH with
        the new postings, then `PATCH /journals/{id}/register` to re-register.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Journals'
        description: Description
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-journals_one
      summary: Delete Journal Entry
      description: Delete one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
  '/journals/{journals_id}/register':
    patch:
      operationId: patch-journals_one_register
      summary: Register Journal Entry
      description: Register one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
  '/journals/{journals_id}/invalidate':
    patch:
      operationId: patch-journals_one_invalidate
      summary: Invalidate Journal Entry
      description: Invalidate one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
  '/journals/{journals_id}/document_user':
    get:
      operationId: get-journals_one_document_user
      summary: Get Journal File
      description: Retrieve the document related to a journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
    put:
      operationId: put-journals_one_document_user
      summary: Update Journal Entry File
      description: Modify the file related to one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiFile'
        description: Description
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-journals_one_document_user
      summary: Delete Journal Entry File
      description: Delete the file related to one specific journal entry of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: journals_id
          in: path
          required: true
          description: Object identificator
  /invoice_info:
    get:
      operationId: get-invoice_info
      summary: Get Invoice Settings
      description: Retrieve the invoice settings of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInvoiceInfo'
              examples: {}
        '401':
          description: Unauthorized
    patch:
      operationId: patch-invoice_info
      summary: Update Invoice Settings
      description: Update the invoice settings of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyInvoiceInfo'
        description: Description
  /invoice_series:
    get:
      operationId: get-invoice_series
      summary: Get Invoice Series
      description: Retrieve the invoice series list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InvoiceSeries'
              examples: {}
        '401':
          description: Unauthorized
    post:
      operationId: post-invoice_series
      summary: Create Invoice Series
      description: Create a new invoice series of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceSeries'
        description: Description
  '/invoice_series/{invoice_series_id}':
    get:
      operationId: get-invoice_series_one
      summary: Get Invoice Series
      description: Retrieve one specific invoice series of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceSeries'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: invoice_series_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-invoice_series_one
      summary: Update Invoice Series
      description: Modify one specific invoice series of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceSeries'
        description: Description
      parameters:
        - schema:
            type: integer
          name: invoice_series_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-invoice_series_one
      summary: Delete Invoice Series
      description: Delete one specific invoice series of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: invoice_series_id
          in: path
          required: true
          description: Object identificator
  /bank_accounts:
    get:
      operationId: get-bank_accounts
      summary: Get Bank Accounts
      description: Retrieve the bank account list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BankAccounts'
              examples: {}
        '401':
          description: Unauthorized
    post:
      operationId: post-bank_accounts
      summary: Create Bank Account
      description: Create a new bank account of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccounts'
        description: Description
  '/bank_accounts/{bank_accounts_id}':
    get:
      operationId: get-bank_accounts_one
      summary: Get Bank Account
      description: Retrieve one specific bank account of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccounts'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: bank_accounts_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-bank_accounts_one
      summary: Update Bank Account
      description: Modify one specific bank account of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccounts'
        description: Description
      parameters:
        - schema:
            type: integer
          name: bank_accounts_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-bank_accounts_one
      summary: Delete Bank Account
      description: Delete one specific bank account of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: bank_accounts_id
          in: path
          required: true
          description: Object identificator
  /vat_info:
    get:
      operationId: get-vat_info
      summary: Get VAT Information
      description: Retrieve the VAT information of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyVatInfo'
              examples: {}
        '401':
          description: Unauthorized
  /accounts:
    get:
      operationId: get-accounts
      summary: Get Account List
      description: Retrieve the account structure of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Accounts'
        '401':
          description: Unauthorized
  /account_dimensions:
    get:
      operationId: get-account_dimensions
      summary: Get Account Dimension List
      description: Retrieve the account dimensions (subaccounts) of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountsDimensions'
        '401':
          description: Unauthorized
  /currencies:
    get:
      operationId: get-currencies
      summary: Get Currency List
      description: Retrieve the active currencies of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Currencies'
        '401':
          description: Unauthorized
  /purchase_articles:
    get:
      operationId: get-purchase_articles
      summary: Get Purchase Article List
      description: Retrieve the purchase articles of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PurchaseArticles'
              examples: {}
        '401':
          description: Unauthorized
  /sale_articles:
    get:
      operationId: get-sale_articles
      summary: Get Sale Article List
      description: Retrieve the sale articles of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SaleArticles'
        '401':
          description: Unauthorized
  /transactions:
    get:
      operationId: get-transactions
      summary: Get Transactions
      description: Retrieve the transaction list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfTransactions'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
        - schema:
            type: string
            format: date
          in: query
          name: start_date
          description: Date on given date or later
        - schema:
            type: string
            format: date
          in: query
          name: end_date
          description: Date on given date or before
        - schema:
            type: string
            enum:
              - PROJECT
              - CONFIRMED
              - VOID
          in: query
          name: status
          description: Object status
        - schema:
            type: string
            enum:
              - C
              - D
          in: query
          name: type
          description: Object type
        - schema:
            type: integer
          in: query
          name: clients_id
          description: Customer
    post:
      operationId: post-transactions
      summary: Create Transaction
      description: Create a new transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Transactions'
        description: Description
  '/transactions/{transactions_id}':
    get:
      operationId: get-transactions_one
      summary: Get Transaction
      description: Retrieve one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transactions'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-transactions_one
      summary: Update Transaction
      description: Modify one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Transactions'
        description: Description
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-transactions_one
      summary: Delete Transaction
      description: Delete one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
  '/transactions/{transactions_id}/register':
    patch:
      operationId: patch-transactions_one_register
      summary: Register Transaction
      description: Register one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionsDistributions'
        description: Description
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
  '/transactions/{transactions_id}/invalidate':
    patch:
      operationId: patch-transactions_one_invalidate
      summary: Invalidate Transaction
      description: Invalidate one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
  '/transactions/{transactions_id}/document_user':
    get:
      operationId: get-transactions_one_document_user
      summary: Get Transaction File
      description: Retrieve the document related to a transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
    put:
      operationId: put-transactions_one_document_user
      summary: Update Transaction File
      description: Modify the file related to one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiFile'
        description: Description
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-transactions_one_document_user
      summary: Delete Transaction File
      description: Delete the file related to one specific transaction of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: transactions_id
          in: path
          required: true
          description: Object identificator
  /sale_invoices:
    get:
      operationId: get-sale_invoices
      summary: Get Sale Invoices
      description: Retrieve the sale invoice list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfSaleInvoices'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
        - schema:
            type: string
            format: date
          in: query
          name: start_date
          description: Object revenue date on given date or later
        - schema:
            type: string
            format: date
          in: query
          name: end_date
          description: Object revenue date on given date or before
        - schema:
            type: string
            enum:
              - PROJECT
              - CONFIRMED
          in: query
          name: status
          description: Object status
        - schema:
            type: string
            enum:
              - PAID
              - PARTIALLY_PAID
              - NOT_PAID
          in: query
          name: payment_status
          description: Object payment status
        - schema:
            type: integer
          in: query
          name: clients_id
          description: Customer
    post:
      operationId: post-sale_invoices
      summary: Create Sale Invoice
      description: Create a new sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaleInvoices'
        description: Description
  '/sale_invoices/{sale_invoices_id}':
    get:
      operationId: get-sale_invoices_one
      summary: Get Sale Invoice
      description: Retrieve one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleInvoices'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-sale_invoices_one
      summary: Update Sale Invoice
      description: Modify one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaleInvoices'
        description: Description
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-sale_invoices_one
      summary: Delete Sale Invoice
      description: Delete one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/register':
    patch:
      operationId: patch-sale_invoices_one_register
      summary: Register Sale Invoice
      description: Register one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/invalidate':
    patch:
      operationId: patch-sale_invoices_one_invalidate
      summary: Invalidate Sale Invoice
      description: Invalidate one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/xml':
    get:
      operationId: get-sale_invoices_one_xml
      summary: Get Sale Invoice XML File, System-generated
      description: Retrieve the system-generated XML e-invoice related to a sale-invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/pdf_system':
    get:
      operationId: get-sale_invoices_one_document_system
      summary: Get Sale Invoice File, System-generated
      description: Retrieve the system-generated document related to a sale-invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/document_user':
    get:
      operationId: get-sale_invoices_one_document_user
      summary: Get Sale Invoice File, User-uploaded
      description: Retrieve the user-uploaded document related to a sale-invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
    put:
      operationId: put-sale_invoices_one_document_user
      summary: Update Sale Invoice File
      description: Modify the file related to one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiFile'
        description: Description
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-sale_invoices_one_document_user
      summary: Delete Sale Invoice File
      description: Delete the file related to one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/delivery_options':
    get:
      operationId: get-sale_invoices_one_delivery_opts
      summary: Get Sale Invoice Delivery Options
      description: Retrieve delivery options for one specific sale invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleInvoicesDeliveryOptions'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  '/sale_invoices/{sale_invoices_id}/deliver':
    patch:
      operationId: patch-sale_invoices_one_deliver
      summary: Send sale invoice to the customer
      description: Send one specific sale invoice of the specified company to the customer using supported methods.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaleInvoicesDeliveryRequest'
        description: Description
      parameters:
        - schema:
            type: integer
          name: sale_invoices_id
          in: path
          required: true
          description: Object identificator
  /purchase_invoices:
    get:
      operationId: get-purchase_invoices
      summary: Get Purchase Invoices
      description: Retrieve the purchase invoice list of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfPurchaseInvoices'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
            minimum: 1
            default: 1
          in: query
          name: page
          description: Page of responses to return
        - schema:
            type: string
            format: date-time
          in: query
          name: modified_since
          description: Return only objects modified since provided timestamp
        - schema:
            type: string
            format: date
          in: query
          name: start_date
          description: Object created on given date or later
        - schema:
            type: string
            format: date
          in: query
          name: end_date
          description: Object created on given date or before
        - schema:
            type: string
            enum:
              - PROJECT
              - CONFIRMED
          in: query
          name: status
          description: Object status
        - schema:
            type: string
            enum:
              - PAID
              - PARTIALLY_PAID
              - NOT_PAID
          in: query
          name: payment_status
          description: Object payment status
        - schema:
            type: integer
          in: query
          name: clients_id
          description: Supplier
    post:
      operationId: post-purchase_invoices
      summary: Create Purchase Invoice
      description: Create a new purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseInvoices'
        description: Description
  '/purchase_invoices/{purchase_invoices_id}':
    get:
      operationId: get-purchase_invoices_one
      summary: Get Purchase Invoice
      description: Retrieve one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseInvoices'
              examples: {}
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
    patch:
      operationId: patch-purchase_invoices_one
      summary: Update Purchase Invoice
      description: Modify one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseInvoices'
        description: Description
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-purchase_invoices_one
      summary: Delete Purchase Invoice
      description: Delete one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
  '/purchase_invoices/{purchase_invoices_id}/register':
    patch:
      operationId: patch-purchase_invoices_one_register
      summary: Register Purchase Invoice
      description: Register one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
  '/purchase_invoices/{purchase_invoices_id}/invalidate':
    patch:
      operationId: patch-purchase_invoices_one_invalidate
      summary: Invalidate Purchase Invoice
      description: Invalidate one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
  '/purchase_invoices/{purchase_invoices_id}/document_user':
    get:
      operationId: get-purchase_invoices_one_document_user
      summary: Get Purchase Invoice File, User-uploaded
      description: Retrieve the user-uploaded document related to a purchase-invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiFile'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
    put:
      operationId: put-purchase_invoices_one_document_user
      summary: Update Purchase Invoice File
      description: Modify the file related to one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiFile'
        description: Description
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
    delete:
      operationId: delete-purchase_invoices_one_document_user
      summary: Delete Purchase Invoice File
      description: Delete the file related to one specific purchase invoice of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      parameters:
        - schema:
            type: integer
          name: purchase_invoices_id
          in: path
          required: true
          description: Object identificator
  /templates:
    get:
      operationId: get-templates
      summary: Get Sale Invoice Templates
      description: Retrieve the sale invoice templates of the specified company.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Templates'
              examples: {}
        '401':
          description: Unauthorized
components:
  schemas:
    ListOfPurchaseInvoices:
      title: List of PurchaseInvoices
      type: object
      description: List of PurchaseInvoices
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseInvoices'
      required:
        - current_page
        - total_pages
        - items
    PurchaseInvoices:
      title: Purchase invoice
      type: object
      description: Purchase invoice
      examples:
        - bank_account_no: null
          bank_payment_orders_id: null
          bank_ref_number: null
          base_document_files_id: null
          base_gross_price: 0
          base_net_price: 0
          base_vat_price: 0
          cash_accounts_dimensions_id: null
          cash_accounts_id: null
          cash_payment_date: null
          cl_currencies_id: EUR
          client_name: Aktsiaselts Kaupmees & Ko
          clients_id: 803
          create_date: '2017-08-09'
          currency_rate: 1
          gross_price: 0
          id: 1983
          is_xls_imported: false
          journal_date: '2017-08-09'
          liability_accounts_dimensions_id: null
          liability_accounts_id: 2310
          net_price: 0
          notes: null
          number: '234234'
          overdue_charge: null
          paid_in_cash: false
          payment_status: PAID
          payment_type: null
          status: CONFIRMED
          subclients_id: null
          term_days: 0
          vat_price: 0
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        base_document_files_id:
          type: integer
          readOnly: true
          description: Reference to file
        bank_payment_orders_id:
          type: integer
          readOnly: true
          description: Reference to payment order
        clients_id:
          type: integer
          description: supplier
        client_name:
          type: string
          maxLength: 200
          description: supplier’s name
        number:
          type: string
          maxLength: 40
          description: invoice number
        create_date:
          type: string
          format: date
          description: invoice date
        journal_date:
          type: string
          format: date
          description: Turnover date
        status:
          type: string
          readOnly: true
          description: Invoice status
        payment_status:
          type: string
          readOnly: true
          description: Payment status
        net_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: net price
        vat_price:
          type: number
          maximum: 1000000000
          description: VAT total
        gross_price:
          type: number
          maximum: 1000000000
          description: gross amount
        payment_type:
          type: string
          maxLength: 20
          description: type
        bank_ref_number:
          type: string
          maxLength: 99999999999999999999
          description: reference number
        bank_account_no:
          type: string
          maxLength: 40
          description: bank account no.
        term_days:
          type: integer
          maximum: 9999
          description: Term days
        overdue_charge:
          type: number
          maximum: 1000
          description: delinquency charge per day
        notes:
          type: string
          maxLength: 4000
          description: other notes
        paid_in_cash:
          type: boolean
          description: Paid in cash
        cash_accounts_id:
          type: integer
          description: Cash Account
        cash_accounts_dimensions_id:
          type: integer
          description: Cash Account Dimension
        liability_accounts_id:
          type: integer
          description: Liability/Receivables account
        liability_accounts_dimensions_id:
          type: integer
          description: Liability/Receivables account
        cl_currencies_id:
          type: string
          maxLength: 3
          description: currency
        currency_rate:
          type: number
          maximum: 1000000000
          description: exchange rate
        base_net_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: net sum in euros
        base_vat_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT total
        base_gross_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: gross amount in euros
        cash_payment_date:
          type: string
          format: date
          description: Date of payment
        subclients_id:
          type: integer
          description: Subclient
        is_xls_imported:
          type: boolean
          readOnly: true
          description: Imported from Excel
        items:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseInvoicesItems'
        journals:
          type: array
          readOnly: true
          description: Related journals, shown only on detailed single object query
          items:
            type: integer
        settlements:
          type: array
          readOnly: true
          description: Related settlements, shown only on detailed single object query
          items:
            type: integer
        transactions:
          type: array
          readOnly: true
          description: Related transactions, shown only on detailed single object query
          items:
            type: integer
      required:
        - clients_id
        - client_name
        - number
        - create_date
        - journal_date
        - term_days
        - cl_currencies_id
    PurchaseInvoicesItems:
      title: Purchase product/service
      type: object
      description: Purchase product/service
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        cl_purchase_articles_id:
          type: integer
          description: Purchase Article
        purchase_accounts_id:
          type: integer
          readOnly: true
          description: Purchase Account
        purchase_accounts_dimensions_id:
          type: integer
          description: Purchase Account Dimension
        cl_fringe_benefits_id:
          type: integer
          default: 1
          description: Fringe benefit. 1 means none and is used when the field is omitted or null.
        amount:
          type: number
          maximum: 1000000000
          description: amount
        unit:
          type: string
          maxLength: 50
          description: Unit price
        unit_net_price:
          type: number
          maximum: 1000000000
          description: unit net price
        total_net_price:
          type: number
          maximum: 1000000000
          description: Product net sum
        base_total_net_price:
          type: number
          readOnly: true
          maximum: 1000000000
          description: Base product net sum
        cl_vat_articles_id:
          type: integer
          description: VAT article
        vat_accounts_id:
          type: integer
          description: VAT account
        vat_accounts_dimensions_id:
          type: integer
          description: VAT account dimension
        vat_rate_dropdown:
          type: string
          maxLength: 200
          description: VAT rate
        vat_rate:
          type: number
          readOnly: true
          maximum: 200
          description: VAT rate
        custom_title:
          type: string
          maxLength: 200
          description: product /service name
        projects_project_id:
          type: integer
          description: cost/profit center (project)
        projects_location_id:
          type: integer
          description: cost/profit center (place)
        projects_person_id:
          type: integer
          description: cost/profit center (person)
        reversed_vat_id:
          type: integer
          description: Reverse charge VAT
        products_id:
          type: integer
          description: Product / Service
        project_no_vat_gross_price:
          type: number
          maximum: 1000000000
          description: Project item gross price
        vat_amount:
          type: number
          readOnly: true
          maximum: 1000000000
          description: VAT amount
      required:
        - custom_title
    ListOfSaleInvoices:
      title: List of SaleInvoices
      type: object
      description: List of SaleInvoices
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/SaleInvoices'
      required:
        - current_page
        - total_pages
        - items
    SaleInvoices:
      title: Sales invoice
      type: object
      description: Sales invoice
      examples:
        - additional_info_content: null
          assembled_in_member_state: false
          bank_accounts_id: null
          bank_payment_orders_id: null
          bank_ref_number: '116758'
          base_document_files_id: null
          base_gross_price: 48729.6
          base_net_price: 40608
          base_vat20_price: 8121.6
          base_vat9_price: 0
          base_vat5_price: 0
          cash_accounts_dimensions_id: null
          cash_accounts_id: null
          cash_payment_date: null
          cl_countries_id: EST
          cl_currencies_id: EUR
          cl_templates_id: 1
          client_name: PAypal
          client_vat_no: null
          clients_id: 126
          contract_number: null
          create_date: '2016-02-15'
          credit_invoice_payment_type: null
          credit_sale_invoices_id: null
          currency_rate: 1
          files_id: 3419
          gross_price: 48729.6
          id: 1698
          intra_community_supply: false
          invoice_content_code: null
          invoice_content_text: null
          invoice_info: null
          is_doubtful: false
          is_hopeless: false
          is_xls_imported: false
          journal_date: '2016-02-15'
          net_price: 40608
          notes: null
          number: NX91
          number_prefix: NX
          number_suffix: '91'
          overdue_charge: 0.15
          paid_in_cash: false
          payment_description: null
          payment_status: null
          period_end_date: null
          period_start_date: null
          receivable_accounts_dimensions_id: null
          receivable_accounts_id: 1210
          recipient_clients_id: null
          recipient_subclients_id: null
          sale_invoice_type: INVOICE
          show_client_balance: false
          status: CONFIRMED
          subclients_id: null
          term_days: 30
          trade_secret: false
          triangulation: false
          triangulation_seller_invoice_vat_no: null
          use_per_item_rounding: false
          vat20_price: 8121.6
          vat9_price: 0
          vat5_price: 0
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        credit_sale_invoices_id:
          type: integer
          description: credit invoice’s reference to the original invoice
        credit_invoice_payment_type:
          type: string
          maxLength: 30
          description: credit invoice payment type
        sale_invoice_type:
          type: string
          maxLength: 30
          description: invoice type
        cl_templates_id:
          type: integer
          description: invoice template
        clients_id:
          type: integer
          description: buyer
        client_name:
          type: string
          maxLength: 200
          description: buyer’s name
        cl_countries_id:
          type: string
          description: the place of supply of goods
        number_prefix:
          type: string
          maxLength: 30
          description: invoice no. prefix
        number_suffix:
          type: string
          maxLength: 30
          description: invoice number
        number:
          type: string
          maxLength: 30
          readOnly: true
          description: invoice number
        create_date:
          type: string
          format: date
          description: invoice date
        journal_date:
          type: string
          format: date
          description: Turnover date
        status:
          type: string
          readOnly: true
          description: Invoice status
        payment_status:
          type: string
          readOnly: true
          description: Payment status
        net_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: net amount
        vat5_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT5 amount
        vat9_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT9 amount
        vat20_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT20 amount
        vat13_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT13 amount
        vat20_exception_price:
          type: number
          maximum: 1000000000
          readOnly: true
          description: VAT20 exception amount
        gross_price:
          type: number
          maximum: 1000000000
          description: gross amount
        bank_ref_number:
          type: string
          description: reference number
        term_days:
          type: integer
          maximum: 9999
          description: Term days
        overdue_charge:
          type: number
          maximum: 1000
          description: delinquency charge per day
        notes:
          type: string
          maxLength: 4000
          description: Internal notes
        base_document_files_id:
          type: integer
          readOnly: true
          description: Reference to file
        files_id:
          type: integer
          readOnly: true
          description: Reference to file
        is_doubtful:
          type: boolean
          readOnly: true
          description: doubtful debt
        is_hopeless:
          type: boolean
          readOnly: true
          description: hopeless debt
        use_per_item_rounding:
          type: boolean
          description: undocumented
        paid_in_cash:
          type: boolean
          description: Paid in cash
        cash_accounts_id:
          type: integer
          description: Cash Account
        cash_accounts_dimensions_id:
          type: integer
          description: Cash Account Dimension
        bank_accounts_id:
          type: integer
          description: Bank Account
        invoice_info:
          type: string
          maxLength: 4000
          description: information text on invoice
        payment_description:
          type: string
          maxLength: 210
          description: Payment description
        cl_currencies_id:
          type: string
          maxLength: 3
          description: currency
        currency_rate:
          type: number
          maximum: 1000000000
          description: exchange rate
        base_gross_price:
          type: number
          maximum: 1000000000
          description: gross amount in euros
        base_net_price:
          type: number
          maximum: 1000000000
          description: net sum in euros
        base_vat5_price:
          type: number
          maximum: 1000000000
          description: VAT 5% euros
        base_vat9_price:
          type: number
          maximum: 1000000000
          description: VAT 9% euros
        base_vat20_price:
          type: number
          maximum: 1000000000
          description: VAT 20% euros
        base_vat13_price:
          type: number
          maximum: 1000000000
          description: VAT 13% euros
        base_vat20_exception_price:
          type: number
          maximum: 1000000000
          description: VAT 20% exception euros
        cash_payment_date:
          type: string
          format: date
          description: Date of payment
        trade_secret:
          type: boolean
          description: Sales invoice contains trade secrets.
        receivable_accounts_id:
          type: integer
          description: Receivables account
        receivable_accounts_dimensions_id:
          type: integer
          description: Receivables account
        intra_community_supply:
          type: boolean
          description: Intra-Community supply
        client_vat_no:
          type: string
          description: Client VAT number
        triangulation:
          type: boolean
          description: Triangulation reseller
        triangulation_seller_invoice_vat_no:
          type: string
          description: Triangulation seller invoice VAT number
        assembled_in_member_state:
          type: boolean
          description: Assembled in different member state
        show_client_balance:
          type: boolean
          description: Add client balance to the invoice
        subclients_id:
          type: integer
          description: Subclient
        is_xls_imported:
          type: boolean
          readOnly: true
          description: Imported from Excel
        recipient_clients_id:
          type: integer
          description: Invoice recipient
        recipient_subclients_id:
          type: integer
          description: Invoice recipient subclient
        contract_number:
          type: string
          maxLength: 100
          description: ContractNumber
        invoice_content_code:
          type: string
          maxLength: 20
          description: InvoiceContentCode
        invoice_content_text:
          type: string
          maxLength: 100
          description: InvoiceContentText
        period_start_date:
          type: string
          format: date
          description: Period.StartDate
        period_end_date:
          type: string
          format: date
          description: Period.EndDate
        additional_info_content:
          type: string
          maxLength: 500
          description: AdditionalInformation.InformationContent
        bank_payment_orders_id:
          type: integer
          readOnly: true
          description: return payment ID for credit invoice
        items:
          type: array
          items:
            $ref: '#/components/schemas/SaleInvoicesItems'
          description: Invoice rows, shown only on detailed single object query
        deliveries:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/SaleInvoicesDeliveries'
          description: Delivery history, shown only on detailed single object query
        credit_invoices:
          type: array
          readOnly: true
          description: Related credit invoices, shown only on detailed single object query
          items:
            type: integer
        journals:
          type: array
          readOnly: true
          description: Related journals, shown only on detailed single object query
          items:
            type: integer
        settlements:
          type: array
          readOnly: true
          description: Related settlements, shown only on detailed single object query
          items:
            type: integer
        transactions:
          type: array
          readOnly: true
          description: Related transactions, shown only on detailed single object query
          items:
            type: integer
      required:
        - sale_invoice_type
        - cl_templates_id
        - clients_id
        - cl_countries_id
        - number_suffix
        - create_date
        - journal_date
        - term_days
        - cl_currencies_id
        - show_client_balance
    SaleInvoicesDeliveries:
      title: Sales invoice Delivery History
      type: object
      description: Sales invoice Delivery History
      properties:
        create_date:
          type: string
          format: date-time
          readOnly: true
          description: Object creation time
        destination_type:
          type: string
          readOnly: true
          description: Delivery method
        invoice_type:
          type: string
          readOnly: true
          description: Invoice type
        receiver_address:
          type: string
          readOnly: true
          description: Delivery Address
        receiver_name:
          type: string
          readOnly: true
          description: Receiver name
        send_method:
          type: integer
          readOnly: true
          description: Delivery type - 1 for email, 2 for e-invoice
        sender_person_code:
          type: string
          readOnly: true
          description: Sender ID code
        sender_person_name:
          type: string
          readOnly: true
          description: Sender name
        status_date:
          type: string
          readOnly: true
          format: date-time
          description: Last status change time
        transfer_status_code:
          type: integer
          readOnly: true
          description: Delivery status code
    SaleInvoicesItems:
      title: Sales invoice product/service
      type: object
      description: Sales invoice product/service
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        products_id:
          type: integer
          description: product /service
        cl_sale_articles_id:
          type: integer
          readOnly: true
          description: Sales Article
        sale_accounts_id:
          type: integer
          readOnly: true
          description: Sales Account
        sale_accounts_dimensions_id:
          type: integer
          readOnly: true
          description: Sales Dimension
        amount:
          type: number
          maximum: 1000000000
          description: amount
        unit:
          type: string
          maxLength: 50
          description: Unit price
        unit_net_price:
          type: number
          maximum: 1000000000
          description: unit net price
        total_net_price:
          type: number
          maximum: 1000000000
          description: Product net sum
        base_total_net_price:
          type: number
          readOnly: true
          maximum: 1000000000
          description: Base product net sum
        vat_accounts_id:
          type: integer
          readOnly: true
          description: VAT account
        vat_rate:
          type: number
          readOnly: true
          maximum: 200
          description: VAT rate
        vat_rate_exception_20:
          type: [boolean, "null"]
          readOnly: true
          description: VAT rate exception 20
        discount_percent:
          type: number
          maximum: 1000
          description: discount percentage
        discount_amount:
          type: number
          maximum: 1000000000
          description: discount amount
        custom_title:
          type: string
          maxLength: 200
          description: product /service name
        projects_project_id:
          type: integer
          description: cost/profit center (project)
        projects_location_id:
          type: integer
          description: cost/profit center (place)
        projects_person_id:
          type: integer
          description: cost/profit center (person)
        vat_amount:
          type: number
          readOnly: true
          maximum: 1000000000
          description: VAT amount
      required:
        - products_id
        - amount
        - custom_title
    SaleInvoicesDeliveryOptions:
      title: Sales invoice delivery options
      type: object
      description: Sales invoice delivery options
      properties:
        can_send_einvoice:
          type: boolean
          description: Can this e-invoice be sent to customer digitally (machine-readable XML)
        can_send_einvoice_reason:
          type: string
          maxLength: 4000
          description: Reason for not being able to send
        can_send_email:
          type: boolean
          description: Can this e-invoice be sent to customer by e-mail (PDF)
        can_send_email_addresses:
          type: string
          maxLength: 4000
          description: E-mail addresses that the system can suggest for invoice delivery
      required:
        - can_send_einvoice
        - can_send_email
    SaleInvoicesDeliveryRequest:
      title: Sales invoice delivery request
      type: object
      description: Sales invoice delivery request
      examples:
        - send_einvoice: false
          send_email: true
          email_addresses: test@asdf.com
      properties:
        send_einvoice:
          type: boolean
          description: Send this e-invoice to customer digitally (machine-readable XML)
        send_email:
          type: boolean
          description: Send this e-invoice to customer by e-mail (PDF)
        email_addresses:
          type: string
          maxLength: 4000
          description: E-mail addresses to send the emails to
        email_subject:
          type: string
          maxLength: 4000
          description: Optional e-mail subject
        email_body:
          type: string
          maxLength: 4000
          description: Optional e-mail body
      required:
        - send_einvoice
        - send_email
    ListOfTransactions:
      title: List of Transactions
      type: object
      description: List of Transactions
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/Transactions'
      required:
        - current_page
        - total_pages
        - items
    Transactions:
      title: Transactions
      type: object
      description: Transactions
      examples:
        - accounts_dimensions_id: 4
          accounts_id: 1010
          amount: 2348.32
          bank_account_name: null
          bank_account_no: null
          bank_accounts_id: null
          bank_code: null
          bank_ref_number: null
          bank_subtype: null
          base_amount: 2348.32
          cl_currencies_id: EUR
          clients_id: 19
          currency_rate: 1
          date: '2015-01-31'
          description: Töötasu väljamakse nr 10069 (Bob Smith 01.2015) tasumine sularahas
          export_format: null
          id: 2672
          is_deleted: false
          operation_type: null
          ref_number: null
          status: CONFIRMED
          transactions_files_id: null
          type: D
          uploaded_files_id: null
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        uploaded_files_id:
          type: integer
          readOnly: true
          description: Reference to file
        accounts_id:
          type: integer
          readOnly: true
          description: transaction account
        accounts_dimensions_id:
          type: integer
          description: transaction account dimension
        status:
          type: string
          readOnly: true
          description: transaction status
        bank_accounts_id:
          type: integer
          readOnly: true
          description: reference to bank accout
        bank_ref_number:
          type: string
          readOnly: true
          description: reference number
        bank_subtype:
          type: string
          readOnly: true
          description: transaction subtype at bank
        type:
          type: string
          maxLength: 2
          description: type - incoming payment/outgoing payment/settlement
        clients_id:
          type: integer
          description: buyer/supplier/employee
        bank_code:
          type: string
          readOnly: true
          description: bank code
        bank_account_no:
          type: string
          readOnly: true
          description: Bank account number
        bank_account_name:
          type: string
          maxLength: 100
          description: remitter/beneficiary
        ref_number:
          type: string
          maxLength: 20
          description: reference number
        amount:
          type: number
          maximum: 10000000
          description: transaction sum
        base_amount:
          type: number
          maximum: 10000000
          description: transaction sum in euros
        currency_rate:
          type: number
          maximum: 10000000
          description: exchange rate
        cl_currencies_id:
          type: string
          maxLength: 3
          description: transaction currency
        description:
          type: string
          maxLength: 150
          description: description of transaction
        date:
          type: string
          format: date
          description: transaction date
        transactions_files_id:
          type: integer
          description: Reference to transaction file
        export_format:
          type: string
          description: Export format
        items:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/TransactionsItems'
      required:
        - accounts_dimensions_id
        - type
        - amount
        - cl_currencies_id
        - date
    TransactionsItems:
      title: Transaction items
      type: object
      description: Transaction items
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        accounts_id:
          type: integer
          description: account
        accounts_dimensions_id:
          type: integer
          description: account dimension
        relation_table:
          type: string
          description: Related object type
        relation_id:
          type: integer
          description: Related object ID
        amount:
          type: number
          maximum: 1000000000
          description: sum
        base_amount:
          type: number
          maximum: 10000000
          description: sum in base currency
        currency_rate:
          type: number
          maximum: 10000000
          description: exchange rate
        cl_currencies_id:
          type: string
          maxLength: 3
          description: transaction currency
      required:
        - accounts_id
    TransactionsDistributions:
      title: Transaction distribution rows for registering
      type: array
      description: Transaction distribution rows for registering
      items:
        $ref: '#/components/schemas/TransactionsDistribution'
    TransactionsDistribution:
      title: Transaction distribution rows for registering
      type: object
      description: Transaction distribution rows for registering
      properties:
        related_table:
          type: string
          description: related object's table name
        related_id:
          type: integer
          description: related object's ID (account number or object ID)
        related_sub_id:
          type: integer
          description: related sub-object's ID (for example, account dimension id if related_table=accounts)
        amount:
          type: number
          maximum: 1000000000
          description: amount distributed to related object
      required:
        - related_table
        - amount
    ListOfJournals:
      title: List of Journals
      type: object
      description: List of Journals
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/Journals'
      required:
        - current_page
        - total_pages
        - items
    Journals:
      title: Journal Entry
      type: object
      description: Journal Entry
      examples:
        - amendment_number: 0
          base_document_files_id: null
          cl_currencies_id: EUR
          clients_id: 172
          currency_rate: 1
          document_number: EMTA KMD 31.05.2014
          effective_date: '2014-05-31'
          id: 739
          insert_date: '2014-06-20'
          is_deleted: false
          is_xls_imported: false
          number: 10008
          operation_type: EMTA_VAT_DECLARATION
          operations_id: 21
          parent_id: null
          postings:
            - accounts_dimensions_id: null
              accounts_id: 2511
              amount: 100
              base_amount: 100
              cl_currencies_id: EUR
              id: 8203
              is_deleted: false
              projects_location_id: null
              projects_person_id: null
              projects_project_id: null
              type: D
            - accounts_dimensions_id: null
              accounts_id: 2510
              amount: 100
              base_amount: 100
              cl_currencies_id: EUR
              id: 8204
              is_deleted: false
              projects_location_id: null
              projects_person_id: null
              projects_project_id: null
              type: C
            - accounts_dimensions_id: null
              accounts_id: 2510
              amount: 100
              base_amount: 100
              cl_currencies_id: EUR
              id: 8205
              is_deleted: false
              projects_location_id: null
              projects_person_id: null
              projects_project_id: null
              type: D
            - accounts_dimensions_id: null
              accounts_id: 1516
              amount: 100
              base_amount: 100
              cl_currencies_id: EUR
              id: 8206
              is_deleted: false
              projects_location_id: null
              projects_person_id: null
              projects_project_id: null
              type: C
          register_date: '2014-10-29'
          registered: true
          subclients_id: null
          title: EMTA KMD alusel kanne nr 10008
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        parent_id:
          type: integer
          readOnly: true
          description: Parent Journal Entry
        clients_id:
          type: integer
          description: buyer/supplier/employee
        subclients_id:
          type: integer
          description: Subclient
        number:
          type: integer
          readOnly: true
          description: Journal Entry Number
        amendment_number:
          type: integer
          readOnly: true
          description: Journal Entry Amendment Number
        title:
          type: string
          maxLength: 100
          description: title
        effective_date:
          type: string
          format: date
          description: Entry date
        registered:
          type: boolean
          readOnly: true
          description: Is the entry registered/confirmed?
        operations_id:
          type: integer
          readOnly: true
          description: Operation ID
        operation_type:
          type: string
          readOnly: true
          description: |-
            What kind of journal entry this is. `INITIAL` is an opening-balance
            entry ("algbilansi kanne"); `ENTRY` is a manual entry; the rest
            identify the system flow that produced the entry (sale invoice,
            salary payment, EMTA VAT declaration, fixed-asset event, etc.).
          enum:
            - ENTRY
            - INITIAL
            - NORMAL
            - CLOSING
            - TRANSACTION
            - SETTLEMENT
            - PURCHASE_INVOICE
            - PURCHASE_INVOICE_PERIOD
            - SALE_INVOICE
            - SALE_INVOICE_PERIOD
            - SALE_INVOICE_DOUBTFUL
            - SALE_INVOICE_HOPELESS
            - SALARY_PAYMENT
            - SALARY_PAYMENT_MINOBLIGATION
            - EMTA_PREPAYMENT
            - EMTA_VAT_DECLARATION
            - FIXED_ASSET_AMORTIZATION
            - FIXED_ASSET_WRITEOFF
            - FIXED_ASSET
            - COMBINED_FIXED_ASSET
            - YEAR_CLOSING
        document_number:
          type: string
          description: document number
        cl_currencies_id:
          type: string
          maxLength: 3
          description: currency
        currency_rate:
          type: number
          maximum: 1000000000
          description: exchange rate
        base_document_files_id:
          type: integer
          readOnly: true
          description: Reference to file
        is_xls_imported:
          type: boolean
          readOnly: true
          description: Imported from Excel
        register_date:
          type: string
          format: date
          readOnly: true
          description: Date the entry was registered/confirmed
        is_deleted:
          type: boolean
          readOnly: true
          description: Is the entry soft-deleted
        postings:
          type: array
          items:
            $ref: '#/components/schemas/Postings'
      required:
        - effective_date
        - postings
    Postings:
      title: Entry row
      type: object
      description: Entry row
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        accounts_id:
          type: integer
          description: account
        accounts_dimensions_id:
          type: integer
          description: account dimension
        type:
          type: string
          description: |-
            Debit (`D`) or Credit (`C`). The API normalizes opening-balance
            entries (parent journal's `operation_type=INITIAL`) into this same
            shape — internally those use a signed-amount encoding, but the
            response always presents an explicit side and a non-negative
            `amount`, so consumers can sum postings uniformly to compute
            account balances without special-casing INITIAL entries.
          enum:
            - C
            - D
        amount:
          type: number
          description: sum
        base_amount:
          type: number
          readOnly: true
          description: base currency sum
        cl_currencies_id:
          type: string
          maxLength: 3
          description: currency
        projects_project_id:
          type: integer
          description: cost/profit center (project)
        projects_location_id:
          type: integer
          description: cost/profit center (place)
        projects_person_id:
          type: integer
          description: cost/profit center (person)
        is_deleted:
          type: boolean
          readOnly: true
          description: Deletion flag (always false)
        vat_rate_exception_20:
          type: [boolean, "null"]
          readOnly: true
          description: Whether the posting uses the 20 percent VAT exception
      required:
        - accounts_id
        - amount
    ListOfClients:
      title: List of Clients
      type: object
      description: List of Clients
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/Clients'
      required:
        - current_page
        - total_pages
        - items
    Clients:
      title: Buyers/Suppliers
      type: object
      description: Buyers/Suppliers
      examples:
        - accounting_email: null
          address_adr_id: null
          address_ads_oid: null
          address_text: null
          alt_name: null
          bank_account_custom_name: null
          bank_account_no: null
          bank_ref_number_purchases: null
          bank_ref_number_sales: null
          cl_code_country: EST
          cl_invoice_country: EST
          cl_purchase_articles_id: null
          code: '14168677'
          contact_person: null
          email: null
          id: 1916
          invoice_days: null
          invoice_electronic_opts: {}
          invoice_overdue_charge: null
          invoice_vat_no: null
          is_associate_company: false
          is_client: true
          is_deleted: true
          is_juridical_entity: true
          is_member: false
          is_parent_company_group: false
          is_physical_entity: false
          is_related_party: false
          is_staff: false
          is_supplier: true
          name: A24 Laen OÜ
          notes: null
          postal_address_text: null
          purchase_accounts_dimensions_id: null
          purchase_accounts_id: null
          send_invoice_to_accounting_email: false
          send_invoice_to_email: false
          telephone: null
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        is_client:
          type: boolean
          description: is a buyer
        is_supplier:
          type: boolean
          description: is a supplier
        is_staff:
          type: boolean
          readOnly: true
          description: is staff member
        name:
          type: string
          maxLength: 1000
          description: name
        alt_name:
          type: string
          maxLength: 1000
          description: Trademark
        code:
          type: string
          maxLength: 1000
          description: code
        address_ads_oid:
          type: string
          description: ADS OID
        address_adr_id:
          type: string
          description: ADR ID
        address_text:
          type: string
          description: legal address
        postal_address_text:
          type: string
          description: Postal address
        email:
          type: string
          maxLength: 100
          description: contact e-mail address
        accounting_email:
          type: string
          maxLength: 100
          description: Accounting e-mail
        telephone:
          type: string
          maxLength: 100
          description: phone
        contact_person:
          type: string
          maxLength: 100
          description: contact person
        bank_account_no:
          type: string
          maxLength: 100
          description: bank account no.
        notes:
          type: string
          maxLength: 10000
          description: notes
        invoice_electronic_opts:
          type: object
          additionalProperties:
            type: string
          description: e-arveldamise võimalused
        invoice_days:
          type: integer
          description: Due date on invoices
        invoice_overdue_charge:
          type: number
          maximum: 1000
          description: delinquency charge per day
        invoice_vat_no:
          type: string
          description: KMKR/VAT no
        cl_invoice_country:
          type: string
          description: the place of supply of goods
        cl_purchase_articles_id:
          type: integer
          description: Default account for purchase invoices
        purchase_accounts_id:
          type: integer
          readOnly: true
          description: Purchase Account
        purchase_accounts_dimensions_id:
          type: integer
          readOnly: true
          description: Purchase Dimension
        is_physical_entity:
          type: boolean
          description: natural person
        is_juridical_entity:
          type: boolean
          description: juridical person
        cl_code_country:
          type: string
          description: issuer country of Business registry code/Personal identity code
        is_member:
          type: boolean
          description: is a member
        send_invoice_to_email:
          type: boolean
          description: Use for sale invoices (email)
        send_invoice_to_accounting_email:
          type: boolean
          description: Use for sale invoices (accounting email)
        bank_ref_number_sales:
          type: string
          maxLength: 99999999999999999999
          description: Reference number of sales invoices
        bank_ref_number_purchases:
          type: string
          maxLength: 99999999999999999999
          description: Reference number of purchase invoices
        bank_account_custom_name:
          type: string
          maxLength: 100
          description: Bank payment order beneficiary name
      required:
        - is_client
        - is_supplier
        - name
        - cl_code_country
        - is_member
        - send_invoice_to_email
        - send_invoice_to_accounting_email
    ListOfProducts:
      title: List of Products
      type: object
      description: List of Products
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/Products'
      required:
        - current_page
        - total_pages
        - items
    Products:
      title: Products/Services
      type: object
      description: Products/Services
      examples:
        - activity_text: null
          amount: null
          cl_purchase_articles_id: null
          cl_sale_articles_id: 1
          code: HP
          description: null
          emtak_code: null
          emtak_version: null
          foreign_names: {}
          id: 36166
          is_deleted: false
          name: printer HP
          net_price: null
          notes: null
          price_currency: EUR
          purchase_accounts_dimensions_id: null
          purchase_accounts_id: null
          sale_accounts_dimensions_id: null
          sale_accounts_id: 3100
          sales_price: 170
          translations:
            products__name__1: ''
          unit: tk
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        name:
          type: string
          maxLength: 1000
          description: name
        foreign_names:
          type: object
          additionalProperties:
            type: string
          description: foreign names
        cl_sale_articles_id:
          type: integer
          description: Sales Article
        sale_accounts_id:
          type: integer
          readOnly: true
          description: Sales Account
        sale_accounts_dimensions_id:
          type: integer
          description: Sales Dimension
        cl_purchase_articles_id:
          type: integer
          description: Purchase Article
        purchase_accounts_id:
          type: integer
          readOnly: true
          description: Purchase Account
        purchase_accounts_dimensions_id:
          type: integer
          description: Purchase Dimension
        code:
          type: string
          maxLength: 20
          description: code
        description:
          type: string
          maxLength: 10000
          description: note
        sales_price:
          type: number
          maximum: 1000000000000
          description: sales price
        net_price:
          type: number
          maximum: 1000000000000
          description: Prime cost
        price_currency:
          type: string
          minLength: 3
          maxLength: 3
          description: currency
        notes:
          type: string
          maxLength: 10000
          description: other notes
        translations:
          type: object
          additionalProperties:
            type: string
          description: translations
        activity_text:
          type: string
          maxLength: 10000
          description: Field of activity as text
        emtak_code:
          type: string
          maxLength: 10000
          description: EMTAK code
        emtak_version:
          type: string
          maxLength: 10000
          description: EMTAK version
        unit:
          type: string
          maxLength: 10
          description: Unit price
        amount:
          type: number
          maximum: 10000000
          description: sum
      required:
        - name
        - code
    ListOfProjects:
      title: List of Projects
      type: object
      description: List of Projects
      properties:
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Number of total pages
        items:
          type: array
          items:
            $ref: '#/components/schemas/Projects'
      required:
        - current_page
        - total_pages
        - items
    Projects:
      title: Cost/profit center
      type: object
      description: Cost/profit center
      examples:
        - cl_projects_type: PROJECT
          create_date: '2014-06-18'
          deprecated_parent_id: 11
          id: 12
          is_deleted: false
          is_disabled: false
          name: Elekter
          notes: null
          parent_id: 11
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        parent_id:
          type: integer
          description: parent object
        name:
          type: string
          maxLength: 1000
          description: name
        notes:
          type: string
          maxLength: 10000
          description: note
        cl_projects_type:
          type: string
          description: type
        is_disabled:
          type: boolean
          description: Inactive
      required:
        - name
        - cl_projects_type
        - is_disabled
    CompanyInvoiceInfo:
      title: Company Invoice Settings
      type: object
      description: Company Invoice Settings
      examples:
        - address: 'Tõru tn 144, Pirita linnaosa, Tallinn, Harju maakond, 12011'
          email: test@mail.ee
          phone: '58012345'
          fax: '123123123'
          webpage: www.ee
          cl_templates_id: 1
          invoice_company_name: null
          invoice_email_subject: 'Arve $arve_nr$ ($ettevotja_nimetus$) ${kala}'
          invoice_email_body: 'Teile on $ettevotja_nimetus$ poolt loodud arve. ${kala}'
          balance_email_subject: '$ettevotja_nimetus$ saldokinnitus ($bilansipaev$) ${kala}'
          balance_email_body: "Teile on $ettevotja_nimetus$ poolt saadetud saldokinnituse dokument. Ootame Teie poolset vastust hiljemalt $tahtaeg10$. Juhul, kui me selleks ajaks vastust ei ole saanud, loeme meiepoolse saldo kinnitatuks.

${kala}"
          balance_document_footer: "Ootame Teie vastust hiljemalt $tahtaeg10$ ettevõtte meiliaadressile $epost_arvel$ või postiga aadressile $aadress_arvel$. Juhul, kui me selleks ajaks vastust ei ole saanud, loeme meiepoolse saldo kinnitatuks.

Lugupidamisega
$saatja_nimi$
${kala}"
      properties:
        address:
          type: string
          maxLength: 200
          description: Aadress arvel
        email:
          type: string
          maxLength: 1000
          description: E-post arvel
        phone:
          type: string
          maxLength: 1000
          description: Telefon arvel
        fax:
          type: string
          maxLength: 1000
          description: Faks arvel
        webpage:
          type: string
          maxLength: 1000
          description: Kodulehekülg arvel
        cl_templates_id:
          type: integer
          description: Vaikimisi valitud müügiarve mall
        invoice_company_name:
          type: string
          maxLength: 100
          description: Ärinimi arvel/e-arvel
        invoice_email_subject:
          type: string
          maxLength: 1000
          description: Arve e-maili pealkiri
        invoice_email_body:
          type: string
          maxLength: 1000
          description: Arve e-maili sisu
        balance_email_subject:
          type: string
          maxLength: 1000
          description: Saldokinnituse e-maili pealkiri
        balance_email_body:
          type: string
          maxLength: 1000
          description: Saldokinnituse e-maili sisu
        balance_document_footer:
          type: string
          maxLength: 1000
          description: Saldokinnituse dokumendi jalus
    InvoiceSeries:
      title: Invoice details
      type: object
      description: Invoice details
      examples:
        - id: 3
          is_active: true
          is_default: false
          number_prefix: NX
          number_start_value: 1
          overdue_charge: 0.15
          term_days: 28
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        is_active:
          type: boolean
          description: is active
        is_default:
          type: boolean
          description: is default series
        number_prefix:
          type: string
          minLength: 1
          maxLength: 100
          description: invoice no. prefix
        number_start_value:
          type: integer
          description: first invoice number
        term_days:
          type: integer
          maximum: 9999
          description: Term days
        overdue_charge:
          type: number
          maximum: 1000
          description: delinquency charge per day
      required:
        - is_active
        - is_default
        - number_prefix
        - number_start_value
        - term_days
    BankAccounts:
      title: Bank accounts
      type: object
      description: Bank accounts
      examples:
        - account_name_eng: Swedbank AS EE123456780012345678
          account_name_est: Swedbank AS EE123456780012345678
          account_no: EE123456780012345678
          accounts_dimensions_id: 2
          bank_name: null
          bank_regcode: null
          beneficiary_name: null
          cl_banks_id: 1
          clients_id: 56
          credit_limit: null
          day_limit: null
          default_salary_account: true
          iban_code: EE123456780012345678
          id: 16
          show_in_sale_invoices: true
          start_sum: null
          swift_code: HABAEE2X
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        account_name_est:
          type: string
          maxLength: 100
          description: Account name
        account_name_eng:
          type: string
          maxLength: 100
          description: account name (English)
        account_no:
          type: string
          maxLength: 100
          description: account number
        cl_banks_id:
          type: integer
          description: bank
        bank_name:
          type: string
          maxLength: 100
          description: bank name
        bank_regcode:
          type: string
          maxLength: 100
          description: Bank’s Registry code
        iban_code:
          type: string
          maxLength: 100
          description: IBAN code
        swift_code:
          type: string
          maxLength: 100
          description: SWIFT/BIC code
        start_sum:
          type: number
          maximum: 1000000000000
          description: initial balance
        day_limit:
          type: number
          maximum: 1000000000000
          description: daily limit
        credit_limit:
          type: number
          maximum: 1000000000000
          description: monthly limit
        show_in_sale_invoices:
          type: boolean
          description: is shown on sales invoices
        default_salary_account:
          type: boolean
          description: is the default account for outgoing payments
        beneficiary_name:
          type: string
          maxLength: 70
          description: Bank account beneficiary name
      required:
        - account_name_est
        - account_no
    CompanyVatInfo:
      title: Company VAT information
      type: object
      description: Company VAT information
      examples:
        - vat_number: EE100523377
          tax_refnumber: 14332434
      properties:
        vat_number:
          type: string
          description: KMKR number
        tax_refnumber:
          type: string
          description: EMTA tax reference number
    Accounts:
      title: Chart of accounts
      type: object
      description: Chart of accounts
      examples:
        - id: 1010
          balance_type: D
          account_type_est: Varad
          name_est: Sularaha kassas
          name_eng: Cash on hand
          is_valid: true
          allows_dimensions: true
          allows_deactivation: false
          is_vat_account: false
          is_fixed_asset: false
          expenditure_accounts_id: null
          amortization_accounts_id: null
          transaction_in_bindable: true
          transaction_out_bindable: true
          priority: 1010
          cl_account_groups:
            - AR
            - MTY
            - SA
          default_disabled: false
          requires_client: false
          requires_positive_balance: false
          transaction_in_user_bindable: false
          transaction_out_user_bindable: false
          is_product_account: false
          account_type_eng: Assets
          is_disabled: false
          transaction_in_user_bindable_set: false
          transaction_out_user_bindable_set: false
      properties:
        id:
          type: integer
          description: id
        balance_type:
          type: string
          maxLength: 50
          description: debit / credit
        account_type_est:
          type: string
          maxLength: 50
          description: account type
        account_type_eng:
          type: string
          maxLength: 50
          description: account type
        name_est:
          type: string
          maxLength: 100
          description: name
        name_eng:
          type: string
          maxLength: 100
          description: name
        is_valid:
          type: boolean
          description: is active
        allows_deactivation:
          type: boolean
          description: deactivation allowed
        is_vat_account:
          type: boolean
          description: is VAT account
        is_fixed_asset:
          type: boolean
          description: is a non-current asset
        expenditure_accounts_id:
          type: integer
          description: depreciation account
        amortization_accounts_id:
          type: integer
          description: depreciation account
        transaction_in_bindable:
          type: boolean
          description: selectable under incoming payments
        transaction_out_bindable:
          type: boolean
          description: chosen under Receipts
        priority:
          type: integer
          description: priority
        cl_account_groups:
          type: array
          items:
            type: string
          description: Account group
        default_disabled:
          type: boolean
          description: Disabled by default
        transaction_in_user_bindable:
          type: boolean
          description: User selectable under incoming payments
        transaction_out_user_bindable:
          type: boolean
          description: User selectable under outgoing payments
        is_product_account:
          type: boolean
          description: On kaupade konto
      required:
        - balance_type
        - account_type_est
        - account_type_eng
        - name_est
        - name_eng
        - is_valid
        - allows_deactivation
        - is_vat_account
        - is_fixed_asset
        - transaction_in_bindable
        - transaction_out_bindable
        - cl_account_groups
        - default_disabled
        - transaction_in_user_bindable
        - transaction_out_user_bindable
        - is_product_account
    AccountsDimensions:
      title: Account Dimension / SubAccount
      type: object
      description: Account Dimension / SubAccount
      examples:
        - id: 1
          accounts_id: 1100
          title_est: Lühiajalised finantsinvesteeringud
          cl_currencies_id: EUR
          is_deleted: false
          title_eng: Current financial investments
          expenditure_accounts_dimensions_id: null
          amortization_accounts_dimensions_id: null
      properties:
        id:
          type: integer
          readOnly: true
          description: Object ID
        accounts_id:
          type: integer
          description: account
        title_est:
          type: string
          maxLength: 100
          description: sub-account name
        title_eng:
          type: string
          maxLength: 100
          description: dimension name (English)
        cl_currencies_id:
          type: string
          maxLength: 3
          description: currency
      required:
        - accounts_id
        - title_est
    Currencies:
      title: Currencies
      type: object
      description: Currencies
      examples:
        - id: GBP
          name_est: Suurbritannia naelsterling
          name_eng: Pound Sterling
      properties:
        id:
          type: string
          description: Currency ID in e-Financials
        name_est:
          type: string
          description: Currency name in Estonian
        name_eng:
          type: string
          description: Currency name in English
    SaleArticles:
      title: Sales Articles
      type: object
      description: Sales Articles
      examples:
        - id: 34
          name_est: Pandipakendid
          name_eng: Pledge packages
          group_est: Pandipakendid
          group_eng: Pledge packages
          description_est: null
          description_eng: null
          accounts_id: 1615
          vat_rate: null
          vat_accounts_id: null
          priority: 15
          is_valid: true
          start_date: null
          end_date: null
          vat_type: 0
          cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__id: '1615'
          accounts__cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__name_est: Pandipakendid
          accounts__name_eng: Pledge packages
          dimensions__id: null
          dimensions__title_est: null
          dimensions__title_eng: null
          dimensions__cl_currencies_id: null
          dimensions__is_deleted: false
        - id: 17
          name_est: Muud äritulud
          name_eng: Other income
          group_est: Muud äritulud
          group_eng: Other income
          description_est: null
          description_eng: null
          accounts_id: 3990
          vat_rate: 20
          vat_accounts_id: 2511
          priority: 350
          is_valid: true
          start_date: null
          end_date: null
          vat_type: 2
          cl_account_groups:
            - AR
          accounts__id: '3990__6'
          accounts__cl_account_groups:
            - AR
          accounts__name_est: Muud äritulud
          accounts__name_eng: Other operating income
          dimensions__id: 6
          dimensions__title_est: Muud äritulud
          dimensions__title_eng: Other operating income
          dimensions__cl_currencies_id: EUR
          dimensions__is_deleted: false
      properties:
        id:
          type: integer
          description: id
        group_est:
          type: string
          maxLength: 150
          description: grupp
        group_eng:
          type: string
          maxLength: 150
          description: grupp ing.k
        name_est:
          type: string
          maxLength: 150
          description: nimetus
        name_eng:
          type: string
          maxLength: 150
          description: nimetus ing.k
        accounts_id:
          type: integer
          description: konto
        vat_accounts_id:
          type: integer
          description: km konto
        vat_rate:
          type: number
          description: km määr
        vat_type:
          type: integer
          description: km tüüp
        is_valid:
          type: boolean
          description: on aktiivne
        start_date:
          type: string
          format: date
          description: algus kuupäev
        end_date:
          type: string
          format: date
          description: lõpp kuupäev
        priority:
          type: integer
          description: tähtsusjärjekord
        cl_account_groups:
          type: array
          items:
            type: string
          description: Konto grupp
      required:
        - group_est
        - group_eng
        - name_est
        - name_eng
        - accounts_id
        - vat_type
        - is_valid
        - cl_account_groups
    Templates:
      title: Sale Invoice Templates
      type: object
      description: Sale Invoice Templates
      examples:
        - id: 89
          name: 'Default template'
          is_default: false
          cl_account_groups: 'ET'
      properties:
        id:
          type: integer
          description: id
        name:
          type: string
          description: Name
        is_default:
          type: boolean
          description: Is the template set as default
        cl_languages_id:
          type: string
          description: Template language
      required:
        - id
        - name
        - is_default
        - cl_languages_id
    PurchaseArticles:
      title: Purchase Articles
      type: object
      description: Purchase Articles
      examples:
        - id: 89
          accounts_id: 1510
          level: 2
          name_est: 'Sisendkäibemaks, tollis impordilt tasutud'
          name_eng: 'Input VAT, customs paid on imports'
          priority: 15100
          cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__id: '1510'
          accounts__cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__name_est: Sisendkäibemaks
          accounts__name_eng: Input VAT
          dimensions__id: null
          dimensions__title_est: null
          dimensions__title_eng: null
          dimensions__cl_currencies_id: null
          dimensions__is_deleted: false
          is_disabled: false
        - id: 15
          accounts_id: 1940
          level: 2
          name_est: 'Kontsessioonid, patendid, litsentsid, kaubamärgid'
          name_eng: 'Concessions, patents, licences, trademarks'
          priority: 19400
          cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__id: '1940__23393'
          accounts__cl_account_groups:
            - AR
            - MTY
            - SA
          accounts__name_est: 'Kontsessioonid, patendid, litsentsid, kaubamärgid'
          accounts__name_eng: 'Concessions, patents, licences, trademarks'
          dimensions__id: 23393
          dimensions__title_est: 'Kontsessioonid, patendid, litsentsid, kaubamärgid'
          dimensions__title_eng: 'Concessions, patents, licences, trademarks'
          dimensions__cl_currencies_id: EUR
          dimensions__is_deleted: false
          is_disabled: false
      properties:
        id:
          type: integer
          description: id
        level:
          type: integer
          description: tase
        name_est:
          type: string
          maxLength: 150
          description: nimetus
        name_eng:
          type: string
          maxLength: 150
          description: nimetus ing.k
        accounts_id:
          type: integer
          description: konto
        priority:
          type: integer
          description: tähtsusjärjekord
        cl_account_groups:
          type: array
          description: Konto grupp
          items:
            type: string
      required:
        - level
        - name_est
        - name_eng
        - cl_account_groups
    ApiResponse:
      title: API Response
      type: object
      description: 'API Response, contains success/error codes and messages'
      examples:
        - code: 0
          messages:
            - OK
        - code: 0
          created_object_id: 12345
          messages:
            - OK
        - code: 101
          messages:
            - 'Required field not filled: example_field'
      properties:
        code:
          type: integer
          description: Response code, 0 for success
        created_object_id:
          type: integer
          description: Created object ID, where relevant.
        messages:
          type: array
          description: Success or Error Messages
          items:
            type: string
      required:
        - code
    ApiFile:
      title: API File
      type: object
      description: 'API File, contains file information'
      examples:
        - name: Arve_NX000001_20220109_TESTCLIENT.pdf
          contents: JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/KQovQ3JlYXRvciAo/v8AdwBrAGgAdABtAGwA...dHhyZWYKMjExMzMKJSVFT0YK
      properties:
        name:
          type: string
          description: File name
        contents:
          type: string
          format: byte
          description: Base64-encoded contents of the file.
      required:
        - name
        - contents
  securitySchemes:
    ApiKeyAuth:
      name: X-AUTH-KEY
      type: apiKey
      in: header
      description: |
        Request authentication header based on the API key generated in e-Financials

        Request authentication header takes the form of "{ApiKey_public_value}:{Request_signature}", where
          1. {ApiKey_public_value} is the public value of the used API key downloaded from e-Financials
          2. {Request_signature} is the result of BASE64(HMAC-SHA-384("{ApiKey_id}:{Request_time}:{Request_url}", {ApiKey_password})), where
            1. {ApiKey_id} is the ID of the used API key downloaded from e-Financials
            2. {Request_time} is the value of the X-AUTH-QUERYTIME header
            3. {Request_url} is path component of the absolute URL used in this request
            4. {ApiKey_password} is the password of the used API key downloaded from e-Financials

        For example: WksIHNpaW4gdGVnZ…Wxpa3RhZ2kgaHV2aXRhdmFtYXQ=:6JMLK6Gt…KJmbTWrCs/XcCaSV
security:
  - ApiKeyAuth: []
