> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.paywithatoa.co.uk/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**

<ParamField path="customerId" type="string" required>
  The customer's unique identifier (UUID).
</ParamField>

**Request Body Schema**

All fields are optional. Same validation rules as [Create Customer](./create-customer).

<ParamField body="fullName" type="string">
  Customer's full name (2-30 characters).
</ParamField>

<ParamField body="email" type="string">
  Valid email address.
</ParamField>

<ParamField body="type" type="string">
  `INDIVIDUAL` or `BUSINESS`.
</ParamField>

<ParamField body="phoneCountryCode" type="string">
  Phone country code (max 5 chars, digits only).
</ParamField>

<ParamField body="phoneNumber" type="string">
  Phone number (max 15 chars, digits only).
</ParamField>

<ParamField body="address" type="string">
  Customer's address (max 100 characters).
</ParamField>

<ParamField body="city" type="string">
  Customer's city (max 30 characters).
</ParamField>

<ParamField body="postcode" type="string">
  Postcode (4-8 characters, alphanumeric).
</ParamField>

<ParamField body="vatNumber" type="string">
  VAT number (9 digits, optionally prefixed with `GB`).
</ParamField>

<RequestExample>
  ```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"
  }'
  ```

  ```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"
  }
  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",
      }),
    }
  );

  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"
    ]),
    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"
    }`)

    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\"}")
    .asString();
  ```
</RequestExample>

<ResponseExample>
  ```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",
    "createdAt": "2025-06-15T10:30:00.000Z"
  }
  ```

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