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

# Delete branch

> Delete a branch from your store.

<ParamField path="app_id" type="string" required>
  Your store ID in Jelou Shop.
</ParamField>

<ParamField path="branch_id" type="string" required>
  The ID of the branch to delete.
</ParamField>

<Warning>
  You cannot delete a branch that has **active products** linked to it. Deactivate them or move them to another branch before continuing; otherwise you will receive a `409 Conflict` error.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://gateway.jelou.ai/ecommerce/v2/apps/{app_id}/branches/{branch_id}" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 409 Conflict theme={null}
  {
    "message": "No se puede eliminar la sucursal porque tiene productos activos asociados. Desactívalos o muévelos antes de continuar.",
    "errors": {
      "branch": [
        "No se puede eliminar la sucursal porque tiene productos activos asociados."
      ]
    },
    "active_products_count": 12
  }
  ```
</ResponseExample>

<Note>
  The `message` and `errors.branch` texts are returned by the API in Spanish (they are not localized), so they are shown here exactly as the API responds. Use `active_products_count` and the `409` status code for programmatic handling.
</Note>
