> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer-stage.shipbob.dev/2026-07/api/orders/batch-cancel-shipments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer-stage.shipbob.dev/_mcp/server. # Batch Cancel Shipments POST https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel Content-Type: application/json Cancels multiple shipments in a single request. Shipments can only be cancelled if they are in a cancellable state (i.e. not picked, packed, or shipped yet). Reference: https://developer-stage.shipbob.dev/api/orders/batch-cancel-shipments ## Authentication - `Authorization` header (bearer token, required) — Authentication using Personal Access Token (PAT) token - `Authorization` header (bearer token, required) — OAuth2 authentication using JWT tokens ## Request ### Headers - `shipbob_channel_id` (integer, required) — Channel ID for Operation ### Body (application/json) This endpoint expects an Orders.CancelShipmentsModel. - `shipment_ids` (list of integer, optional, nullable) — Shipment IDs to cancel ## Response ### 200 Success - `results` (list of Orders.CanceledShipmentViewModel, optional, nullable) — The results of all cancellation actions ## Errors ### 401 Unauthorized Error No access right at this time - `any` ### 403 Forbidden Error No access - `any` ### 422 Unprocessable Entity Error Client Error - `map from string to list of string` ### 500 Internal Server Error Server Error - `map from string to list of string` ## Types ### Orders.CanceledShipmentViewModel - `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 ## Examples **Request** ```json { "shipment_ids": [ 0 ] } ``` **Response** ```json { "results": [ { "action": "Cancel", "is_success": true, "reason": "string", "shipment_id": 0 } ] } ``` **SDK Code** ```python default import requests url = "https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel" payload = { "shipment_ids": [0] } headers = { "shipbob_channel_id": "1", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript default const url = 'https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel'; const options = { method: 'POST', headers: { shipbob_channel_id: '1', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"shipment_ids":[0]}' }; 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" "strings" "net/http" "io" ) func main() { url := "https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel" payload := strings.NewReader("{\n \"shipment_ids\": [\n 0\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("shipbob_channel_id", "1") req.Header.Add("Authorization", "Bearer ") 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 default require 'uri' require 'net/http' url = URI("https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["shipbob_channel_id"] = '1' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"shipment_ids\": [\n 0\n ]\n}" response = http.request(request) puts response.read_body ``` ```java default import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel") .header("shipbob_channel_id", "1") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"shipment_ids\": [\n 0\n ]\n}") .asString(); ``` ```php default request('POST', 'https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel', [ 'body' => '{ "shipment_ids": [ 0 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => '1', ], ]); echo $response->getBody(); ``` ```csharp default using RestSharp; var client = new RestClient("https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel"); var request = new RestRequest(Method.POST); request.AddHeader("shipbob_channel_id", "1"); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"shipment_ids\": [\n 0\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift default import Foundation let headers = [ "shipbob_channel_id": "1", "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["shipment_ids": [0]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2026-07/shipment:batchCancel")! 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() ```