# Delete an account

Source: https://developers.swell.is/backend-api/accounts/delete-an-account

Delete a customer account permanently by clearing all records (carts, orders, invoices, and subscriptions) from the account. Use `$force_delete: true` in the same request to do so.

## Arguments

- `id` (objectId, required): The ID of the account to delete.

## Example request

`DELETE /accounts/:id`

**cURL**

```bash
$ curl https://api.swell.store/accounts/60f1994f9111e7000000000d \
  -u store-id:secret-key \
  -X DELETE
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.delete('/accounts/{id}', {
  id: '60f1994f9111e7000000000d'
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->delete('/accounts/{id}', [
  'id' => '60f1994f9111e7000000000d'
]);
```

## Example response

```json
{
  "id": "60f1994f9111e7000000000d",
  "email": "customer@example.com",
  "balance": 50,
  "billing": {
    "name": "Jon Snow",
    "first_name": "Jon",
    "last_name": "Snow",
    "address1": "1 Main Street",
    "city": "Brooklyn",
    "state": "NY",
    "zip": 11201,
    "country": "US",
    "phone": "(555) 555-5555",
    "method": "card",
    "card": {
      "token": "card_1Ds1K7E30PFlZWil6Q7bJ1PD",
      "test": true,
      "last4": "4242",
      "brand": "Visa",
      "address_check": "unchecked",
      "zip_check": "unchecked",
      "cvc_check": "unchecked",
      "exp_month": 1,
      "exp_year": 2029,
      "fingerprint": "3e63991847bbdaafdbc5c8f110ad803f"
    },
    "account_card_id": "5c3ac9870b3b171a7dfaf089"
  },
  "cart_abandoned_count": 18,
  "currency": "USD",
  "date_created": "2021-07-16T14:35:59.938Z",
  "date_first_cart_abandoned": "2018-01-01T00:00:00.000Z",
  "date_first_order": "2019-01-01T00:00:00.000Z",
  "date_last_cart_abandoned": "2021-07-16T14:35:59.938Z",
  "date_last_login": "2021-07-16T14:35:59.938Z",
  "date_last_order": "2021-07-16T14:35:59.938Z",
  "date_updated": "2021-07-16T14:35:59.938Z",
  "first_name": "Jon",
  "group": "vip",
  "last_name": "Snow",
  "name": "Jon Snow",
  "order_value": 5,
  "password": "$2a$06$hnxbq8likRXJFRa6VrKn7uayucRZw1dH5EQsHwPbWliy3FoNYIpIq",
  "password_reset_key": null,
  "password_reset_url": null,
  "phone": "(555) 555-5555",
  "shipping": {
    "name": "Jon Snow",
    "first_name": "Jon",
    "last_name": "Snow",
    "address1": "1 Main Street",
    "city": "Brooklyn",
    "state": "NY",
    "zip": 11201,
    "country": "US",
    "phone": "(555) 555-5555",
    "account_address_id": "5c12c5fdfcd74b34e19cf659"
  },
  "type": "individual"
}
```
