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

# Delete Merchant

> Remove a sub-merchant that is pending review or has been rejected.

## Overview

Removes a sub-merchant you no longer want onboarded. Once deleted it no longer appears in [List Merchants](https://docs.eximpe.com/api-reference/v3/merchant/list.md), and [Get Merchant](https://docs.eximpe.com/api-reference/v3/merchant/get.md) answers `404` for its ID. Deleting sends no webhook and no notification.

## When you can delete

| Status | Delete allowed? |
| - | - |
| `PENDING` | Yes |
| `REJECTED` | Yes |
| `IN_REVIEW`, `CHANGES_REQUESTED`, `APPROVED` | No. Refused with a `409`. |

A `CHANGES_REQUESTED` sub-merchant cannot be deleted; fix it with [Update Merchant](https://docs.eximpe.com/api-reference/v3/merchant/update.md) instead. A sub-merchant created through the API in sandbox is approved immediately, so it can never be deleted; the API offers no way to change this. Contact EximPe if you need a sandbox sub-merchant in another status to test with.

## Path Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| merchant\_id | string | Yes | The sub-merchant's ID, e.g. `6182929449`. |

## Response

```json 200 Deleted theme={null}
{
  "success": true,
  "message": "Sub-merchant deleted successfully",
  "data": {
    "id": "6182929449"
  }
}
```

```json 409 Not deletable theme={null}
{
  "success": false,
  "error": {
    "code": "ERR_MERCHANT_004",
    "message": "Sub-Merchant can only be deleted while Pending or Rejected",
    "details": {}
  }
}
```

## Errors

| Status | `error.code` | When | `details` |
| - | - | - | - |
| `401` | `ERR_AUTH_000`, `ERR_AUTH_001` | `X-Client-ID` or `X-Client-Secret` is missing or wrong | `{"authentication": "Missing credentials."}` or `{"authentication": "Invalid credentials."}` |
| `403` | `ERR_AUTH_003` | Your account is not a PSP | `{}`. Only PSPs can manage sub-merchants |
| `403` | `ERR_MERCHANT_017` | Your account is a PSP, but not set up for import collections | `{}`. Contact EximPe |
| `404` | `ERR_MERCHANT_016` | No sub-merchant with this ID belongs to you, or it is already deleted | `{}`. Check the ID |
| `409` | `ERR_MERCHANT_004` | The sub-merchant is `IN_REVIEW`, `CHANGES_REQUESTED` or `APPROVED` | `{}`. It cannot be deleted in this status |


## OpenAPI

````yaml openapi/v3-partner-merchants.json DELETE /partners/merchants/{merchant_id}/
openapi: 3.0.0
info:
  title: EximPe Payment Gateway API — v3 Partner Merchants
  version: 3.0.0
  description: Create and manage sub-merchants on the v3 partner API.
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security:
  - clientAuth: []
    clientSecretAuth: []
    apiVersionHeader: []
tags:
  - name: Merchants
paths:
  /partners/merchants/{merchant_id}/:
    delete:
      tags:
        - Merchants
      summary: Delete Merchant
      description: Remove a sub-merchant that is PENDING or REJECTED.
      operationId: v3_deleteMerchant
      parameters:
        - name: merchant_id
          in: path
          required: true
          description: The sub-merchant's ID.
          schema:
            type: string
      responses:
        '200':
          description: Sub-merchant deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_DeleteMerchantResponse'
              example:
                success: true
                message: Sub-merchant deleted successfully
                data:
                  id: '6182929449'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_AUTH_000
                  message: Missing credentials
                  details:
                    authentication: Missing credentials.
        '403':
          description: >-
            Your account is not a PSP (`ERR_AUTH_003`), or is a PSP not set up
            for import collections (`ERR_MERCHANT_017`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_MERCHANT_017
                  message: >-
                    Sub-Merchant endpoints are only available to IMPORT PSP
                    accounts
                  details: {}
        '404':
          description: No sub-merchant with this ID belongs to you, or it has been deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_MERCHANT_016
                  message: Sub-Merchant not found
                  details: {}
        '409':
          description: >-
            The sub-merchant is IN_REVIEW, CHANGES_REQUESTED or APPROVED and
            cannot be deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              example:
                success: false
                error:
                  code: ERR_MERCHANT_004
                  message: Sub-Merchant can only be deleted while Pending or Rejected
                  details: {}
      security:
        - clientAuth: []
          clientSecretAuth: []
          apiVersionHeader: []
components:
  schemas:
    v3_DeleteMerchantResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
              description: ID of the deleted sub-merchant.
    v3_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Indicates if the request was successful. Always false for error
            responses.
        error:
          $ref: '#/components/schemas/v3_ErrorDetails'
    v3_ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code (e.g., ERR_ORDER_002)
        message:
          type: string
          description: Error message
        details:
          description: >-
            More about the error. An object keyed by field name when fields fail
            validation, with nested objects for nested fields; a string when the
            error is about the request as a whole; or an empty object when there
            is nothing to add.
          oneOf:
            - type: object
              additionalProperties: true
            - type: string
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: >-
        **Client Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret
    apiVersionHeader:
      type: apiKey
      name: X-API-Version
      in: header
      description: >-
        **API Version** - Specifies which version of the API to use (e.g.,
        '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which
        API version your integration uses. Default version information is
        available in the Developer Settings.
      x-displayName: API Version
      x-example: 3.0.0

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.