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

# Update Customer | Customers API

> Update customer via the Atoa Customers API, request parameters, response schema and code samples in cURL, Python, JavaScript, PHP, Go and Java.

Update a customer by ID. All fields are optional — only include the fields you want to update.

### Authorization

Bearer `<accessSecret>`

**Path Parameters**

**customerId** `string` *required*

The customer's unique identifier (UUID).

**Request Body Schema**

All fields are optional. Same validation rules as [Create Customer](https://docs.paywithatoa.com/api-reference/customers/create-customer.md).

**fullName** `string`

Customer's full name (2-30 characters).

**email** `string`

Valid email address.

**type** `string`

`INDIVIDUAL` or `BUSINESS`.

**phoneCountryCode** `string`

Phone country code (max 5 chars, digits only).

**phoneNumber** `string`

Phone number (max 15 chars, digits only).

**address** `string`

Customer's address (max 100 characters).

**city** `string`

Customer's city (max 30 characters).

**postcode** `string`

Postcode (4-8 characters, alphanumeric).

**vatNumber** `string`

VAT number (9 digits, optionally prefixed with `GB`).

**metadata** `object`

Set of key-value pairs that you can attach to a customer. Supplied keys are merged onto the existing metadata rather than replacing it.

* Up to **50** key-value pairs.
* Each key must be **1-40** characters, must not contain `[` or `]`, and must not be blank or have leading or trailing whitespace.
* Each value must be a **string** of at most **500** characters.
* A key sent with an empty-string value (`""`) removes that key; other keys are added or updated.

Once set, metadata is returned in the **Get Customer**, **List Customers**, and **Update Customer** responses.

```bash curl theme={null}
curl --request PUT \
  --url https://api.atoa.me/api/customers/{customerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "fullName": "John Doe Updated",
  "address": "456 New Street",
  "city": "Manchester",
  "metadata": {
    "loyaltyTier": "platinum"
  }
}'
```

```python Python theme={null}
import requests

url = "https://api.atoa.me/api/customers/{customerId}"
payload = {
    "fullName": "John Doe Updated",
    "address": "456 New Street",
    "city": "Manchester",
    "metadata": {
        "loyaltyTier": "platinum"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://api.atoa.me/api/customers/{customerId}",
  {
    method: "PUT",
    headers: {
      Authorization: "Bearer <token>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      fullName: "John Doe Updated",
      address: "456 New Street",
      city: "Manchester",
      metadata: {
        loyaltyTier: "platinum",
      },
    }),
  }
);

const data = await response.json();
console.log(data);
```

```php PHP theme={null}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.atoa.me/api/customers/{customerId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    "fullName" => "John Doe Updated",
    "address" => "456 New Street",
    "city" => "Manchester",
    "metadata" => [
      "loyaltyTier" => "platinum"
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

```go Go theme={null}
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.atoa.me/api/customers/{customerId}"
  payload := strings.NewReader(`{
    "fullName": "John Doe Updated",
    "address": "456 New Street",
    "city": "Manchester",
    "metadata": {
      "loyaltyTier": "platinum"
    }
  }`)

  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

```java Java theme={null}
HttpResponse<String> response = Unirest.put("https://api.atoa.me/api/customers/{customerId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\"fullName\":\"John Doe Updated\",\"address\":\"456 New Street\",\"city\":\"Manchester\",\"metadata\":{\"loyaltyTier\":\"platinum\"}}")
  .asString();
```

```json 200 theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "fullName": "John Doe Updated",
  "email": "john.doe@example.com",
  "type": "INDIVIDUAL",
  "phoneCountryCode": "44",
  "phoneNumber": "7911123456",
  "address": "456 New Street",
  "city": "Manchester",
  "postcode": "SW1A 1AA",
  "metadata": {
    "crmId": "CRM-8842",
    "loyaltyTier": "platinum"
  },
  "createdAt": "2025-06-15T10:30:00.000Z"
}
```

```json 404 theme={null}
{
  "name": "NOT_FOUND",
  "message": "Customer not found",
  "status": 404,
  "errors": []
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.