> ## Documentation Index
> Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Customer

> Update an existing customer

# Update Customer

Updates an existing customer's information. Only include the fields you want to update.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.launchmystore.io/api/v1/customers/cust_abc123.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "first_name": "Jonathan",
      "accepts_marketing": true,
      "note": "High-value customer, offer free shipping"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/customers/cust_abc123.json', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      first_name: 'Jonathan',
      accepts_marketing: true,
      note: 'High-value customer, offer free shipping'
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique customer ID
</ParamField>

## Body Parameters

All body parameters are optional. Only include the fields you want to update.

<ParamField body="email" type="string">
  Customer email address
</ParamField>

<ParamField body="first_name" type="string">
  Customer's first name
</ParamField>

<ParamField body="last_name" type="string">
  Customer's last name
</ParamField>

<ParamField body="phone" type="string">
  Customer's phone number
</ParamField>

<ParamField body="accepts_marketing" type="boolean">
  Marketing opt-in status
</ParamField>

<ParamField body="tags" type="array">
  Array of tags. Accepted by the request but not persisted — a customer record
  has no tags field.
</ParamField>

<ParamField body="note" type="string">
  Internal notes about the customer
</ParamField>

<ParamField body="addresses" type="array">
  Array of address objects. Only the **first** address is persisted, and only
  its flat fields (`address1`, `city`, `province`, `country`, `zip`) are stored
  on the customer record — there is no separate addresses collection.

  <Expandable title="Address Object">
    <ParamField body="address1" type="string">
      Street address line 1 (stored)
    </ParamField>

    <ParamField body="city" type="string">
      City (stored)
    </ParamField>

    <ParamField body="province" type="string">
      State/Province (stored)
    </ParamField>

    <ParamField body="country" type="string">
      Country code (stored)
    </ParamField>

    <ParamField body="zip" type="string">
      Postal/ZIP code (stored)
    </ParamField>

    <ParamField body="first_name" type="string">
      First name (accepted, not stored)
    </ParamField>

    <ParamField body="last_name" type="string">
      Last name (accepted, not stored)
    </ParamField>

    <ParamField body="address2" type="string">
      Street address line 2 (accepted, not stored)
    </ParamField>

    <ParamField body="phone" type="string">
      Phone number (accepted, not stored on update)
    </ParamField>

    <ParamField body="default" type="boolean">
      Accepted, not stored
    </ParamField>
  </Expandable>
</ParamField>

## Response

The response is a bare object keyed by `customer` containing the updated
customer object (the same shape returned by the read endpoints).
There is no `{ success, data }` envelope.

<ResponseField name="customer" type="object">
  The updated customer object
</ResponseField>

## Example Response

```json theme={null}
{
  "customer": {
    "id": "cust_abc123",
    "email": "john.doe@example.com",
    "first_name": "Jonathan",
    "last_name": "Doe",
    "name": "Jonathan Doe",
    "phone": "+1-555-123-4567",
    "accepts_marketing": true,
    "orders_count": 5,
    "total_spent": "250.00",
    "tags": [],
    "addresses": [],
    "default_address": null,
    "tax_exempt": false
  }
}
```

## Errors

Errors are returned as a standard `{ "errors": { "base": ["..."] } }` body
with the corresponding HTTP status code.

| Status | Description                                   |
| ------ | --------------------------------------------- |
| `401`  | Invalid or missing access token               |
| `403`  | App doesn't have the `write_customers` scope  |
| `404`  | Customer with the specified ID does not exist |
