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

# Create a Buyer

POST https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/buyers
Content-Type: application/json

A Buyer represents the company or business that will use American Express Card on-demand for making business payments. The Buyer is a parent to the Accounts and Card Users.

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

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

### Body (application/json)

This endpoint expects an object.

- `name` (string, required) — The legal name of the organization. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.
- `phone` (list of BuyerPhoneItems, required) — The phone details of the Buyer; currently supports only one phone. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `email` (list of BuyerEmailItems, required) — The email of the Buyer; currently supports only one email. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `address` (list of BuyerAddressItems, required) — The residential address of the Buyer; currently supports only one address. At least one address with a type of BUSINESS is required. A Buyer cannot have multiple addresses of the same type or same purpose. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `doingBusinessAsName` (string, optional) — The Doing Business As (DBA) name of the Company. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.
- `governmentId` (string, optional) — A government-provided identifier for the business, like a tax ID, that can be used for pulling spend or transactions for an entity for tax filing, accounting, and other related requirements. Only numeric characters are allowed.

## Response

### 200

Successful operation

- `buyerId` (string, required) — A unique Buyer ID that is created during the Buyer enrollment.
- `name` (string, required) — The legal name of the organization. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.
- `phone` (list of BuyerPhoneItems, required) — The phone details of the Buyer; currently supports only one phone. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `email` (list of BuyerEmailItems, required) — The email of the Buyer; currently supports only one email. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `address` (list of BuyerAddressItems, required) — The residential address of the Buyer; currently supports only one address. At least one address with a type of BUSINESS is required. A Buyer cannot have multiple addresses of the same type or same purpose. It can be displayed on the cards sent to the Suppliers via the email delivery method.
- `doingBusinessAsName` (string, optional) — The Doing Business As (DBA) name of the Company. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.
- `governmentId` (string, optional) — A government-provided identifier for the business, like a tax ID, that can be used for pulling spend or transactions for an entity for tax filing, accounting, and other related requirements. Only numeric characters are allowed.

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

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

## Types

### BuyerPhoneItems

- `countryCode` (enum, required) — The country code must be three digits. Only 001 country code will be supported at this time.
  - Allowed values: `001`
- `number` (string, required) — The phone number of the Buyer. Only numeric characters are allowed.
- `type` (enum, required) — Only BUSINESS will be supported.
  - Allowed values: `BUSINESS`

### BuyerEmailItems

- `type` (enum, required) — The type of email; currently supports only BUSINESS.
  - Allowed values: `BUSINESS`
- `emailAddress` (string, required) — The corporate email address of the Buyer being enrolled.

### BuyerAddressItems

- `type` (enum, required) — The means of distinguishing different types of addresses associated with the Buyer being enrolled.
  - Allowed values: `BUSINESS`
- `purpose` (enum, required) — The purpose for which the address will be used.
  - Allowed values: `PRIMARY`
- `line1` (string, required) — The address of the organization. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.
- `city` (string, required) — The city of the Buyer's address.
- `state` (string, required) — The state of the Buyer's address. Only the full state name is accepted; two-character state codes are not allowed.
- `country` (string, required) — The two-letter code of the Buyer's country. Please refer to the Alpha 2 Code column in the [ISO Country Codes](iso-country-codes.pdf) list. Currently, the API only supports U.S. addresses. Support for U.K. addresses is coming soon. e.g., US, UK
- `postalCode` (string, required) — The Postal Code of the Buyer's address. Only numeric values and a hyphen are allowed. Some examples are 85260 or 85260-7706.
- `line2` (string, optional) — Address line two, if applicable. Alphanumeric characters, special characters ([]?!|$:.-_@*%~#^£¢¤¬(),&) and spaces are allowed.

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

**Request**

```json
{
  "name": "Cavendish Holdings, Inc.",
  "phone": [
    {
      "countryCode": "001",
      "number": "5555551111",
      "type": "BUSINESS"
    }
  ],
  "email": [
    {
      "type": "BUSINESS",
      "emailAddress": "someone@example.com"
    }
  ],
  "address": [
    {
      "type": "BUSINESS",
      "purpose": "PRIMARY",
      "line1": "100 Elm Street",
      "city": "Phoenix",
      "state": "Arizona",
      "country": "US",
      "postalCode": "12345",
      "line2": "Suite A"
    }
  ],
  "doingBusinessAsName": "Cavendish Holdings",
  "governmentId": "7676323222"
}
```

**Response**

```json
{
  "buyerId": "OBpB8D9X93VO03sm",
  "name": "Cavendish Holdings, Inc.",
  "phone": [
    {
      "countryCode": "001",
      "number": "5555551111",
      "type": "BUSINESS"
    }
  ],
  "email": [
    {
      "type": "BUSINESS",
      "emailAddress": "someone@example.com"
    }
  ],
  "address": [
    {
      "type": "BUSINESS",
      "purpose": "PRIMARY",
      "line1": "100 Elm Street",
      "city": "Phoenix",
      "state": "Arizona",
      "country": "US",
      "postalCode": "12345",
      "line2": "Suite A"
    }
  ],
  "doingBusinessAsName": "Cavendish Holdings",
  "governmentId": "7676323222"
}
```

**SDK Code**

```python createBuyer_example
import requests

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

payload = {
    "name": "Cavendish Holdings, Inc.",
    "phone": [
        {
            "countryCode": "001",
            "number": "5555551111",
            "type": "BUSINESS"
        }
    ],
    "email": [
        {
            "type": "BUSINESS",
            "emailAddress": "someone@example.com"
        }
    ],
    "address": [
        {
            "type": "BUSINESS",
            "purpose": "PRIMARY",
            "line1": "100 Elm Street",
            "city": "Phoenix",
            "state": "Arizona",
            "country": "US",
            "postalCode": "12345",
            "line2": "Suite A"
        }
    ],
    "doingBusinessAsName": "Cavendish Holdings",
    "governmentId": "7676323222"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript createBuyer_example
const url = 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/buyers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Cavendish Holdings, Inc.","phone":[{"countryCode":"001","number":"5555551111","type":"BUSINESS"}],"email":[{"type":"BUSINESS","emailAddress":"someone@example.com"}],"address":[{"type":"BUSINESS","purpose":"PRIMARY","line1":"100 Elm Street","city":"Phoenix","state":"Arizona","country":"US","postalCode":"12345","line2":"Suite A"}],"doingBusinessAsName":"Cavendish Holdings","governmentId":"7676323222"}'
};

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

```go createBuyer_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"Cavendish Holdings, Inc.\",\n  \"phone\": [\n    {\n      \"countryCode\": \"001\",\n      \"number\": \"5555551111\",\n      \"type\": \"BUSINESS\"\n    }\n  ],\n  \"email\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"emailAddress\": \"someone@example.com\"\n    }\n  ],\n  \"address\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"purpose\": \"PRIMARY\",\n      \"line1\": \"100 Elm Street\",\n      \"city\": \"Phoenix\",\n      \"state\": \"Arizona\",\n      \"country\": \"US\",\n      \"postalCode\": \"12345\",\n      \"line2\": \"Suite A\"\n    }\n  ],\n  \"doingBusinessAsName\": \"Cavendish Holdings\",\n  \"governmentId\": \"7676323222\"\n}")

	req, _ := http.NewRequest("POST", 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 createBuyer_example
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Cavendish Holdings, Inc.\",\n  \"phone\": [\n    {\n      \"countryCode\": \"001\",\n      \"number\": \"5555551111\",\n      \"type\": \"BUSINESS\"\n    }\n  ],\n  \"email\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"emailAddress\": \"someone@example.com\"\n    }\n  ],\n  \"address\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"purpose\": \"PRIMARY\",\n      \"line1\": \"100 Elm Street\",\n      \"city\": \"Phoenix\",\n      \"state\": \"Arizona\",\n      \"country\": \"US\",\n      \"postalCode\": \"12345\",\n      \"line2\": \"Suite A\"\n    }\n  ],\n  \"doingBusinessAsName\": \"Cavendish Holdings\",\n  \"governmentId\": \"7676323222\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/buyers")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Cavendish Holdings, Inc.\",\n  \"phone\": [\n    {\n      \"countryCode\": \"001\",\n      \"number\": \"5555551111\",\n      \"type\": \"BUSINESS\"\n    }\n  ],\n  \"email\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"emailAddress\": \"someone@example.com\"\n    }\n  ],\n  \"address\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"purpose\": \"PRIMARY\",\n      \"line1\": \"100 Elm Street\",\n      \"city\": \"Phoenix\",\n      \"state\": \"Arizona\",\n      \"country\": \"US\",\n      \"postalCode\": \"12345\",\n      \"line2\": \"Suite A\"\n    }\n  ],\n  \"doingBusinessAsName\": \"Cavendish Holdings\",\n  \"governmentId\": \"7676323222\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/buyers', [
  'body' => '{
  "name": "Cavendish Holdings, Inc.",
  "phone": [
    {
      "countryCode": "001",
      "number": "5555551111",
      "type": "BUSINESS"
    }
  ],
  "email": [
    {
      "type": "BUSINESS",
      "emailAddress": "someone@example.com"
    }
  ],
  "address": [
    {
      "type": "BUSINESS",
      "purpose": "PRIMARY",
      "line1": "100 Elm Street",
      "city": "Phoenix",
      "state": "Arizona",
      "country": "US",
      "postalCode": "12345",
      "line2": "Suite A"
    }
  ],
  "doingBusinessAsName": "Cavendish Holdings",
  "governmentId": "7676323222"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp createBuyer_example
using RestSharp;

var client = new RestClient("https://api.qasb2s.americanexpress.com/commercial/v1/card_on_demand/buyers");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Cavendish Holdings, Inc.\",\n  \"phone\": [\n    {\n      \"countryCode\": \"001\",\n      \"number\": \"5555551111\",\n      \"type\": \"BUSINESS\"\n    }\n  ],\n  \"email\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"emailAddress\": \"someone@example.com\"\n    }\n  ],\n  \"address\": [\n    {\n      \"type\": \"BUSINESS\",\n      \"purpose\": \"PRIMARY\",\n      \"line1\": \"100 Elm Street\",\n      \"city\": \"Phoenix\",\n      \"state\": \"Arizona\",\n      \"country\": \"US\",\n      \"postalCode\": \"12345\",\n      \"line2\": \"Suite A\"\n    }\n  ],\n  \"doingBusinessAsName\": \"Cavendish Holdings\",\n  \"governmentId\": \"7676323222\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift createBuyer_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Cavendish Holdings, Inc.",
  "phone": [
    [
      "countryCode": "001",
      "number": "5555551111",
      "type": "BUSINESS"
    ]
  ],
  "email": [
    [
      "type": "BUSINESS",
      "emailAddress": "someone@example.com"
    ]
  ],
  "address": [
    [
      "type": "BUSINESS",
      "purpose": "PRIMARY",
      "line1": "100 Elm Street",
      "city": "Phoenix",
      "state": "Arizona",
      "country": "US",
      "postalCode": "12345",
      "line2": "Suite A"
    ]
  ],
  "doingBusinessAsName": "Cavendish Holdings",
  "governmentId": "7676323222"
] 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/buyers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```