> This page is for Developer.

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

# Update Account

PUT https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/{account_id}
Content-Type: application/json

This endpoint allows you to update an account for a merchant under your franchise.

Reference: https://docs.bigcommerce.com/developer/docs/beta/powered-by/api-reference/accounts/update-account

## Authentication

- `X-Auth-Client` header (required) — The client ID of the franchise API account.
- `X-Auth-Token` header (required) — An OAuth token generated from the franchise API account. To authenticate, generate an **OAuth Token** (if you donʼt have one or itʼs expired): ```http POST https://api.bigcommerce.com/franchises/{franchise_uuid}/v1/oauth/token Accept: application/json X-Auth-Client: {client_id} X-Auth-Secret: {client_secret} { "duration": 900 } ``` Response: ```json { "access_token": "dlkJcn34...Lkd012", "expires_at": "2018-04-24T16:15:26.509045122Z” } ``` After you generate an **OAuth token**, use the `client_id` and `oauth_token` to authenticate all other API requests: ```http GET https://api.bigcommerce.com/franchises/{franchise_uuid}/v1/accounts/123 Accept: application/json X-Auth-Client: {client_id} X-Auth-Token: {oauth_token} ``` Response: ```json { "data": { "id": "12345678910", "name": "Test Company", ... }, "meta": {} } ```

## Request

### Path parameters

- `account_id` (string, required) — The account ID set when the account was created. Can be retrieved through a `GET` request to `/accounts`.

### Headers

- `Accept` (string, required, default: application/json) — The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — Name of the Company that the Account was created for
- `primary_contact` (AccountsAccountIdPutRequestBodyContentApplicationJsonSchemaPrimaryContact, optional) — Primary contact for the Account
- `billing_contact` (AccountsAccountIdPutRequestBodyContentApplicationJsonSchemaBillingContact, optional) — Billing contact information for the Account

## Response

### 200

Success

- `data` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaData, optional)
- `meta` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (double, optional)
- `title` (string, optional)
- `type` (string, optional)
- `errors` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaErrors, optional)

### 401 Unauthorized Error

Unauthorized If a franchise makes a request with a `client_id` and access token that do not belong together or are expired, a 401 Unauthorized Credentials response will be returned.

- `status` (double, optional)
- `title` (string, optional)
- `type` (string, optional)

### 404 Not Found Error

Not Found If the requested account resource is not found for the franchise, you will get a 404 Not Found.

- `status` (double, required)
- `title` (string, required)
- `type` (string, required)

### 502 Bad Gateway Error

Bad Gateway If something happens during the request that causes it to fail, a 502 response is returned. A new request should be made.

- `status` (double, optional)
- `title` (string, optional)
- `type` (string, optional)

### 503 Service Unavailable Error

Service Unavailable If this occurs, you should retry the request. If you are unable to successfully make a request, please check the BigCommerce system status [here](http://status.bigcommerce.com/). A service is likely down and the request will need to be made again when it is back up.

- `status` (double, optional)
- `title` (string, optional)
- `type` (string, optional)
- `errors` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaErrors, optional)

### 504 Gateway Timeout Error

Gateway Timeout If this occurs, you should retry the request. Typically retrying the request several times will result in a successful request. However, if you are unable to successfully make a request, please check the BigCommerce system status [here](http://status.bigcommerce.com/). A service is likely down and the request will need to be made again when it is back up.

- `status` (double, optional)
- `title` (string, optional)
- `type` (string, optional)
- `errors` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaErrors, optional)

## Types

### AccountsAccountIdPutRequestBodyContentApplicationJsonSchemaPrimaryContact

Primary contact for the Account

- `first_name` (string, optional) — First name of the primary contact
- `last_name` (string, optional) — Last name of the primary contact
- `email` (string, optional) — Email address of primary contact
- `address_line_1` (string, optional) — First line of address of primary contact
- `address_line_2` (string, optional) — Second line of address of primary contact (if necessary)
- `city` (string, optional) — City for primary contact
- `district` (string, optional) — District (State in US) of primary contact
- `country` (string, optional) — Country of primary contact
- `postal_code` (string, optional) — Postal / zip code of primary contact
- `phone_number` (string, optional) — Phone number of primary contact

### AccountsAccountIdPutRequestBodyContentApplicationJsonSchemaBillingContact

Billing contact information for the Account

- `first_name` (string, optional) — First name of the billing contact
- `last_name` (string, optional) — Last name of the billing contact
- `email` (string, optional) — Email address of billing contact
- `address_line_1` (string, optional) — First line of address of billing contact
- `address_line_2` (string, optional) — Second line of address of billing contact (if necessary)
- `city` (string, optional) — City for billing contact
- `district` (string, optional) — District (State in US) of billing contact
- `country` (string, optional) — Country of billing contact
- `postal_code` (string, optional) — Postal / zip code of billing contact
- `phone_number` (string, optional) — Phone number of billing contact

### AccountsAccountIdPutResponsesContentApplicationJsonSchemaData

- `id` (string, optional)
- `name` (string, optional)
- `user_email` (string, optional)
- `primary_contact` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaDataPrimaryContact, optional)
- `billing_contact` (AccountsAccountIdPutResponsesContentApplicationJsonSchemaDataBillingContact, optional)

### AccountsAccountIdPutResponsesContentApplicationJsonSchemaMeta

### AccountsAccountIdPutResponsesContentApplicationJsonSchemaErrors

### AccountsAccountIdPutResponsesContentApplicationJsonSchemaDataPrimaryContact

- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `address_line_1` (string, optional)
- `address_line_2` (any, optional)
- `district` (string, optional)
- `country` (string, optional)
- `phone` (string, optional)

### AccountsAccountIdPutResponsesContentApplicationJsonSchemaDataBillingContact

- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `district` (string, optional)
- `country` (string, optional)
- `phone` (string, optional)

## Examples

**Request**

```json
{
  "name": "Test Company, Inc.",
  "primary_contact": {
    "first_name": "Jack",
    "last_name": "Johnson",
    "email": "test@example.com",
    "address_line_1": "123 Main Street",
    "district": "TX"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "12345678910",
    "name": "Test Company, Inc.",
    "user_email": "test_user@example",
    "primary_contact": {
      "first_name": "Jack",
      "last_name": "Johnson",
      "email": "test@example",
      "address_line_1": "123 Main Street",
      "district": "TX",
      "country": "US",
      "phone": "552-344-2344"
    },
    "billing_contact": {
      "first_name": "Jason",
      "last_name": "Johnson",
      "email": "test@example",
      "district": "TX",
      "country": "US",
      "phone": "552-344-2344"
    }
  },
  "meta": {}
}
```

**SDK Code**

```python Example
import requests

url = "https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id"

payload = {
    "name": "Test Company, Inc.",
    "primary_contact": {
        "first_name": "Jack",
        "last_name": "Johnson",
        "email": "test@example.com",
        "address_line_1": "123 Main Street",
        "district": "TX"
    }
}
headers = {
    "Accept": "application/json",
    "X-Auth-Client": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example
const url = 'https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/json',
    'X-Auth-Client': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Test Company, Inc.","primary_contact":{"first_name":"Jack","last_name":"Johnson","email":"test@example.com","address_line_1":"123 Main Street","district":"TX"}}'
};

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

```go Example
package main

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

func main() {

	url := "https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id"

	payload := strings.NewReader("{\n  \"name\": \"Test Company, Inc.\",\n  \"primary_contact\": {\n    \"first_name\": \"Jack\",\n    \"last_name\": \"Johnson\",\n    \"email\": \"test@example.com\",\n    \"address_line_1\": \"123 Main Street\",\n    \"district\": \"TX\"\n  }\n}")

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Client", "<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 Example
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Client"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Test Company, Inc.\",\n  \"primary_contact\": {\n    \"first_name\": \"Jack\",\n    \"last_name\": \"Johnson\",\n    \"email\": \"test@example.com\",\n    \"address_line_1\": \"123 Main Street\",\n    \"district\": \"TX\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id")
  .header("Accept", "application/json")
  .header("X-Auth-Client", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Test Company, Inc.\",\n  \"primary_contact\": {\n    \"first_name\": \"Jack\",\n    \"last_name\": \"Johnson\",\n    \"email\": \"test@example.com\",\n    \"address_line_1\": \"123 Main Street\",\n    \"district\": \"TX\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id', [
  'body' => '{
  "name": "Test Company, Inc.",
  "primary_contact": {
    "first_name": "Jack",
    "last_name": "Johnson",
    "email": "test@example.com",
    "address_line_1": "123 Main Street",
    "district": "TX"
  }
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Client' => '<apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Client", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Test Company, Inc.\",\n  \"primary_contact\": {\n    \"first_name\": \"Jack\",\n    \"last_name\": \"Johnson\",\n    \"email\": \"test@example.com\",\n    \"address_line_1\": \"123 Main Street\",\n    \"district\": \"TX\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Client": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Test Company, Inc.",
  "primary_contact": [
    "first_name": "Jack",
    "last_name": "Johnson",
    "email": "test@example.com",
    "address_line_1": "123 Main Street",
    "district": "TX"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/franchises/franchise_uuid/v1/accounts/account_id")! 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()
```