> 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 Company Order With BC OrderId

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

Update order, billingAddress and products cannot be omitted. products can be two format. 
 1. Product with variants. 
 2. Base product

Reference: https://docs.bigcommerce.com/developer/docs/archive/b2b-edition/v2-api/order/orders-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.

- `baseHandlingCost` (string, optional) — The value of the base handling cost. (Float, Float-As-String, Integer).
- `baseShippingCost` (string, optional) — The value of the base shipping cost. (Float, Float-As-String, Integer)
- `baseWrappingCost` (string, optional) — The value of the base wrapping cost. (Float, Float-As-String, Integer).
- `billingAddress` (OrdersPutRequestBodyContentApplicationJsonSchemaBillingAddress, optional)
- `channelId` (string, optional) — BigCommerce channel id. Shows where the order originated. The channel_id will default to 1.
- `creditCardType` (string, optional) — Credit card type.
- `customerMessage` (string, optional) — Message that the customer entered (number, optiona) -o the Order Comments box during checkout.
- `dateCreated` (string, optional) — Date created.
- `discountAmount` (string, optional) — Amount of discount for this transaction. (Float, Float-As-String, Integer)
- `ebayOrderId` (string, optional) — If the order was placed through eBay, the eBay order number will be included. Otherwise, the value will be 0.
- `externalId` (string, optional) — ID of the order in another system. For example, the Amazon Order ID if this is an Amazon order. This field can be updated in a /POST, but using a /PUT to update the order will return a 400 error. The field ‘external_id’ cannot be written to. Please remove it from your request before trying again. It cannot be overwritten once set..
- `externalMerchantId` (string, optional) — Id of the external merchant.
- `externalSource` (string, optional) — For orders submitted or modified via the API, using a PUT or POST operation, you can optionally pass in a value identifying the system used to generate the order. For example: POS. Otherwise, the value will be null.
- `geoipCountry` (string, optional) — The full name of the country where the customer made the purchase, based on the IP.
- `geoipCountryIso2` (string, optional) — The country where the customer made the purchase, in ISO2 format, based on the IP.
- `giftCertificateAmount` (string, optional) — A read-only value. Do not pass in a POST or PUT. (Float, Float-As-String, Integer)
- `handlingCostExTax` (string, optional) — The value of the handling cost, excluding tax. (Float, Float-As-String, Integer)
- `handlingCostIncTax` (string, optional) — The value of the handling cost, including tax. (Float, Float-As-String, Integer).
- `ipAddress` (string, optional) — IP Address of the customer, if known.
- `isDeleted` (string, optional) — Indicates whether the order was deleted (archived). Set to true to archive an order.
- `itemsShipped` (string, optional) — The number of items that have been shipped.
- `itemsTotal` (string, optional) — The total number of items in the order.
- `orderId` (string, optional) — BigCommerce order id
- `orderIsDigital` (string, optional) — Whether this is an order for digital products.
- `paymentMethod` (string, optional) — The payment method for this order. Can be one of the following: Manual, Credit Card, cash, Test Payment Gateway, etc.
- `paymentProviderId` (string, optional) — The external Transaction ID/Payment ID within this order’s payment provider (if a payment provider was used).
- `poNumber` (string, optional) — PoNumber
- `products` (list of OrdersPutRequestBodyContentApplicationJsonSchemaProductsItems, optional)
- `refundedAmount` (string, optional) — The amount refunded from this transaction. (Float, Float-As-String, Integer)
- `shippingCostExTax` (string, optional) — The value of shipping cost, excluding tax. (Float, Float-As-String, Integer).
- `shippingCostIncTax` (string, optional) — The value of shipping cost, including tax. (Float, Float-As-String, Integer).
- `staffNotes` (string, optional) — Any additional notes for staff.
- `statusId` (string, optional) — The status ID of the order.
- `subtotalExTax` (string, optional) — Override value for subtotal excluding tax. If specified, the field subtotal_inc_tax is also required. (Float, Float-As-String, Integer)
- `subtotalIncTax` (string, optional) — TOverride value for subtotal including tax. If specified, the field subtotal_ex_tax is also required. (Float, Float-As-String, Integer)
- `taxProviderId` (string, optional) — Tax provider id.
- `totalExTax` (string, optional) — Override value for the total, excluding tax. If specified, the field total_inc_tax is also required. (Float, Float-As-String, Integer)
- `wrappingCostExTax` (string, optional) — The value of the wrapping cost, excluding tax. (Float, Float-As-String, Integer).
- `wrappingCostIncTax` (string, optional) — The value of the wrapping cost, including tax. (Float, Float-As-String, Integer).

## Response

### 200

Response Success

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

## Errors

### 400 Bad Request Error

Response Bad Request

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

### 404 Not Found Error

Not Found Error

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

## Types

### OrdersPutRequestBodyContentApplicationJsonSchemaBillingAddress

- `city` (string, optional)
- `company` (string, optional) — Company name
- `country` (string, optional) — Human readable country name
- `countryIso2` (string, optional) — Country ISO info.
- `email` (string, optional) — Address email.
- `firstName` (string, optional) — Address first name
- `formFields` (string, optional) — Address form fields.
- `lastName` (string, optional) — Address last name
- `phone` (string, optional) — Address phone number
- `state` (string, optional) — Human readable state (or other subdivision) name
- `streetOne` (string, optional) — Typically the street address
- `streetTwo` (string, optional) — More detailed information about where to deliver mail, such as a suite or office number
- `zip` (string, optional)

### OrdersPutRequestBodyContentApplicationJsonSchemaProductsItems

- `name` (string, optional)
- `priceExTax` (string, optional)
- `priceIncTax` (string, optional)
- `productId` (string, optional) — Product id.
- `productOptions` (string, optional)
- `quantity` (string, optional)
- `sku` (string, optional)
- `upc` (string, optional)
- `variantId` (string, optional)

### OrdersPutResponsesContentApplicationJsonSchemaData

Response data

- `errMsg` (string, optional) — Error message info

## Examples

**Request**

```json
{}
```

**Response**

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

**SDK Code**

```shell Shell

curl --location --request PUT 'https://api-b2b.bigcommerce.com/api/v2/io/orders'                         --header 'authToken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY'                         --header 'Content-Type: application/json'                         --data-raw '{
    "orderId": 117,
    "statusId": 0,
    "billingAddress": {
        "firstName": "Jane",
        "lastName": "Doe",
        "streetOne": "123 Main Street",
        "city": "Austin",
        "state": "Texas",
        "zip": "78751",
        "country": "United States",
        "countryIso2": "US",
        "email": "janedoe@email.com"
    },
    "products": [
        {
            "name": "BigCommerce Poster",
            "quantity": 1,
            "priceIncTax": 10.98,
            "priceExTax": 10
        },
        {
            "name": "BigCommerce Coffee Mug",
            "quantity": 1,
            "priceIncTax": 50,
            "priceExTax": 45
        }
    ]
}'

```

```python Python

import requests

url = "https://api-b2b.bigcommerce.com/api/v2/io/orders"
payload = {
    "orderId": 117,
    "statusId": 0,
    "billingAddress": {
        "firstName": "Jane",
        "lastName": "Doe",
        "streetOne": "123 Main Street",
        "city": "Austin",
        "state": "Texas",
        "zip": "78751",
        "country": "United States",
        "countryIso2": "US",
        "email": "janedoe@email.com"
    },
    "products": [
        {
            "name": "BigCommerce Poster",
            "quantity": 1,
            "priceIncTax": 10.98,
            "priceExTax": 10
        },
        {
            "name": "BigCommerce Coffee Mug",
            "quantity": 1,
            "priceIncTax": 50,
            "priceExTax": 45
        }
    ]
}
headers = {
  'authToken': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY',
  '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.eyJzdG9yZV9oYXNoIjoiZjJvc3hqam54aiIsImRiIjoiZGVmYXVsdCIsImVtYWlsIjoiYnJ1Y2UuaHVhbmdAc2lsa3NvZnR3YXJlLmNvbSJ9._DQFg-3FgtztdQVCGU5Gxfv8j8V3U9Ssaw7ARxUU6pY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({"orderId":117,"statusId":0,"billingAddress":{"firstName":"Jane","lastName":"Doe","streetOne":"123 Main Street","city":"Austin","state":"Texas","zip":"78751","country":"United States","countryIso2":"US","email":"janedoe@email.com"},"products":[{"name":"BigCommerce Poster","quantity":1,"priceIncTax":10.98,"priceExTax":10},{"name":"BigCommerce Coffee Mug","quantity":1,"priceIncTax":50,"priceExTax":45}]});

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

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

```

```go Order_orders_update_example
package main

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

func main() {

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

	payload := strings.NewReader("{}")

	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_update_example
require 'uri'
require 'net/http'

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

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 = "{}"

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

```java Order_orders_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")
  .header("authToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Order_orders_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', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authToken' => '<apiKey>',
  ],
]);

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

```csharp Order_orders_update_example
using RestSharp;

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

```swift Order_orders_update_example
import Foundation

let headers = [
  "authToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] 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")! 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()
```