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

# Cancel Order

POST https://sandbox-api.shipbob.com/2026-01/order/{orderId}:cancel

Cancels an order and all associated shipments. The order must be in a cancellable state to proceed with the cancellation.

Reference: https://developer-stage.shipbob.dev/2026-01/api/orders/cancel-order

## Authentication

- `Authorization` header (bearer token, required) — Authentication using Personal Access Token (PAT) token
- `Authorization` header (bearer token, required) — OAuth2 authentication using JWT tokens

## Request

### Path parameters

- `orderId` (string, required) — The order ID to cancel

### Headers

- `shipbob_channel_id` (string, required) — Channel ID for Operation

## Response

### 200

Success

- `canceled_shipment_results` (list of object, optional, nullable) — Results of canceling the shipments associated with the order
  - `action` (enum, optional)
    - Allowed values: `CleanSweep`, `Reassign`, `ReleaseOrderHold`, `MoveToOnHoldAndKeepInventory`, `MoveToOnHoldAndReleaseInventory`, `Cancel`, `AddLineItem`, `RemoveLineItem`, `UpdateShipOption`
  - `is_success` (boolean, optional) — If the cancel action was successful
  - `reason` (string, optional, nullable) — The reason the cancellation result
  - `shipment_id` (long, optional) — The ID of the shipment
- `order` (object, optional)
  - `channel` (object, optional) — Created by channel metadata
    - `id` (integer, optional) — Unique id of the channel
    - `name` (string, optional, nullable) — Name of the channel
  - `created_date` (datetime, optional) — Date this order was created
  - `financials` (object, optional)
    - `total_price` (double, optional, nullable) — Sum of all line item prices, discounts, and taxes in USD
  - `gift_message` (string, optional, nullable) — Gift message associated with the order
  - `id` (integer, optional) — Unique id of the order
  - `order_number` (string, optional, nullable) — User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used
  - `products` (list of object, optional, nullable) — List of products included in the order
    - `external_line_id` (integer, optional, nullable) — Numeric assignment per item. Used as a reference number for multiple purposes such as split orders, split containers, etc.
    - `gtin` (string, optional, nullable) — Global Trade Item Number - unique and internationally recognized identifier assigned to item by company GS1
    - `id` (integer, optional, nullable) — Unique id of the product
    - `quantity` (integer, optional) — The quantity of this product ordered
    - `quantity_unit_of_measure_code` (string, optional, nullable) — Defined standard for measure for an item (each, inner pack, case, pallet). Values: EA, INP, CS and PL
    - `reference_id` (string, optional, nullable) — Unique reference id of the product
    - `sku` (string, optional, nullable) — Stock keeping unit for the product
    - `unit_price` (double, optional, nullable) — Price for one item
    - `upc` (string, optional, nullable) — Universal Product Code - Unique external identifier
  - `purchase_date` (datetime, optional, nullable) — Date this order was purchase by the end user
  - `recipient` (object, optional) — Information about the recipient of an order
    - `address` (object or object, required) — Address of the recipient
      - object
        - `address1` (string, required) — First line of the address
        - `city` (string, required) — The city
        - `country` (string, required) — The country (Must be ISO Alpha-2 for estimates)
        - `address2` (string, optional, nullable) — Second line of the address
        - `company_name` (string, optional, nullable) — Name of the company receiving the shipment
        - `state` (string, optional, nullable) — The state or province
        - `zip_code` (string, optional, nullable) — The zip code or postal code
      - object
        - `address1` (string, required) — First line of the address
        - `city` (string, required) — The city
        - `country` (string, required) — The country (Must be ISO Alpha-2 for estimates)
        - `type` (enum, required)
          - Allowed values: `MarkFor`, `ShipFrom`
        - `address2` (string, optional, nullable) — Second line of the address
        - `company_name` (string, optional, nullable) — Name of the company receiving the shipment
        - `state` (string, optional, nullable) — The state or province
        - `zip_code` (string, optional, nullable) — The zip code or postal code
    - `name` (string, required) — Name of the recipient
    - `email` (string, optional, nullable) — Email address of the recipient
    - `phone_number` (string, optional, nullable) — Phone number of the recipient
  - `reference_id` (string, optional, nullable) — Client-defined external unique id of the order
  - `retailer_program_data` (object, optional) — Contains properties that needs to be used for fulfilling B2B/Dropship orders.
    - `addresses` (list of object, optional, nullable) — Ship From - Certain retailers want to display the ship from address as their return facility, not Shipbob’s warehouse address /// Mark For Address - Final destination address
      - `address1` (string, required) — First line of the address
      - `city` (string, required) — The city
      - `country` (string, required) — The country (Must be ISO Alpha-2 for estimates)
      - `type` (enum, required)
        - Allowed values: `MarkFor`, `ShipFrom`
      - `address2` (string, optional, nullable) — Second line of the address
      - `company_name` (string, optional, nullable) — Name of the company receiving the shipment
      - `state` (string, optional, nullable) — The state or province
      - `zip_code` (string, optional, nullable) — The zip code or postal code
    - `customer_ticket_number` (string, optional, nullable) — Customer Ticket Number
    - `delivery_date` (datetime, optional, nullable) — Expected delivery date
    - `department` (string, optional, nullable) — Identifies a merchant's store department
    - `doNotShipBeforeDate` (datetime, optional, nullable) — The date the retailer does not want the order shipped by.
    - `mark_for_store` (string, optional, nullable) — Store Number
    - `purchase_order_number` (string, optional) — First initial documentation sent from buyer to seller with item(s) and quantities.
    - `retailer_program_type` (string, optional) — Identifies retailer-merchant combination
    - `shipByDate` (datetime, optional, nullable) — The date the retailer has requested the order to ship by.
  - `shipments` (list of object, optional, nullable) — Shipments affiliated with the order
    - `actual_fulfillment_date` (datetime, optional, nullable) — The datetime of ShipBob’s completion of the fulfillment operation as promised. Currently, this means the shipment has been picked, packed, and label has been printed.
    - `created_date` (datetime, optional) — Date this shipment was created
    - `delivery_date` (datetime, optional, nullable) — The datetime of Shipment delivered to customer.
    - `estimated_fulfillment_date` (datetime, optional, nullable) — The datetime of ShipBob’s commitment for completing the shipment and handing to the carrier for delivery.
    - `estimated_fulfillment_date_status` (enum, optional)
      - Allowed values: `AwaitingInventoryAllocation`, `AwaitingReset`, `Unavailable`, `PendingOnTime`, `FulfilledOnTime`, `PendingLate`, `FulfilledLate`
    - `gift_message` (string, optional, nullable) — Gift message associated with the shipment
    - `id` (integer, optional) — Unique id of the shipment
    - `insurance_value` (double, optional, nullable) — Monetary amount that this shipment was insured for
    - `invoice_amount` (double, optional, nullable) — Monetary amount that was invoiced for this shipment
    - `invoice_currency_code` (string, optional, nullable)
    - `is_tracking_uploaded` (boolean, optional) — Indicates whether the Shipment was marked with tracking information uploaded to a third-party system where the order originated.
    - `last_tracking_update_at` (datetime, optional, nullable) — Timestamp for the last time this shipment had a tracking update
    - `last_update_at` (datetime, optional, nullable) — Date this shipment was last updated
    - `location` (object, optional) — Information about a fulfillment center that a shipment can belong to
      - `id` (integer, optional) — Id of the fulfillment center
      - `name` (string, optional, nullable) — Name of the fulfillment center
    - `measurements` (object, optional) — Measurements of a shipment
      - `depth_in` (integer, optional) — Total depth in inches
      - `length_in` (integer, optional) — Total length in inches
      - `total_weight_oz` (integer, optional) — Total weight in ounces
      - `width_in` (integer, optional) — Total width in inches
    - `order_id` (integer, optional) — Id of the order this shipment belongs to
    - `package_material_type` (enum, optional)
      - Allowed values: `Unknown`, `Box`, `BubbleMailer`, `PolyMailer`, `FragileBox`, `PosterTube`, `Custom`, `Bookfold`, `OwnContainer`, `Undefined`
    - `parent_cartons` (list of object, optional, nullable) — Carton information for this shipment
      - `barcode` (string, optional, nullable) — Barcode assigned to this carton
      - `cartons` (list of object, optional, nullable) — Cartons packed inside this parent container
        - `barcode` (string, optional, nullable) — Barcode assigned to this carton
        - `carton_details` (list of object, optional, nullable) — Details about the contents of this carton
          - `products` (list of object, optional, nullable) — List of what is packed in this carton
            - `id` (integer, optional) — Unique id of the product
            - `inventory_items` (list of object, optional, nullable) — Information about fulfillable inventory items belonging to this product
            - `name` (string, optional, nullable) — Name of the product
            - `reference_id` (string, optional, nullable) — Unique reference id of the product
            - `sku` (string, optional, nullable) — Stock keeping unit for the product
        - `id` (integer, optional) — ID assigned to this carton
        - `measurements` (object, optional) — Measurements of a carton
          - `depth_in` (double, optional) — Total depth in inches
          - `length_in` (double, optional) — Total length in inches
          - `total_weight_oz` (double, optional) — Total weight in ounces
          - `width_in` (double, optional) — Total width in inches
        - `type` (string, optional, nullable) — Type of this carton container
      - `measurements` (object, optional) — Measurements of a carton
        - `depth_in` (double, optional) — Total depth in inches
        - `length_in` (double, optional) — Total length in inches
        - `total_weight_oz` (double, optional) — Total weight in ounces
        - `width_in` (double, optional) — Total width in inches
      - `type` (string, optional, nullable) — Type of this carton container
    - `products` (list of object, optional, nullable) — Information about the products contained in this shipment
      - `id` (integer, optional) — Unique id of the product
      - `inventory_items` (list of object, optional, nullable) — Information about fulfillable inventory items belonging to this product
        - `expiration_date` (datetime, optional, nullable) — Expiration date of the inventory
        - `id` (integer, optional) — Unique id of the inventory
        - `is_dangerous_goods` (boolean, optional) — Is inventory Dangerous Good
        - `lot` (string, optional, nullable) — Lot number of the inventory
        - `name` (string, optional, nullable) — Name of the inventory item
        - `quantity` (integer, optional) — Quantity of the inventory item to be included in the fulfillment
        - `quantity_committed` (integer, optional) — The quantity of the inventory item allocated from the assigned fulfillment center and committed to the order. If quantity committed is less than order quantity, then the inventory item is out of stock at the assigned fulfillment center.
        - `serial_numbers` (list of string, optional, nullable) — Serial number of the inventory
      - `name` (string, optional, nullable) — Name of the product
      - `reference_id` (string, optional, nullable) — Unique reference id of the product
      - `sku` (string, optional, nullable) — Stock keeping unit for the product
    - `recipient` (object, optional) — Information about the recipient of a shipment
      - `address` (object or object, optional, nullable) — Address of the recipient
        - object
          - `address1` (string, required) — First line of the address
          - `city` (string, required) — The city
          - `country` (string, required) — The country (Must be ISO Alpha-2 for estimates)
          - `address2` (string, optional, nullable) — Second line of the address
          - `company_name` (string, optional, nullable) — Name of the company receiving the shipment
          - `state` (string, optional, nullable) — The state or province
          - `zip_code` (string, optional, nullable) — The zip code or postal code
        - object
          - `address1` (string, required) — First line of the address
          - `city` (string, required) — The city
          - `country` (string, required) — The country (Must be ISO Alpha-2 for estimates)
          - `type` (enum, required)
            - Allowed values: `MarkFor`, `ShipFrom`
          - `address2` (string, optional, nullable) — Second line of the address
          - `company_name` (string, optional, nullable) — Name of the company receiving the shipment
          - `state` (string, optional, nullable) — The state or province
          - `zip_code` (string, optional, nullable) — The zip code or postal code
      - `email` (string, optional, nullable) — Email address of the recipient
      - `full_name` (string, optional, nullable) — FullName of the recipient
      - `name` (string, optional, nullable) — Name of the recipient
      - `phone_number` (string, optional, nullable) — Phone number of the recipient
    - `reference_id` (string, optional, nullable) — Client-defined external unique id of the order this shipment belongs to
    - `require_signature` (boolean, optional) — If a shipment requires signature
    - `ship_option` (string, optional, nullable) — Name of the shipping option used for this shipment
    - `status` (enum, optional)
      - Allowed values: `None`, `Processing`, `Completed`, `Exception`, `OnHold`, `Cancelled`, `CleanSweeped`, `LabeledCreated`, `ImportReview`
    - `status_details` (list of object, optional, nullable) — Additional details about the shipment status
      - `description` (string, optional, nullable) — Describes what the status detail means
      - `exception_fulfillment_center_id` (integer, optional, nullable)
      - `extra_information` (object, optional)
        - `validation_messages` (list of string, optional, nullable)
      - `id` (integer, optional) — The id of the status detail
      - `inventory_id` (integer, optional, nullable) — Inventory Id the detail applies to (if applicable)
      - `name` (string, optional, nullable) — Short name of the status detail
    - `tracking` (object, optional) — Tracking information for a shipment
      - `bol` (string, optional, nullable) — Bill of lading (BOL) number. Document acknowledging receipt of cargo for shipment.
      - `carrier` (string, optional, nullable) — Carrier of the shipment
      - `carrier_service` (string, optional, nullable) — The carrier's service which was used for this shipment
      - `pro_number` (string, optional, nullable) — Tracking number used for freight carriers
      - `scac` (string, optional, nullable) — Standard Carrier Alpha Code (SCAC). Unique 2-4 letter code used to identify transportation companies.
      - `shipping_date` (datetime, optional, nullable) — Date freight was shipped on
      - `tracking_number` (string, optional, nullable) — Tracking number of the shipment
      - `tracking_url` (string, optional, nullable) — URL to the website where a shipment can be tracked
  - `shipping_method` (string, optional, nullable) — Client-defined shipping method
  - `shipping_terms` (object, optional) — Contains shipping properties that need to be used for fulfilling an order.
    - `carrier_type` (enum, optional)
      - Allowed values: `Parcel`, `Freight`
    - `payment_term` (enum, optional)
      - Allowed values: `Collect`, `ThirdParty`, `Prepaid`, `MerchantResponsible`
  - `status` (enum, optional)
    - Allowed values: `Processing`, `Exception`, `PartiallyFulfilled`, `Fulfilled`, `Cancelled`, `ImportReview`
  - `tags` (list of object, optional, nullable) — Client-defined order tags
    - `name` (string, required) — The key of the tag
    - `value` (string, required) — The value of the tag
  - `type` (enum, optional)
    - Allowed values: `DTC`, `DropShip`, `B2B`
- `order_id` (integer, optional) — The ID of the canceled order
- `status` (enum, optional)
  - Allowed values: `Success`, `Failure`, `PartialSuccess`

## Examples

**Response**

```json
{
  "canceled_shipment_results": [
    {
      "action": "Cancel",
      "is_success": true,
      "reason": "string",
      "shipment_id": 0
    }
  ],
  "order": {
    "channel": {
      "id": 0,
      "name": "ShipBobs-Shopify-Store"
    },
    "created_date": "2019-08-24T14:15:22+00:00",
    "financials": {
      "total_price": 0.1
    },
    "gift_message": "string",
    "id": 0,
    "order_number": "string",
    "products": [
      {
        "external_line_id": 0,
        "gtin": "string",
        "id": 0,
        "quantity": 0,
        "quantity_unit_of_measure_code": "string",
        "reference_id": "TShirtBlueM",
        "sku": "TShirtBlueM",
        "unit_price": 0.1,
        "upc": "string"
      }
    ],
    "purchase_date": "2019-08-24T14:15:22+00:00",
    "recipient": {
      "address": {
        "address1": "100 Nowhere Blvd",
        "address2": "Suite 100",
        "city": "Gotham City",
        "company_name": "Wayne Enterprises",
        "country": "US",
        "state": "NJ",
        "zip_code": "07093"
      },
      "name": "John Doe",
      "email": "john@example.com",
      "phone_number": "555-555-5555"
    },
    "reference_id": "string",
    "retailer_program_data": {
      "addresses": [
        {
          "address1": "100 Nowhere Blvd",
          "city": "Gotham City",
          "country": "US",
          "type": "MarkFor",
          "address2": "Suite 100",
          "company_name": "Wayne Enterprises",
          "state": "NJ",
          "zip_code": "07093"
        }
      ],
      "customer_ticket_number": "string",
      "delivery_date": "2019-08-24T14:15:22+00:00",
      "department": "string",
      "doNotShipBeforeDate": "2019-08-24T14:15:22+00:00",
      "mark_for_store": "string",
      "purchase_order_number": "string",
      "retailer_program_type": "string",
      "shipByDate": "2019-08-24T14:15:22+00:00"
    },
    "shipments": [
      {
        "actual_fulfillment_date": "2019-08-24T14:15:22+00:00",
        "created_date": "2019-08-24T14:15:22+00:00",
        "delivery_date": "2019-08-24T14:15:22+00:00",
        "estimated_fulfillment_date": "2019-08-24T14:15:22+00:00",
        "estimated_fulfillment_date_status": "AwaitingInventoryAllocation",
        "gift_message": "string",
        "id": 0,
        "insurance_value": 0,
        "invoice_amount": 0,
        "invoice_currency_code": "string",
        "is_tracking_uploaded": true,
        "last_tracking_update_at": "2019-08-24T14:15:22+00:00",
        "last_update_at": "2019-08-24T14:15:22+00:00",
        "location": {
          "id": 0,
          "name": "Cicero (IL)"
        },
        "measurements": {
          "depth_in": 0,
          "length_in": 0,
          "total_weight_oz": 0,
          "width_in": 0
        },
        "order_id": 0,
        "package_material_type": "Unknown",
        "parent_cartons": [
          {
            "barcode": "string",
            "cartons": [
              {
                "barcode": "string",
                "carton_details": [
                  {
                    "products": [
                      {
                        "id": 0,
                        "inventory_items": [
                          {
                            "expiration_date": "2019-08-24T14:15:22+00:00",
                            "id": 0,
                            "is_dangerous_goods": true,
                            "lot": "22222",
                            "name": "Medium Blue T-Shirt",
                            "quantity": 0,
                            "quantity_committed": 0,
                            "serial_numbers": [
                              "string"
                            ]
                          }
                        ],
                        "name": "Medium Blue T-Shirt",
                        "reference_id": "TShirtBlueM",
                        "sku": "TShirtBlueM"
                      }
                    ]
                  }
                ],
                "id": 0,
                "measurements": {
                  "depth_in": 0.1,
                  "length_in": 0.1,
                  "total_weight_oz": 0.1,
                  "width_in": 0.1
                },
                "type": "Box or pallet"
              }
            ],
            "measurements": {
              "depth_in": 0.1,
              "length_in": 0.1,
              "total_weight_oz": 0.1,
              "width_in": 0.1
            },
            "type": "Box or pallet"
          }
        ],
        "products": [
          {
            "id": 0,
            "inventory_items": [
              {
                "expiration_date": "2019-08-24T14:15:22+00:00",
                "id": 0,
                "is_dangerous_goods": true,
                "lot": "22222",
                "name": "Medium Blue T-Shirt",
                "quantity": 0,
                "quantity_committed": 0,
                "serial_numbers": [
                  "string"
                ]
              }
            ],
            "name": "Medium Blue T-Shirt",
            "reference_id": "TShirtBlueM",
            "sku": "TShirtBlueM"
          }
        ],
        "recipient": {
          "address": {
            "address1": "100 Nowhere Blvd",
            "address2": "Suite 100",
            "city": "Gotham City",
            "company_name": "Wayne Enterprises",
            "country": "US",
            "state": "NJ",
            "zip_code": "07093"
          },
          "email": "john@example.com",
          "full_name": "John Doe",
          "name": "John Doe",
          "phone_number": "555-555-5555"
        },
        "reference_id": "string",
        "require_signature": true,
        "ship_option": "Standard",
        "status": "None",
        "status_details": [
          {
            "description": "string",
            "exception_fulfillment_center_id": 0,
            "extra_information": {
              "validation_messages": [
                "string"
              ]
            },
            "id": 0,
            "inventory_id": 0,
            "name": "string"
          }
        ],
        "tracking": {
          "bol": "string",
          "carrier": "USPS",
          "carrier_service": "Priority",
          "pro_number": "string",
          "scac": "string",
          "shipping_date": "2019-08-24T14:15:22+00:00",
          "tracking_number": "860C8CDC8F0B4FC7AB69AC86C20539EC",
          "tracking_url": "https://www.example.com/tracking?id=860C8CDC8F0B4FC7AB69AC86C20539EC"
        }
      }
    ],
    "shipping_method": "Free 2-day Shipping",
    "shipping_terms": {
      "carrier_type": "Parcel",
      "payment_term": "Collect"
    },
    "status": "Processing",
    "tags": [
      {
        "name": "Handling instructions",
        "value": "Fragile"
      }
    ],
    "type": "DTC"
  },
  "order_id": 0,
  "status": "Success"
}
```

**SDK Code**

```python default
import requests

url = "https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel"

headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript default
const url = 'https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel';
const options = {
  method: 'POST',
  headers: {shipbob_channel_id: 'shipbob_channel_id', Authorization: 'Bearer <token>'}
};

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

```go default
package main

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

func main() {

	url := "https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel"

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

	req.Header.Add("shipbob_channel_id", "shipbob_channel_id")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby default
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel")

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

request = Net::HTTP::Post.new(url)
request["shipbob_channel_id"] = 'shipbob_channel_id'
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

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

```csharp default
using RestSharp;

var client = new RestClient("https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel");
var request = new RestRequest(Method.POST);
request.AddHeader("shipbob_channel_id", "shipbob_channel_id");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2026-01/order/orderId:cancel")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```