> 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 B2BE User's Orders' company attribute.

PUT https://api-b2b.bigcommerce.com/api/v2/io/orders/company
Content-Type: application/json

Update the orders belong to a B2BE company to another B2BE company.

Reference: https://docs.bigcommerce.com/developer/docs/archive/b2b-edition/v2-api/order/orders-company-update

## Authentication

- `authToken` header (required) — API Key authentication via header

## Request

### Headers

- `authToken` (string, required) — Auth token in header.

### Body (application/json)

This endpoint expects an object.

- `customerGroupID` (string, required) — BigCommerce customer group id.
- `customerID` (string, required) — BigCommerce user id.

## Response

### 200

Response Success

- `code` (double, optional) — Response status code
- `data` (OrdersCompanyPutResponsesContentApplicationJsonSchemaData, optional) — Response data
- `message` (string, optional) — Response message

## Errors

### 400 Bad Request Error

Response Bad Request

- `code` (double, optional) — Response status error code
- `data` (OrdersCompanyPutResponsesContentApplicationJsonSchemaData, optional) — Response error data
- `message` (string, optional) — Response error message

## Types

### OrdersCompanyPutResponsesContentApplicationJsonSchemaData

Response error data

- `[field]` (string, optional) — Message about problem with field 'field'

## Examples

**Request**

```json
{
  "customerGroupID": "string",
  "customerID": "string"
}
```

**Response**

```json
{
  "code": 200,
  "data": {},
  "message": "Success"
}
```

**SDK Code**

```shell Shell

curl --location --request PUT 'https://api-b2b.bigcommerce.com/api/v2/io/orders/company'                         --header 'authToken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiMWk2enB4cGUzZyIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoia2lkby56aGFvQGJ1bmRsZWIyYi5uZXQifQ.fB8TtxpTDdhOUmR_7gYV16w9nV3Kp0US52W8JMHG1js'                         --header 'Content-Type: application/json'                         --data-raw '{
    "customerGroupID": "6406",
    "customerID": "7298"
}'

```

```python Python

                        import requests

                        url = "https://api-b2b.bigcommerce.com/api/v2/io/orders/company"

                        payload = "{
    "customerGroupID": "6406",
    "customerID": "7298"
}"
                        headers = {
                          'authToken': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiMWk2enB4cGUzZyIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoia2lkby56aGFvQGJ1bmRsZWIyYi5uZXQifQ.fB8TtxpTDdhOUmR_7gYV16w9nV3Kp0US52W8JMHG1js',
                          'Content-Type': 'application/json'
                        }

                        response = requests.request("PUT", url, headers=headers, data = payload)

                        print(response.text.encode('utf8'))
    )

```

```javascript JavaScript

var myHeaders = new Headers();
myHeaders.append("authToken", "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiMWk2enB4cGUzZyIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoia2lkby56aGFvQGJ1bmRsZWIyYi5uZXQifQ.fB8TtxpTDdhOUmR_7gYV16w9nV3Kp0US52W8JMHG1js");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"customerGroupID":"6406","customerID":"7298"});

var requestOptions = {
  method: 'PUT',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api-b2b.bigcommerce.com/api/v2/io/orders/company", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

```

```go Order_orders_company_update_example
package main

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

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/io/orders/company"

	payload := strings.NewReader("{\n  \"customerGroupID\": \"string\",\n  \"customerID\": \"string\"\n}")

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

	req.Header.Add("authToken", "<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 Order_orders_company_update_example
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v2/io/orders/company")

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

request = Net::HTTP::Put.new(url)
request["authToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerGroupID\": \"string\",\n  \"customerID\": \"string\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v2/io/orders/company")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerGroupID\": \"string\",\n  \"customerID\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v2/io/orders/company', [
  'body' => '{
  "customerGroupID": "string",
  "customerID": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

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

```csharp Order_orders_company_update_example
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/io/orders/company");
var request = new RestRequest(Method.PUT);
request.AddHeader("authToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customerGroupID\": \"string\",\n  \"customerID\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Order_orders_company_update_example
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customerGroupID": "string",
  "customerID": "string"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v2/io/orders/company")! 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()
```