# Update

## `$kit->customers->update()`

Updates an existing customer. Only the fields you pass are changed; omitted fields are left untouched in Stripe.

## Signature

```php
public function update(string $customerId, array $input): array
```

## Parameters

| Field | Type | Description |
| --- | --- | --- |
| `email` | `string` | Replaces the customer's email. Validated and lowercased the same way as on `create()`. |
| `name` | `string` | Replaces the customer's name. |
| `phone` | `string` | Replaces the phone number. |
| `description` | `string` | Replaces the internal description. |
| `address` | `array` | Replaces the full address object; you cannot patch a single sub-field, send the complete address. |
| `defaultPaymentMethodId` | `string` | Sets the customer's default payment method for future invoices and off-session charges. |
| `metadata` | `array<string,string>` | Replaces the customer's metadata. Unlike `create()`, this does not merge with a `source` key, whatever you pass here becomes the full metadata object in Stripe. |

## Example request

```php
$customer = $kit->customers->update('cus_R1a2B3c4D5e6F7', [
    'name' => 'Anna de Vries',
    'defaultPaymentMethodId' => 'pm_1P9k2K2eZvKYlo2C3example',
]);
```

## Example response

```php
[
    'id' => 'cus_R1a2B3c4D5e6F7',
    'userId' => null,
    'email' => 'anna@example.com',
    'name' => 'Anna de Vries',
    'phone' => '+31612345678',
    'description' => null,
    'address' => null,
    'defaultPaymentMethodId' => 'pm_1P9k2K2eZvKYlo2C3example',
    'metadata' => ['source' => 'stripekit'],
    'createdAtUtc' => '2026-08-12T09:14:02.000Z',
    'deleted' => false,
]
```

## Errors

| Exception | When |
| --- | --- |
| `StripeOperationError` | The customer ID does not exist, or Stripe rejects a field, for example an invalid `email`. |

## Notes

- If a `storage` adapter is configured, the updated record is persisted via `saveCustomer()` automatically.
- To change the default payment method independently of any other customer field, use [`$kit->paymentMethods->setDefault()`](/packagist-packages/stripekit/modules/payment-methods/set-default.md) instead, it is a more direct call for that one purpose.