---
updatedAt: 2026-08-28T20:13:20.000Z
agentTools:
  projectIndex: https://docs.preczn.com/llms.txt
---

# Delete a location

Removes the location and de-indexes it from the merchant's `locations` array. Returns 204 with an empty body on success. A location currently designated as the merchant's primary cannot be deleted — that returns 409, and the caller must reassign or clear `primaryLocationId` via PATCH /v1/merchants/{merchantId} first. Deleting a location triggers no processor deprovisioning.

# 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}/locations/{locationId}": {
      "delete": {
        "description": "Removes the location and de-indexes it from the merchant's `locations` array. Returns 204 with an empty body on success. A location currently designated as the merchant's primary cannot be deleted — that returns 409, and the caller must reassign or clear `primaryLocationId` via PATCH /v1/merchants/{merchantId} first. Deleting a location triggers no processor deprovisioning.",
        "operationId": "deleteMerchantLocation",
        "parameters": [
          {
            "name": "merchantId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Location deleted. Empty body."
          },
          "401": {
            "description": "Unauthorized (test-mode mismatch)."
          },
          "403": {
            "description": "Forbidden (platform mismatch)."
          },
          "404": {
            "description": "Merchant not found, or location not found on this merchant."
          },
          "409": {
            "description": "Location is the merchant's primary location and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Delete a location",
        "tags": [
          "Merchant Locations"
        ]
      }
    }
  },
  "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"
      }
    }
  }
}
```