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

# Create Order Shipment

POST https://api.bigcommerce.com/stores/{store_hash}/v2/orders/{order_id}/shipments
Content-Type: application/json

Creates an *Order Shipment*. For more details, see [Shipping an Order](/developer/docs/admin/checkout-and-cart/orders#creating-order-shipments).

**Required Fields**

* order\_address\_id
* items

**Usage notes**

There are three methods for generating a tracking link for a shipment:

1. Use `shipping_provider` and `tracking_number`: This generates a link to one of our integrated providers that you can click from the BigCommerce control panel and customer-facing emails. If a merchant still needs to set up a shipping provider or if the provider is not one of our natively integrated providers, you will click on an Aftership tracking link instead. The `generated_tracking_link` property in the API response represents one of these tracking links. The `tracking_link` property in the API response will remain empty.

2. Use `tracking_carrier` and `tracking_number`: This also creates a link to one of our integrated providers or an Aftership tracking link that you can click in both the BigCommerce control panel and customer-facing emails. Like the previous method, the `generated_tracking_link` property in the API response represents this tracking link. The `tracking_link` property in the API response will remain empty.

3. Supply a custom `tracking_link`: By providing a value for the `tracking_link` property, you can use your own tracking link within the BigCommerce control panel and in customer-facing emails. The API response will return your supplied tracking link as part of the `tracking_link` property in the response. In situations when there isn't a `generated_tracking_link`, the property in the API response will remain empty.

Acceptable values for `shipping_provider` include the following, and this list may be updated at any time:

* `""`, an empty string
* `auspost`
* `canadapost`
* `endicia`
* `usps`
* `fedex`
* `royalmail`
* `ups`
* `upsready`
* `shipperhq`
* `carrier_{your_carrier_id}`, when the carrier is a [third-party Shipping Provider](/developer/docs/integrations/shipping-providers)

Acceptable values for `tracking_carrier` include an empty string (`""`) or one of the valid [tracking-carrier values](https://www.aftership.com/docs/tracking/others/supported-couriers).

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/management/orders/order-shipments/create-order-shipments

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Orders | modify | `store_v2_orders` | | Orders | read-only | `store_v2_orders_read_only` | ### Authentication header | 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#api-accounts). | ### Further reading 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).

## Request

### Path parameters

- `order_id` (integer, required) — ID of the order.
- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

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

- `order_address_id` (integer, optional) — ID of the desired `shipping_address` associated with the shipment.
- `tracking_number` (string, optional) — Tracking number of the shipment.
- `tracking_link` (string, optional) — The custom tracking link supplied on POST or PUT shipments. For the link to one of our integrated providers or Aftership tracking link see the `generated_tracking_link` property.
- `merchant_shipping_cost` (string, optional) — Shipping cost for the merchant.
- `shipping_method` (string, optional) — Additional information to describe the method of shipment (ex. Standard, Ship by Weight, Custom Shipment). Can be used for live quotes from certain shipping providers. If different from `shipping_provider`, `shipping_method` should correspond to `tracking_carrier`.
- `shipping_provider` (OrderShipmentPostShippingProvider, optional)
- `tracking_carrier` (string, optional) — Tracking carrier for the shipment. Acceptable values for `tracking_carrier` include an empty string (`""`) or one of the valid [tracking-carrier values](https://www.aftership.com/docs/tracking/others/supported-couriers).
- `comments` (string, optional) — Comments the shipper wishes to add.
- `items` (list of OrderShipmentPostItemsItems, optional) — The items in the shipment. This object has the following members, all integer: order\_product\_id (required), quantity (required), product\_id (read-only). A sample items value might be: \[ \{"order\_product\_id":16,"product\_id": 0,"quantity":2} ]

## Response

### 201

The requested order shipment.

- `id` (integer, optional) — Shipment ID.
- `order_id` (integer, optional) — ID of the order associated with this shipment.
- `customer_id` (integer, optional) — ID of this order’s customer.
- `order_address_id` (integer, optional) — ID of the desired `shipping_address` associated with the shipment.
- `date_created` (string, optional) — Creation date for the shipment.
- `tracking_number` (string, optional) — Tracking number of the shipment.
- `merchant_shipping_cost` (string, optional) — Shipping cost for the merchant.
- `shipping_method` (string, optional) — Additional information to describe the method of shipment (ex. Standard, Ship by Weight, Custom Shipment). Can be used for live quotes from certain shipping providers. If different from `shipping_provider`, `shipping_method` should correspond to `tracking_carrier`.
- `shipping_provider` (OrderShipmentShippingProvider, optional)
- `tracking_carrier` (string, optional) — Tracking carrier for the shipment. Acceptable values for `tracking_carrier` include an empty string (`""`) or one of the valid [tracking-carrier values](https://www.aftership.com/docs/tracking/others/supported-couriers).
- `tracking_link` (string, optional) — The custom tracking link supplied on POST or PUT shipments. For the link to one of our integrated providers or Aftership tracking link, see the `generated_tracking_link` property.
- `comments` (string, optional) — Comments the shipper wishes to add.
- `billing_address` (billingAddress_Base, optional)
- `shipping_address` (shippingAddress_Base, optional) — Shipping Address properties common to all requests and responses.
- `items` (list of OrderShipmentItemsItems, optional) — The items in the shipment. This object has the following members, all integer: order\_product\_id (required), quantity (required), product\_id (read-only). A sample items value might be: \[ \{"order\_product\_id":16,"product\_id": 0,"quantity":2} ]
- `shipping_provider_display_name` (string, optional) — The human-readable name for the `shipping_provider`.
- `generated_tracking_link` (string, optional) — The link to one of our integrated providers or Aftership tracking link that is generated using the combination of either the `tracking_number` and `shipping_provider` or `tracking_number` and `tracking_carrier`. This will be empty if the custom `tracking_link` value is provided.

## Types

### OrderShipmentPostShippingProvider

### OrderShipmentPostItemsItems

- `order_product_id` (integer, optional)
- `quantity` (integer, optional)

### OrderShipmentShippingProvider

### billingAddress_Base

- `zip` (string, required) — The billing address must include the ZIP code. The ZIP code must be two or more characters.
- `first_name` (string, optional)
- `last_name` (string, optional)
- `company` (string, optional)
- `street_1` (string, optional)
- `street_2` (string, optional)
- `city` (string, optional)
- `state` (string, optional)
- `country` (string, optional)
- `country_iso2` (string, optional)
- `phone` (string, optional)
- `email` (string, optional)

### shippingAddress_Base

Shipping Address properties common to all requests and responses.

- `first_name` (string, optional)
- `last_name` (string, optional)
- `company` (string, optional)
- `street_1` (string, optional) — Street address (first line).
- `street_2` (string, optional) — Street address (second line).
- `city` (string, optional)
- `state` (string, optional)
- `zip` (string, optional) — Zip or postal code, as a string.
- `country` (string, optional)
- `country_iso2` (string, optional) — 2-letter ISO Alpha-2 code for the country.
- `phone` (string, optional) — Recipient’s telephone number.
- `email` (string, optional) — Recipient’s email address.

### OrderShipmentItemsItems

- `order_product_id` (integer, optional)
- `product_id` (integer, optional)
- `quantity` (integer, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": 11,
  "order_id": 228,
  "customer_id": 11,
  "order_address_id": 131,
  "date_created": "Wed, 13 Mar 2019 16:35:37 +0000",
  "tracking_number": "EJ958083578US",
  "merchant_shipping_cost": "0.0000",
  "shipping_method": "None",
  "shipping_provider": "usps",
  "tracking_carrier": "",
  "tracking_link": "",
  "comments": "Ready to go...",
  "billing_address": {
    "zip": "78751",
    "first_name": "Jane",
    "last_name": "Doe",
    "company": "",
    "street_1": "123 Main Street",
    "street_2": "",
    "city": "Austin",
    "state": "Texas",
    "country": "United States",
    "country_iso2": "US",
    "phone": "",
    "email": "janedoe@example.com"
  },
  "shipping_address": {
    "first_name": "Trishy",
    "last_name": "Test",
    "company": "Acme Pty Ltd",
    "street_1": "666 Sussex St",
    "street_2": "",
    "city": "Anywhere",
    "state": "Some State",
    "zip": "12345",
    "country": "United States",
    "country_iso2": "US",
    "phone": "",
    "email": "elsie@example.com"
  },
  "items": [
    {
      "order_product_id": 194,
      "product_id": 0,
      "quantity": 1
    },
    {
      "order_product_id": 195,
      "product_id": 0,
      "quantity": 1
    }
  ],
  "shipping_provider_display_name": "USPS",
  "generated_tracking_link": "http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?strOrigTrackNum=EJ958083578US"
}
```

**SDK Code**

```python application/json
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments"

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

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

print(response.json())
```

```javascript application/json
const url = 'https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    '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 application/json
package main

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

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments"

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

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

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

url = URI("https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments")

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

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

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

```java application/json
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments', [
  'body' => '{}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

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

```csharp application/json
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v2/orders/1/shipments");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift application/json
import Foundation

let headers = [
  "Accept": "application/json",
  "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.bigcommerce.com/stores/store_hash/v2/orders/1/shipments")! 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()
```