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

# Update customer

> Update an existing customer's details or tags in your affiliate program

## Endpoint

```
PUT https://api.partnero.com/v1/customers/{key}
```

## Parameters

You can identify the customer either by path parameter or request body:

| Parameter | Location | Type   | Description                          |
| --------- | -------- | ------ | ------------------------------------ |
| `key`     | path     | string | Customer's unique key in the URL     |
| `key`     | body     | string | Customer's key (alternative to path) |

## Request body

| Parameter        | Type   | Required | Description                                                               |
| ---------------- | ------ | -------- | ------------------------------------------------------------------------- |
| `update`         | object | Yes      | Object containing fields to update                                        |
| `update.email`   | string | No       | New email address                                                         |
| `update.name`    | string | No       | Customer's first name                                                     |
| `update.surname` | string | No       | Customer's last name                                                      |
| `update.key`     | string | No       | New customer key (must be unique)                                         |
| `update.tags`    | array  | No       | Tags to associate. Empty array `[]` removes all tags. `null` skips update |

## Request

<CodeGroup>
  ```bash cURL (by path) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/customers/customer_123' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "update": {
        "name": "Amanda",
        "surname": "Green",
        "email": "amanda.green@example.com",
        "tags": ["premium", "vip"]
      }
    }'
  ```

  ```bash cURL (by body key) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/customers' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "key": "customer_123",
      "update": {
        "name": "Amanda",
        "tags": ["premium"]
      }
    }'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "key": "customer_123",
      "partner": "partner_123",
      "deleted": false,
      "name": "Amanda",
      "surname": "Green",
      "email": "amanda.green@example.com",
      "status": "active",
      "created_at": "2025-05-02T16:12:39.000000Z",
      "updated_at": "2025-05-02T18:45:22.000000Z",
      "deleted_at": null,
      "tags": [
        {
          "value": "premium"
        },
        {
          "value": "vip"
        }
      ]
    },
    "status": 1
  }
  ```
</ResponseExample>
