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

# Delete Location

> Permanently delete an inactive location



## OpenAPI

````yaml delete /v1/locations/{location}
openapi: 3.1.1
info:
  title: HitPay API
  description: >-
    Accept PayNow, FPX, QRIS, GrabPay, cards, and 40+ payment methods with a
    single API. Production base URL: https://api.hit-pay.com, Sandbox:
    https://api.sandbox.hit-pay.com
  version: '1.0'
servers:
  - url: https://api.hit-pay.com
    description: Production
  - url: https://api.sandbox.hit-pay.com
    description: Sandbox
security: []
paths:
  /v1/locations/{location}:
    delete:
      tags:
        - Location
      summary: Delete location
      description: >
        Permanently delete a location. The location must be **inactive** before
        deletion — call

        `PATCH /v1/locations/{location}` with `{"active": false}` first.


        Deletion is blocked if the location is still active, or if it is the
        last remaining location.
      operationId: PublicDeleteLocation
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
        - name: location
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Location ID
      responses:
        '204':
          description: Location deleted successfully
        '400':
          description: Location is still active, or is the last remaining location
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array
        '401':
          description: Missing or invalid API key / OAuth token
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array
        '403':
          description: Authenticated user cannot manage locations
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array
        '404':
          description: Location not found or does not belong to this business
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                  errors:
                    type: array

````