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

# Create a manual match

> Use this endpoint to manually link multiple transactions (at least 2) into a match group with 100% confidence. Transactions must be UNMATCHED and belong to the specified context.



## OpenAPI

````yaml /en/openapi/v3-current/matcher.yaml post /v1/matching/manual
openapi: 3.1.0
info:
  title: Matcher APIs
  description: >-
    Complete API reference for the Matcher reconciliation engine, providing
    automated transaction matching between Midaz Ledger and external systems.
  version: v2.1.1
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/matching/manual:
    post:
      tags:
        - Matching
      summary: Create a manual match
      description: >-
        Use this endpoint to manually link multiple transactions (at least 2)
        into a match group with 100% confidence. Transactions must be UNMATCHED
        and belong to the specified context.
      operationId: createManualMatch
      parameters:
        - description: A unique identifier for tracing the request across services.
          in: header
          name: X-Request-Id
          schema:
            type: string
        - description: Context ID
          in: query
          name: contextId
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/XIdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateManualMatchRequest'
        description: Manual match payload
        required: true
      responses:
        '201':
          description: >-
            Indicates that the resource was successfully created.


            The response includes the `X-Idempotency-Replayed` header.


            If the value is false, the request was just processed. If the value
            is true, the response is a replay of a previously processed request.


            See [Retries and idempotency](/en/reference/retries-idempotency) for
            more details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManualMatchResponse'
          headers:
            X-Idempotency-Replayed:
              $ref: '#/components/headers/XIdempotencyReplayed'
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The request lacks valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The requested resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An unexpected error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  parameters:
    XIdempotencyKey:
      name: X-Idempotency-Key
      in: header
      required: false
      description: >-
        Optional idempotency key for safe retries. Also accepts
        `Idempotency-Key` as an alternative header name. If the same key is sent
        again and the original request was already processed, the cached
        response is returned with `X-Idempotency-Replayed: true`.


        See [Retries and idempotency](/en/reference/retries-idempotency) for
        details.
      schema:
        type: string
  schemas:
    CreateManualMatchRequest:
      properties:
        notes:
          example: Manual match for Q4 reconciliation
          type: string
        transactionIds:
          example:
            - 019c96a0-10ce-75fc-a273-dc799079a99c
          items:
            type: string
          minItems: 2
          type: array
      required:
        - transactionIds
      type: object
    ManualMatchResponse:
      properties:
        matchGroup:
          $ref: '#/components/schemas/MatchGroupResponse'
      type: object
    ErrorResponse:
      description: Standard error response returned by all API endpoints
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: HTTP status code as a string.
          example: '404'
        title:
          type: string
          description: Error type identifier.
          example: not_found
        message:
          type: string
          description: Human-readable error message with details.
          example: context not found
        error:
          type: string
          description: Deprecated. Error message for backward compatibility.
          deprecated: true
        details:
          description: Additional error context as key-value pairs
          additionalProperties: {}
          type: object
    MatchGroupResponse:
      properties:
        confidence:
          $ref: '#/components/schemas/ConfidenceScore'
        confirmedAt:
          type: string
        contextId:
          type: string
        createdAt:
          type: string
        id:
          type: string
        items:
          items:
            $ref: '#/components/schemas/MatchItemResponse'
          type: array
        rejectedReason:
          type: string
        ruleId:
          type: string
        runId:
          type: string
        status:
          $ref: '#/components/schemas/MatchGroupStatus'
        updatedAt:
          type: string
      type: object
    ConfidenceScore:
      type: object
    MatchItemResponse:
      properties:
        allocatedAmount:
          type: number
        allocatedCurrency:
          type: string
        allowPartial:
          type: boolean
        createdAt:
          type: string
        expectedAmount:
          type: number
        id:
          type: string
        matchGroupId:
          type: string
        transactionId:
          type: string
        updatedAt:
          type: string
      type: object
    MatchGroupStatus:
      description: Lifecycle status of a match group
      enum:
        - PROPOSED
        - CONFIRMED
        - REJECTED
      type: string
      x-enum-varnames:
        - MatchGroupStatusProposed
        - MatchGroupStatusConfirmed
        - MatchGroupStatusRejected
  headers:
    XIdempotencyReplayed:
      description: >-
        Indicates whether this response was served from the idempotency cache.
        When `true`, the response is a replay of the original request with the
        same idempotency key.


        See [Retries and idempotency](/en/reference/retries-idempotency) for
        details.
      schema:
        type: boolean
      example: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````