> ## 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

> Match existing entries in the accounting system



## 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: Match existing entries in the accounting system
      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:
                Invalid format:
                  value:
                    message: The entries format doesn't seem to be correct.
                    status: error
                Unbalanced entry:
                  value:
                    message: The amounts of the entries are not balanced.
                    status: error
                Already matched:
                  value:
                    message: Entry 'x' is already matched in the accounting system.
                    status: error
                Partner mismatch:
                  value:
                    message: The entries have different clients/suppliers.
                    status: error
                Entry missing account:
                  value:
                    message: Entry 'x' doesn't have a receivable/payable account.
                    status: error
                Entry missing partner:
                  value:
                    message: Entry 'x' is not linked to a client/supplier.
                    status: error
                Could not match:
                  value:
                    message: >-
                      An error occured during the matching process. Please retry
                      again later.
                    status: error
                Entry invalid status:
                  value:
                    message: Entry 'x' doesn't have the correct status.
                    status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Bad Request
        '404':
          content:
            application/json:
              example:
                message: Entry 'x' doesn't exist in the accounting system.
                status: error
              schema:
                $ref: '#/components/schemas/ChiftError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - mcp_auth:
            - accounting
            - accounting.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: ''
      type: object
      required:
        - message
      title: ChiftError
    HTTPValidationError:
      title: Validation Error
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          default: Validation error
        status:
          title: Status
          type: string
          default: error
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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.

````