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

# Merge merchants

> Merge one or more duplicate merchants into a keeper (the path `id`). All references — transactions, documents, postings, and automation rules — are repointed to the keeper, the source role flags are merged in, and the sources are tombstoned. This is permanent: there is no un-merge. The keeper cannot appear in `sourceIds`.



## OpenAPI

````yaml /openapi.json post /api/merchants/{id}/merge
openapi: 3.1.0
info:
  title: Equated API
  version: 1.0.0
  description: >-
    Agent-facing accounting API. Authenticate with a bearer token issued from
    Settings → API Tokens, or via the in-app session cookie when called from the
    web client.
servers:
  - url: https://app.equated.co
    description: API server
security: []
paths:
  /api/merchants/{id}/merge:
    post:
      tags:
        - Merchants
      summary: Merge merchants
      description: >-
        Merge one or more duplicate merchants into a keeper (the path `id`). All
        references — transactions, documents, postings, and automation rules —
        are repointed to the keeper, the source role flags are merged in, and
        the sources are tombstoned. This is permanent: there is no un-merge. The
        keeper cannot appear in `sourceIds`.
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                  minItems: 1
              required:
                - sourceIds
      responses:
        '200':
          description: The keeper merchant after the merge
          content:
            application/json:
              schema:
                type: object
                properties:
                  merchant:
                    $ref: '#/components/schemas/Merchant'
                required:
                  - merchant
      security:
        - bearerAuth: []
components:
  schemas:
    Merchant:
      type: object
      properties:
        id:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        orgMerchantId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        name:
          type: string
        description:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        imageUrl:
          type: string
          nullable: true
        logo:
          type: string
          nullable: true
        isVendor:
          type: boolean
        isCustomer:
          type: boolean
      required:
        - id
        - orgMerchantId
        - name
        - description
        - website
        - imageUrl
        - logo
        - isVendor
        - isCustomer
      additionalProperties:
        nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token issued from the Equated app under Settings → API Tokens.

````