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

# Update an Account nickname

PATCH https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/{accountId}
Content-Type: application/json

Update the nickname of an enrolled account.

Reference: https://developer.americanexpress.ferndocs.com/payment-services/card-on-demand/api-reference/patch-account

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Exchange your API key and secret for a bearer token, then send it as `Authorization: Bearer <token>`.

## Servers

- `https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand` (Sandbox, default)
- `https://api.americanexpress.com/commercial/v1/card_on_demand` (Production)

## Request

### Path parameters

- `accountId` (string, required) — A unique ID that is created for the Account.

### Body (application/json)

This endpoint expects an object.

- `nickname` (string, required) — The nickname of the American Express funding account. This field only accepts digits zero through nine, letters a-z or A-Z, space, and special characters ( ! # \$ % & ' ( ) \* + , / - . : ; = ? @ \[ ] ^ \` \{ | } \~ ¢ £ ¤ ¬ ). To remove accountNickname, this field must be sent as an empty string.

## Response

### 200

Successful operation

- `accountId` (string, required) — A unique ID that is created for the Account.
- `accountNickname` (string, required) — The nickname of the American Express funding account. This field only accepts digits zero through nine, letters a-z or A-Z, space, and special characters ( ! # \$ % & ' ( ) \* + , / - . : ; = ? @ \[ ] ^ \` \{ | } \~ ¢ £ ¤ ¬ ). To remove accountNickname, this field must be sent as an empty string.

## Errors

### 400 Bad Request Error

Bad Request

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

### 401 Unauthorized Error

Unauthorized

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

### 403 Forbidden Error

Unauthenticated

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

### 404 Not Found Error

Resource not found

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

### 500 Internal Server Error

Service error

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

### 503 Service Unavailable Error

Service unavailable

- `errorCode` (string, required) — A machine-readable field indicating the type of error.
- `errorDescription` (string, optional) — Provides a short description of the error.

## Examples

**Request**

```json
{
  "nickname": "Personal Small Business",
  "accountNickname": "Personal Small Business"
}
```

**Response**

```json
{
  "accountId": "CR6gVOF5QgCqunZ",
  "accountNickname": "Personal Small Business"
}
```

**SDK Code**

```python patchAccount_example
import requests

url = "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ"

payload = {
    "nickname": "Personal Small Business",
    "accountNickname": "Personal Small Business"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript patchAccount_example
const url = 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"nickname":"Personal Small Business","accountNickname":"Personal Small Business"}'
};

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

```go patchAccount_example
package main

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

func main() {

	url := "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ"

	payload := strings.NewReader("{\n  \"nickname\": \"Personal Small Business\",\n  \"accountNickname\": \"Personal Small Business\"\n}")

	req, _ := http.NewRequest("PATCH", 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, _ := io.ReadAll(res.Body)

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

}
```

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

url = URI("https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"nickname\": \"Personal Small Business\",\n  \"accountNickname\": \"Personal Small Business\"\n}"

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

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

HttpResponse<String> response = Unirest.patch("https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"nickname\": \"Personal Small Business\",\n  \"accountNickname\": \"Personal Small Business\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ', [
  'body' => '{
  "nickname": "Personal Small Business",
  "accountNickname": "Personal Small Business"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp patchAccount_example
using RestSharp;

var client = new RestClient("https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"nickname\": \"Personal Small Business\",\n  \"accountNickname\": \"Personal Small Business\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift patchAccount_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "nickname": "Personal Small Business",
  "accountNickname": "Personal Small Business"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/accounts/CR6gVOF5QgCqunZ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```