# Customer routes: update, delete

URL: /code/api/customer/records-update · Id: `page:code/api/customer/records-update`

> The Customer Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for [Customer](/business/nouns/customer), one group of [Customer routes](/code/api/customer).

### Customer.update
Changes the given properties of a Customer. [Verb page](/business/nouns/customer/update?interface=api).

```text
PATCH /{namespace}/customers/{id}
```

Path: `id`. Body, as JSON: the other inputs. Emits `Customer.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Customer. |
| `since` | `datetime` | No | When the party first accepted an Offer. |
| `outside` | `boolean` | No | Computed: true when it shares no owner, account, or sibling chain with the Startup. |
| `billingEmail` | `email` | No | Where Invoices and receipts go, when it differs from the sign-in email. |
| `billingAddress` | `text` | No | The address printed on new Invoices; Stripe Tax reads it to compute tax. |
| `taxIds` | `string[]` | No | The Customer’s tax ids, such as a VAT number, printed on new Invoices and read by Stripe Tax. |
| `creditRecharge` | `json` | No | When unspent credit falls below `below`, buy `amount` of the credit Offer with the default Payment Source. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `customer` | [Customer](/business/nouns/customer) | Yes | The Customer. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X PATCH https://api.sb/leaseline.app/customers/cus_K1BROJhqzZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"since":"2026-10-22T12:00:00Z"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "customer": {
    "$id": "https://api.sb/leaseline.app/customers/cus_K1BROJhqzZ",
    "$type": "Customer",
    "since": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Customer.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Customer.delete
Deletes a Customer: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/customer/delete?interface=api).

```text
DELETE /{namespace}/customers/{id}
```

Path: `id`. Emits `Customer.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Customer. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `customer` | [Customer](/business/nouns/customer) | Yes | The Customer. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X DELETE https://api.sb/leaseline.app/customers/cus_K1BROJhqzZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "customer": {
    "$id": "https://api.sb/leaseline.app/customers/cus_K1BROJhqzZ",
    "$type": "Customer",
    "since": "2026-04-13T08:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Customer.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```