> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# 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://docs.payabli.com/developers/api-reference/customer/update-customer-record

## Authentication

- `Authorization` header (bearer token, required)
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## 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 the Payabli Portal.

### Body (application/json)

- `customerNumber` (string, optional) — User-provided unique identifier for the customer. This is typically the customer ID from your own system.
- `customerUsername` (string, optional) — Customer username for customer portal
- `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)
- `company` (string, optional) — Company name
- `firstname` (string, optional) — Customer first name
- `lastname` (string, optional) — Customer last name
- `phone` (string, optional) — Customer phone number. Payabli normalizes this value when it's stored. For example, `(555) 555-0100` is stored as `+15555550100`.
- `email` (string, optional) — Customer email address.
- `address` (string, optional) — Customer address
- `address1` (string, optional) — Additional customer address
- `city` (string, optional) — Customer city
- `state` (string, optional) — Customer State
- `zip` (string, optional) — Customer postal code
- `country` (string, optional) — Customer country in ISO-3166-1 alpha 2 format. See https://en.wikipedia.org/wiki/ISO_3166-1 for reference.
- `shippingAddress` (string, optional) — The shipping address.
- `shippingAddress1` (string, optional) — Additional line for shipping address.
- `shippingCity` (string, optional) — Shipping city.
- `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`.
- `shippingCountry` (string, optional) — Shipping address country.
- `balance` (double, optional) — Customer balance.
- `timeZone` (integer, optional) — Timezone, in UTC offset. For example, -5 is Eastern time.
- `additionalFields` (map from string to string, optional) — Additional Custom fields in format "key":"value".
- `identifierFields` (list of string, optional) — List of fields acting as customer identifiers, to be used instead of CustomerNumber.
- `createdAt` (datetime, optional) — Timestamp of when record was created, in UTC.

## Response

### 200

Success

- `responseText` (string, required) — Response text for operation: 'Success' or 'Declined'.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components.
- `roomId` (long, optional) — Describes the room ID. Only in use on Boarding endpoints, returns `0` when not applicable.
- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `responseData` (string or integer, optional) — The response data.

## Examples

**Request**

```json
{
  "firstname": "Irene",
  "lastname": "Canizales",
  "address1": "145 Bishop's Trail",
  "city": "Mountain City",
  "state": "TN",
  "zip": "37612",
  "country": "US"
}
```

**Response**

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

**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        clientId: "YOUR_CLIENT_ID",
        clientSecret: "YOUR_CLIENT_SECRET",
    });
    await client.customer.updateCustomer(4440, {
        firstname: "Irene",
        lastname: "Canizales",
        address1: "145 Bishop's Trail",
        city: "Mountain City",
        state: "TN",
        zip: "37612",
        country: "US",
    });
}
main();

```

```python
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.customer.update_customer(
    customer_id=4440,
    firstname="Irene",
    lastname="Canizales",
    address_1="145 Bishop\'s Trail",
    city="Mountain City",
    state="TN",
    zip="37612",
    country="US",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.types.CustomerData;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.customer().updateCustomer(
            4440,
            CustomerData
                .builder()
                .firstname("Irene")
                .lastname("Canizales")
                .address1("145 Bishop's Trail")
                .city("Mountain City")
                .state("TN")
                .zip("37612")
                .country("US")
                .build()
        );
    }
}
```

```ruby
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

client.customer.update_customer(
  customer_id: 4440,
  firstname: "Irene",
  lastname: "Canizales",
  address_1: "145 Bishop's Trail",
  city: "Mountain City",
  state: "TN",
  zip: "37612",
  country: "US"
)

```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.Customer.UpdateCustomerAsync(
            customerId: 4440,
            request: new CustomerData {
                Firstname = "Irene",
                Lastname = "Canizales",
                Address1 = "145 Bishop's Trail",
                City = "Mountain City",
                State = "TN",
                Zip = "37612",
                Country = "US"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.CustomerData{
        Firstname: payabli.String(
            "Irene",
        ),
        Lastname: payabli.String(
            "Canizales",
        ),
        Address1: payabli.String(
            "145 Bishop's Trail",
        ),
        City: payabli.String(
            "Mountain City",
        ),
        State: payabli.String(
            "TN",
        ),
        Zip: payabli.String(
            "37612",
        ),
        Country: payabli.String(
            "US",
        ),
    }
    client.Customer.UpdateCustomer(
        context.TODO(),
        4440,
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\Types\CustomerData;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->customer->updateCustomer(
    4440,
    new CustomerData([
        'firstname' => 'Irene',
        'lastname' => 'Canizales',
        'address1' => "145 Bishop's Trail",
        'city' => 'Mountain City',
        'state' => 'TN',
        'zip' => '37612',
        'country' => 'US',
    ]),
);

```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "firstname": "Irene",
  "lastname": "Canizales",
  "address1": "145 Bishop's Trail",
  "city": "Mountain City",
  "state": "TN",
  "zip": "37612",
  "country": "US"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Customer/4440")! 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()
```