> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://beta-docs.payabli.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://beta-docs.payabli.com/_mcp/server.

# Update customer

PUT https://api-sandbox.payabli.com/api/Customer/{customerId}
Content-Type: application/json

Update a customer record. Include only the fields you want to change.

Reference: https://beta-docs.payabli.com/api-reference/customer/update-customer-record

## Authentication

- `requestToken` header (required) — API Key authentication via header

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `customerId` (integer, required) — Payabli-generated customer ID. Maps to "Customer ID" column in PartnerHub.

### Body (application/json)

This endpoint expects a CustomerData.

- `additionalFields` (map from string to string, optional) — Additional Custom fields in format "key":"value".
- `address` (string, optional) — Customer address
- `address1` (string, optional) — Additional customer address
- `balance` (double, optional) — Customer balance.
- `city` (string, optional) — Customer city
- `company` (string, optional) — Company name
- `country` (string, optional) — Customer country in ISO-3166-1 alpha 2 format See https://en.wikipedia.org/wiki/ISO_3166-1 for reference.
- `createdAt` (datetime, optional) — Timestamp of when record was created, in UTC.
- `customerNumber` (string, optional) — User-provided unique identifier for the customer. This is typically the customer ID from your own system.
- `customerPsw` (string, optional) — Customer password for customer portal
- `customerStatus` (integer, optional) — Customer Status. Possible values: - `-99` Deleted - `0` Inactive - `1` Active - `85` Locked (typically due to multiple failed login attempts)
- `customerUsername` (string, optional) — Customer username for customer portal
- `email` (string, optional) — Customer email address.
- `firstname` (string, optional) — Customer first name
- `identifierFields` (list of string, optional) — List of fields acting as customer identifiers, to be used instead of CustomerNumber.
- `lastname` (string, optional) — Customer last name
- `phone` (string, optional) — Customer phone number
- `shippingAddress` (string, optional) — The shipping address.
- `shippingAddress1` (string, optional) — Additional line for shipping address.
- `shippingCity` (string, optional) — Shipping city.
- `shippingCountry` (string, optional) — Shipping address country.
- `shippingState` (string, optional) — Shipping state or province.
- `shippingZip` (string, optional) — Shipping ZIP code. For Pay In functions, this field supports 5-digit and 9-digit ZIP codes and alphanumeric Canadian postal codes. For example: "37615-1234" or "37615".
- `state` (string, optional) — Customer State
- `timeZone` (integer, optional) — Timezone, in UTC offset. For example, -5 is Eastern time.
- `zip` (string, optional) — Customer zip code

## Response

### 200

Success

- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/api-reference/api-responses).
- `responseData` (Responsedatanonobject, optional) — The response data.
- `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'.

## Errors

### 400 Bad Request Error

Bad request/ invalid data

- `any`

### 401 Unauthorized Error

Unauthorized request.

- `any`

### 500 Internal Server Error

Internal API Error

- `any`

### 503 Service Unavailable Error

Database connection error

- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `responseData` (map from string to any, optional) — The object containing the response data.
- `responseText` (string, optional) — Response text for operation: 'Success' or 'Declined'.

## Types

### Responsedatanonobject

The response data.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "isSuccess": true,
  "responseCode": 1,
  "responseData": " ",
  "responseText": "Success"
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/Customer/998"

payload = {}
headers = {
    "requestToken": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/Customer/998';
const options = {
  method: 'PUT',
  headers: {requestToken: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api-sandbox.payabli.com/api/Customer/998"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Customer/998")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api-sandbox.payabli.com/api/Customer/998")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-sandbox.payabli.com/api/Customer/998', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Customer/998");
var request = new RestRequest(Method.PUT);
request.AddHeader("requestToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Customer/998")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```