> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chift.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Match entries

> Reconciles open accounting entries against each other in the accounting system, marking them as matched.

**Learn more:**

* What are outstanding items? [↗](/unified-apis/accounting/glossary/outstanding)
* What is a journal entry? [↗](/unified-apis/accounting/glossary/journal-entries)


## OpenAPI

````yaml post /consumers/{consumer_id}/accounting/matching
openapi: 3.1.0
info:
  title: Chift API
  description: >-
    The Chift API is a universal API giving you access to financial data from
    the software of your clients. It helps software companies to offer native
    integrations to their clients without the effort needed to maintain those
    native integrations. By using the APIs (Accounting, POS, eCommerce) of
    Chift, you connect once and allow your clients to use their software
    packages.
  version: 1.0.0
servers:
  - url: https://api.chift.eu
    description: Chift
security:
  - bearerAuth: []
paths:
  /consumers/{consumer_id}/accounting/matching:
    post:
      tags:
        - Accounting
        - Journal entries
      summary: Match entries
      description: >-
        Reconciles open accounting entries against each other in the accounting
        system, marking them as matched.
      operationId: accounting_match_entries
      parameters:
        - name: consumer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Consumer Id
        - name: folder_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Folder Id
          description: >-
            Id of the accounting folder instance. A folder represents a legal
            entity within the system. Required when the multiple folders feature
            is enabled.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchingIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MatchingOut'
        '400':
          content:
            application/json:
              examples:
                ERROR_AMOUNTS_NOT_BALANCED:
                  value:
                    message: The amounts of the entries are not balanced.
                    status: error
                    error_code: ERROR_AMOUNTS_NOT_BALANCED
                ERROR_MULTIPLE_GL_ACCOUNTS:
                  value:
                    message: The entries have different receivable/payable accounts.
                    status: error
                    error_code: ERROR_MULTIPLE_GL_ACCOUNTS
                ERROR_ENTRY_HAS_NO_ACCOUNT_RECEIVABLE_PAYABLE:
                  value:
                    message: >-
                      Entry '${entry_id}' doesn't have a receivable/payable
                      account linked to partner '${partner_id}'.
                    status: error
                    error_code: ERROR_ENTRY_HAS_NO_ACCOUNT_RECEIVABLE_PAYABLE
                ERROR_ENTRY_NOT_LINKED_TO_PARTNER:
                  value:
                    message: >-
                      Entry '${entry_id}' is not linked to partner
                      '${partner_id}'.
                    status: error
                    error_code: ERROR_ENTRY_NOT_LINKED_TO_PARTNER
                ERROR_ENTRY_HAS_INVALID_STATUS:
                  value:
                    message: The entry doesn't have the correct status to be matched.
                    status: error
                    error_code: ERROR_ENTRY_HAS_INVALID_STATUS
                ERROR_MULTIPLE_PARTNERS:
                  value:
                    message: The entries have different clients/suppliers.
                    status: error
                    error_code: ERROR_MULTIPLE_PARTNERS
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              examples:
                ERROR_ENTRY_NOT_FOUND:
                  value:
                    message: The entry doesn't exist in the accounting system.
                    status: error
                    error_code: ERROR_ENTRY_NOT_FOUND
                ERROR_ENTRY_NOT_FOUND_2:
                  value:
                    message: >-
                      The entry '${entry_id}' doesn't exist in the accounting
                      system.
                    status: error
                    error_code: ERROR_ENTRY_NOT_FOUND
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          content:
            application/json:
              examples:
                ERROR_INVALID_FIELD_FORMAT_ENTRIES:
                  value:
                    message: >-
                      The format of the IDs entries doesn't follow the format of
                      the corresponding accounting system.
                    status: error
                    error_code: ERROR_INVALID_FIELD_FORMAT_ENTRIES
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Unprocessable Entity
      security:
        - mcp_auth:
            - accounting
            - accounting.journal_entries
            - '200'
            - 200.journal_entries
components:
  schemas:
    MatchingIn:
      properties:
        entries:
          items:
            type: string
          type: array
          minItems: 2
          title: Entries
          description: >-
            List of entries to match. Must contain at least 2 entries. Entries
            are typically journal entry id, invoice id or financial entry id.
        partner_id:
          type: string
          title: Partner Id
          description: >-
            Id of the thirdparty (customer, supplier or employee) in the
            accounting system . All entries are must be linked to one same
            partner.
      type: object
      required:
        - entries
        - partner_id
      title: MatchingIn
    MatchingOut:
      properties:
        matching_number:
          type: string
          title: Matching Number
          description: Unique 'number' of the matching operation in the accounting system.
        balance:
          type: number
          title: Balance
          description: >-
            Balance of the matching operation. This is the sum of all entries in
            the matching operation. It should be zero if the matching is
            complete.
      type: object
      required:
        - matching_number
        - balance
      title: MatchingOut
    ChiftError:
      properties:
        message:
          type: string
          title: Message
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          default: error
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          default: ''
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      required:
        - message
      title: ChiftError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        This access token needs to be included in each of your request to the
        Chift API.

````