---
updatedAt: 2026-07-16T19:00:35.000Z
agentTools:
  projectIndex: https://docs.preczn.com/llms.txt
---

# Delete Merchant

The Merchant API features a DELETE endpoint designed primarily for removing test merchant data from your platform. To prevent accidental data loss, safeguards are in place that prevent the deletion of merchants with associated transactions or payment method tokens.

If a merchant has no linked transactions or tokens, the record will be successfully deleted, and an HTTP status code of 204 will be returned.

Here is a summary of potential scenarios and their corresponding responses:

| Scenario                    | HTTP Status | Error Message                                              |
| --------------------------- | ----------- | ---------------------------------------------------------- |
| No transactions or tokens   | 204         | None                                                       |
| Has associated transactions | 400         | Merchant has associated transactions and cannot be deleted |
| Has associated tokens       | 400         | Merchant has associated tokens and cannot be deleted       |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Preczn API",
    "version": "1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.preczn.com"
    }
  ],
  "paths": {
    "/v1/merchants/{merchantId}": {
      "delete": {
        "operationId": "deleteMerchant",
        "parameters": [
          {
            "name": "merchantId",
            "required": true,
            "in": "path",
            "description": "Merchant ID",
            "schema": {
              "example": "mid_2zyd88xrnr90xskmjmqpd0x1vj",
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "Unique key to ensure idempotency of requests. If provided, the server will return the same response for subsequent requests with the same key.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Merchant deleted."
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "API Key and Platform mismatch\n\nResource Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unable to service request due to server-side error. Please reattempt request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete Merchant",
        "tags": [
          "Merchant Vault"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "Http status code."
          },
          "error": {
            "type": "string",
            "description": "General http error message"
          },
          "message": {
            "oneOf": [
              {
                "type": "string",
                "description": "Error message"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of error messages or validation failure",
                "example": [
                  "field should not be empty.",
                  "field should be non zero."
                ]
              }
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      }
    }
  }
}
```