> 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 the status of a Card User

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

Deactivate or reactivate an existing Card User. The Card User can not be in the VERIFICATION_PENDING status. When a Card User is deactivated, all cards assigned to the User will become INACTIVE and the Card status changed webhooks will be sent.

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

## 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

- `cardUserId` (string, required) — A unique ID that is created for the Card User.

### Body (application/json)

This endpoint expects an object.

- `status` (enum, required) — The status to be updated for the Card User.
  - Allowed values: `ACTIVATED`, `DEACTIVATED`

## Response

### 200

Successful operation

- `cardUserId` (string, required) — A unique ID that is created for the Card User.
- `status` (enum, required) — The status to be updated for the Card User.
  - Allowed values: `VERIFICATION_PENDING`

### 202

Accepted operation

- `cardUserId` (string, required) — A unique ID that is created for the Card User.
- `status` (enum, required) — The Card User is currently in VERIFICATION_PENDING status.
  - Allowed values: `VERIFICATION_PENDING`

## Errors

### 400 Bad Request Error

Bad Request

- `errors` (list of 400ErrorItems, required)

### 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.

### 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.

## Types

### 400ErrorItems

- `code` (string, required) — A machine-readable field indicating the type of error.
- `message` (string, required) — Provides a short description of the error.
- `detail` (string, optional) — Provides a detailed description of the error.
- `link` (string, optional) — The link to documentation that explains the error.

## Examples

### patchCardUser_example

**Request**

```json
{
  "status": "ACTIVATED"
}
```

**Response**

```json
{
  "cardUserId": "123456",
  "status": "ACTIVATED"
}
```

**SDK Code**

```python patchCardUser_example
import requests

url = "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456"

payload = { "status": "ACTIVATED" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript patchCardUser_example
const url = 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":"ACTIVATED"}'
};

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

```go patchCardUser_example
package main

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

func main() {

	url := "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456"

	payload := strings.NewReader("{\n  \"status\": \"ACTIVATED\"\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 patchCardUser_example
require 'uri'
require 'net/http'

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

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  \"status\": \"ACTIVATED\"\n}"

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

```java patchCardUser_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/cardusers/123456")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"ACTIVATED\"\n}")
  .asString();
```

```php patchCardUser_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/cardusers/123456', [
  'body' => '{
  "status": "ACTIVATED"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp patchCardUser_example
using RestSharp;

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

```swift patchCardUser_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["status": "ACTIVATED"] 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/cardusers/123456")! 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()
```

### patchCardUser_example

**Request**

```json
{
  "status": "ACTIVATED"
}
```

**Response**

```json
{
  "cardUserId": "123456",
  "status": "VERIFICATION_PENDING"
}
```

**SDK Code**

```python patchCardUser_example
import requests

url = "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456"

payload = { "status": "ACTIVATED" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript patchCardUser_example
const url = 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":"ACTIVATED"}'
};

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

```go patchCardUser_example
package main

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

func main() {

	url := "https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/cardusers/123456"

	payload := strings.NewReader("{\n  \"status\": \"ACTIVATED\"\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 patchCardUser_example
require 'uri'
require 'net/http'

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

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  \"status\": \"ACTIVATED\"\n}"

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

```java patchCardUser_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/cardusers/123456")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"ACTIVATED\"\n}")
  .asString();
```

```php patchCardUser_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/cardusers/123456', [
  'body' => '{
  "status": "ACTIVATED"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp patchCardUser_example
using RestSharp;

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

```swift patchCardUser_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["status": "ACTIVATED"] 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/cardusers/123456")! 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()
```