# Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.  For example, if you pass the **source** parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the **source** parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the `past_due` state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the **default\_source** for a customer will not trigger this behavior.

This request accepts mostly the same arguments as the customer creation call.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createCustomer
POST /v1/customers {"name":"Jenny Rosen","email":"jennyrosen@example.com"}

## Request

```curl
curl https://api.stripe.com/v1/customers/{{CUSTOMER_ID}} \
  -u "<<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2025-04-30.basil" \
  -d "metadata[order_id]"=6735
```

### Response

```json
{
  "id": "cus_NffrFeUfNV2Hib",
  "object": "customer",
  "address": null,
  "balance": 0,
  "created": 1680893993,
  "currency": null,
  "default_source": null,
  "delinquent": false,
  "description": null,
  "email": "jennyrosen@example.com",
  "invoice_prefix": "0759376C",
  "invoice_settings": {
    "custom_fields": null,
    "default_payment_method": null,
    "footer": null,
    "rendering_options": null
  },
  "livemode": false,
  "metadata": {
    "order_id": "6735"
  },
  "name": "Jenny Rosen",
  "next_invoice_sequence": 1,
  "phone": null,
  "preferred_locales": [],
  "shipping": null,
  "tax_exempt": "none",
  "test_clock": null
}
```

## Returns

Returns the customer object if the update succeeded. Raises [an error](https://docs.stripe.com/api/customers/update.md#errors) if update parameters are invalid (e.g. specifying an invalid coupon or an invalid source).

## Parameters

- [`address`](https://docs.stripe.com/api/customers/update.md?query=address) (object, required if calculating taxes)
  The customer’s address.

- `balance` (integer, optional)
  An integer amount in the smallest currency unit that represents the customer’s current balance, which affect the customer’s future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.

- [`cash_balance`](https://docs.stripe.com/api/customers/update.md?query=cash_balance) (object, optional)
  Balance information and default balance settings for this customer.

- `default_source` (string, optional)
  If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/docs/api/customers/update.md#update_customer-invoice_settings-default_payment_method) parameter.

  Provide the ID of a payment source already attached to this customer to make it this customer’s default payment source.

  If you want to add a new payment source and make it the default, see the [source](https://docs.stripe.com/docs/api/customers/update.md#update_customer-source) property.

- `description` (string, optional)
  An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.

- `email` (string, optional)
  Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.

- `invoice_prefix` (string, optional)
  The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.

- [`invoice_settings`](https://docs.stripe.com/api/customers/update.md?query=invoice_settings) (object, optional)
  Default invoice settings for this customer.

- `metadata` (object, optional)
  Set of [key-value pairs](https://docs.stripe.com/docs/api/metadata.md) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

- `name` (string, optional)
  The customer’s full name or business name.

- `next_invoice_sequence` (integer, optional)
  The sequence to be used on the customer’s next invoice. Defaults to 1.

- `phone` (string, optional)
  The customer’s phone number.

- `preferred_locales` (array of strings, optional)
  Customer’s preferred languages, ordered by preference.

- [`shipping`](https://docs.stripe.com/api/customers/update.md?query=shipping) (object, optional)
  The customer’s shipping information. Appears on invoices emailed to this customer.

- `source` (string, optional)
  When using payment sources created via the Token or Sources APIs, passing `source` will create a new source object, make it the new customer default source, and delete the old customer default if one exists. If you want to add additional sources instead of replacing the existing default, use the [card creation API](https://docs.stripe.com/docs/api.md#create_card). Whenever you attach a card to a customer, Stripe will automatically validate the card.

- [`tax`](https://docs.stripe.com/api/customers/update.md?query=tax) (object, recommended if calculating taxes)
  Tax details about the customer.

- `tax_exempt` (enum, optional)
  The customer’s tax exemption. One of `none`, `exempt`, or `reverse`.
Possible enum values:
  - `exempt`
  - `none`
  - `reverse`
