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

PUT https://api-b2b.bigcommerce.com/api/v3/io/orders/{bcOrderId}
Content-Type: application/json

Updates B2B information on a specific order based on the `bcOrderId` provided.

The `bcOrderId` parameter must include a valid BigCommerce Order ID (**not** the B2B Edition order ID returned in certain Orders endpoints) for the request to be successful. You must also include at least one of the following fields in the request body:

- `poNumber`
- `extraFields` (array with `fieldName` and `fieldValue`)
    - This array must be included if your store has required order extra fields.

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/management/orders/put-orders-order-id

## Authentication

- `X-Auth-Token` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts). | For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
- `X-Store-Hash` header (required) — | Header | Argument | Description | |:-------|:---------|:------------| | `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |

## Request

### Path parameters

- `bcOrderId` (integer, required) — The BigCommerce order ID.

### Body (application/json)

This endpoint expects an object.

- `poNumber` (string, optional) — The order's Purchase Order (PO), if used.
- `extraFields` (list of any, optional) — Contains extra field information associated with the order.

## Response

### 200

OK

- `code` (integer, optional, default: 200) — HTTP Response Code
- `data` (orderData_DETAIL, optional)
- `meta` (OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaMeta, optional)

## Errors

### 404 Not Found Error

Not Found This error occurs when an invalid order ID is provided in the `bcOrderId` parameter.

- `code` (integer, required)
- `data` (OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaData, required)
- `meta` (OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaMeta, optional)

### 422 Unprocessable Entity Error

Required Extra Field Missing This error occurs if your store has required order extra fields, but the `extraFields` array is not included in the request body.

- `code` (integer, required)
- `data` (OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaData, required)
- `meta` (OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### orderData_DETAIL

- `id` (integer, optional) — The unique identifier of the order in B2B Edition.
- `bcOrderId` (integer, optional) — The BigCommerce order ID.
- `totalIncTax` (float, optional) — The order's total value including tax.
- `poNumber` (string, optional) — The order's Purchase Order (PO), if used.
- `status` (string, optional) — The default name of the order status. See [Order Statuses](/developer/api-reference/rest/admin/management/orders/order-status) for a complete list of accepted status names. -
- `customStatus` (string, optional) — The customized name of the order status.
- `cartId` (integer, optional) — The unique identifier of the cart generated for the order.
- `items` (integer, optional) — The total quantity of products in the order.
- `usdIncTax` (float, optional) — The order's total value in USD, including tax.
- `companyId` (integer, optional) — The unique numeric ID of a Company account.
- `currencyCode` (string, optional) — The three-letter code corresponding to the order’s currency.
- `money` (list of MoneyItems, optional) — Contains detailed information regarding the order's currency.
- `statusCode` (integer, optional) — The numeric code associated with the order status. See [Order Statuses](/developer/api-reference/rest/admin/management/orders/order-status) for a complete list of accepted status names.
- `isArchived` (boolean, optional) — Indicates whether the order is archived.
- `channelId` (integer, optional) — The storefront channel ID where the order was placed.
- `channelName` (string, optional) — The name of the storefront channel where the order was placed.
- `isInvoiceOrder` (integer, optional) — Indicates whether or not the order is an invoice payment. Standard orders are `0`, while invoice payment orders are `1`.
- `invoiceId` (integer, optional) — The unique identifier for the invoice associated with an invoice payment order, if applicable.
- `invoiceNumber` (integer, optional) — The invoice number associated with an invoice payment order, if applicable.
- `invoiceStatus` (integer, optional) — The status code of the invoice associated with an invoice payment order, if applicable. The numeric codes correspond to the following statuses: - 0 - Open - 1 - Partially Paid - 2 - Paid
- `extraInt1` (integer, optional) — A legacy integer extra field configuration that does not return data in newer stores.
- `extraInt2` (integer, optional) — A legacy integer extra field configuration that does not return data in newer stores.
- `extraInt3` (integer, optional) — A legacy integer extra field configuration that does not return data in newer stores.
- `extraInt4` (integer, optional) — A legacy integer extra field configuration that does not return data in newer stores.
- `extraInt5` (integer, optional) — A legacy integer extra field configuration that does not return data in newer stores.
- `extraStr1` (string, optional) — A legacy string extra field configuration that does not return data in newer stores.
- `extraStr2` (string, optional) — A legacy string extra field configuration that does not return data in newer stores.
- `extraStr3` (string, optional) — A legacy string extra field configuration that does not return data in newer stores.
- `extraStr4` (string, optional) — A legacy string extra field configuration that does not return data in newer stores.
- `extraStr5` (string, optional) — A legacy string extra field configuration that does not return data in newer stores.
- `extraText` (string, optional) — A legacy text extra field configuration that does not return data in newer stores.
- `extraInfo` (list of ExtraInfoItems, optional) — Contains billing and shipping address identifiers.
- `extraFields` (list of any, optional) — Contains extra field information associated with the order.
- `createdAt` (integer, optional) — The [Unix timestamp](https://www.unixtimestamp.com/) for when the order was created. This is a read-only field.
- `updatedAt` (integer, optional) — The [Unix timestamp](https://www.unixtimestamp.com/) for when the order was last updated. This is a read-only field.

### OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaMeta

- `message` (string, optional) — Error message of this response

### OrdersBcOrderIdPutResponsesContentApplicationJsonSchemaData

- `errMsg` (string, optional) — Error message of this response

### MoneyItems

- `currencyLocation` (enum, optional) — Determines whether the currency symbol is added to the left or the right of order pricing.
  - Allowed values: `left`, `right`
- `currencyToken` (string, optional) — The currency symbol.
- `decimalToken` (string, optional) — The character used to separate the whole number from the decimal in order pricing.
- `decimalPlaces` (integer, optional) — The number of decimal places used in order pricing.
- `thousandsToken` (string, optional) — The character used to separate the hundredths and thousandths places in order pricing."

### ExtraInfoItems

- `billingAddressId` (integer, optional) — The unique identifier for billing address in the Company account.
- `shippingAddressId` (integer, optional) — The unique identifier for shipping address in the Company account.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "code": 200,
  "data": {
    "id": 12345,
    "bcOrderId": 123,
    "totalIncTax": 2210.47,
    "poNumber": "04152025-0002",
    "status": "Awaiting Payment",
    "customStatus": "Invoice Sent",
    "cartId": "095a15a6-8a27-4c20-b357-36b82e9d5929",
    "items": 50,
    "usdIncTax": 2210.47,
    "companyId": 12345,
    "currencyCode": "USD",
    "money": [
      {
        "currencyLocation": "left",
        "currencyToken": "$",
        "decimalToken": ".",
        "decimalPlaces": 2,
        "thousandsToken": ","
      }
    ],
    "statusCode": 7,
    "isArchived": false,
    "channelId": 1,
    "channelName": "B2B Store",
    "isInvoiceOrder": 0,
    "invoiceId": 12345,
    "invoiceNumber": 12345678,
    "invoiceStatus": 2,
    "extraInt1": 12345,
    "extraInt2": 12345,
    "extraInt3": 12345,
    "extraInt4": 12345,
    "extraInt5": 12345,
    "extraStr1": "Great Buys Incorporated",
    "extraStr2": "Great Buys Incorporated",
    "extraStr3": "Great Buys Incorporated",
    "extraStr4": "Great Buys Incorporated",
    "extraStr5": "Great Buys Incorporated",
    "extraText": "Great Buys Incorporated",
    "extraInfo": [
      {
        "billingAddressId": 12345,
        "shippingAddressId": 12345
      }
    ],
    "extraFields": [
      {
        "fieldName": "Fintech ID",
        "fieldValue": "1234567890"
      }
    ],
    "createdAt": 1744735719,
    "updatedAt": 1744735734
  },
  "meta": {
    "message": "SUCCESS"
  }
}
```

**SDK Code**

```python
import requests

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

payload = {}
headers = {
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/v3/io/orders/123';
const options = {
  method: 'PUT',
  headers: {'X-Auth-Token': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

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

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

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

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

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

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

request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.put("https://api-b2b.bigcommerce.com/api/v3/io/orders/123")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-b2b.bigcommerce.com/api/v3/io/orders/123', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = [
  "X-Auth-Token": "<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/v3/io/orders/123")! 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()
```