# Delete a sub-account

URL: https://docs.sparklayer.io/ignite/api/remove-a-customer-sub-account
Operation: `DELETE /v1/{siteEnv}/{siteId}/sub-accounts/{customer_external_id}` (operationId `deleteSubAccount`)
OpenAPI spec: https://docs.sparklayer.io/openapi/ignite.yaml

Remove a customer sub-account from the specific platform, ensuring the account can no longer interact with the parent account.
Platforms may prevent the deletion of customers which have orders, for this reason it is recommended that the `parent_customer_external_id` attribute is removed from the customer object rather than actual deletion.

`DELETE /v1/{siteEnv}/{siteId}/sub-accounts/{customer_external_id}`

> This is an Ignite endpoint: your integration service implements it and SparkLayer calls it.

### Request SparkLayer sends

```http
DELETE /v1/live/bobs-store/sub-accounts/CUS1234 HTTP/1.1
Host: ignite.example.com
```

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `siteEnv` | string | Yes | The SparkLayer environment the request is for, such as `live`. Store it, with the site ID, when SparkLayer connects your platform. Example: `live` |
| `siteId` | string | Yes | The SparkLayer site ID the request is for, such as `bobs-store`. Store it, with the environment, when SparkLayer connects your platform. Length: min 1. Example: `bobs-store` |
| `customer_external_id` | string | Yes | The customer's ID on your platform. Length: min 1. Example: `CUS1234` |

### Responses your service returns

#### 204: Successful operation

#### 401: Auth Failure

#### 404: Customer not found

#### 500: System Exception
