# Cancel multiple Shipments by Shipment Id POST https://api.shipbob.com/1.0/shipment/cancelbulk Content-Type: application/json Reference: https://developer.shipbob.com/2025-07/api/orders/cancel-multiple-shipments-by-shipment-id ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-1.0 version: 1.0.0 paths: /1.0/shipment/cancelbulk: post: operationId: cancel-multiple-shipments-by-shipment-id summary: Cancel multiple Shipments by Shipment Id tags: - subpackage_orders parameters: - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token required: true schema: type: string - name: shipbob_channel_id in: header description: Channel ID for Operation required: true schema: type: string format: int32 responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Orders.CanceledShipmentsViewModel' '401': description: No access right at this time content: application/json: schema: description: Any type '403': description: No access content: application/json: schema: description: Any type '422': description: Client Error content: application/json: schema: $ref: >- #/components/schemas/Orders.Post.Api.Shipment.Cancelbulk.Unprocessable.Entity.Object '500': description: Server Error content: application/json: schema: $ref: >- #/components/schemas/Orders.Post.Api.Shipment.Cancelbulk.Internal.Server.Error.Object requestBody: description: The shipment IDs to cancel content: application/json: schema: $ref: '#/components/schemas/Orders.CancelShipmentsModel' servers: - url: https://api.shipbob.com - url: https://sandbox-api.shipbob.com components: schemas: Orders.CancelShipmentsModel: type: object properties: shipment_ids: type: - array - 'null' items: type: integer description: Shipment IDs to cancel description: Model for cancel multiple shipments at once title: Orders.CancelShipmentsModel Orders.ShipmentAction: type: string enum: - CleanSweep - Reassign - ReleaseOrderHold - MoveToOnHoldAndKeepInventory - MoveToOnHoldAndReleaseInventory - Cancel - AddLineItem - RemoveLineItem - UpdateShipOption title: Orders.ShipmentAction Orders.CanceledShipmentViewModel: type: object properties: action: $ref: '#/components/schemas/Orders.ShipmentAction' is_success: type: boolean description: If the cancel action was successful reason: type: - string - 'null' description: The reason the cancellation result shipment_id: type: integer format: int64 description: The ID of the shipment title: Orders.CanceledShipmentViewModel Orders.CanceledShipmentsViewModel: type: object properties: results: type: - array - 'null' items: $ref: '#/components/schemas/Orders.CanceledShipmentViewModel' description: The results of all cancellation actions title: Orders.CanceledShipmentsViewModel Orders.Post.Api.Shipment.Cancelbulk.Unprocessable.Entity.Object: type: object additionalProperties: type: array items: type: string title: Orders.Post.Api.Shipment.Cancelbulk.Unprocessable.Entity.Object Orders.Post.Api.Shipment.Cancelbulk.Internal.Server.Error.Object: type: object additionalProperties: type: array items: type: string title: Orders.Post.Api.Shipment.Cancelbulk.Internal.Server.Error.Object securitySchemes: PAT: type: http scheme: bearer description: Authentication using Personal Access Token (PAT) token OAuth2: type: http scheme: bearer description: OAuth2 authentication using JWT tokens ``` ## SDK Code Examples ```python Orders_cancelMultipleShipmentsByShipmentId_example import requests url = "https://api.shipbob.com/1.0/shipment/cancelbulk" payload = { "shipment_ids": [0] } headers = { "shipbob_channel_id": "shipbob_channel_id", "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Orders_cancelMultipleShipmentsByShipmentId_example const url = 'https://api.shipbob.com/1.0/shipment/cancelbulk'; const options = { method: 'POST', headers: { shipbob_channel_id: 'shipbob_channel_id', 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 Orders_cancelMultipleShipmentsByShipmentId_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.shipbob.com/1.0/shipment/cancelbulk" payload := strings.NewReader("{\n \"shipment_ids\": [\n 0\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("shipbob_channel_id", "shipbob_channel_id") 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 Orders_cancelMultipleShipmentsByShipmentId_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/1.0/shipment/cancelbulk") 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 ' request["Content-Type"] = 'application/json' request.body = "{\n \"shipment_ids\": [\n 0\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Orders_cancelMultipleShipmentsByShipmentId_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.shipbob.com/1.0/shipment/cancelbulk") .header("shipbob_channel_id", "shipbob_channel_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"shipment_ids\": [\n 0\n ]\n}") .asString(); ``` ```php Orders_cancelMultipleShipmentsByShipmentId_example request('POST', 'https://api.shipbob.com/1.0/shipment/cancelbulk', [ 'body' => '{ "shipment_ids": [ 0 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', 'shipbob_channel_id' => 'shipbob_channel_id', ], ]); echo $response->getBody(); ``` ```csharp Orders_cancelMultipleShipmentsByShipmentId_example using RestSharp; var client = new RestClient("https://api.shipbob.com/1.0/shipment/cancelbulk"); var request = new RestRequest(Method.POST); request.AddHeader("shipbob_channel_id", "shipbob_channel_id"); 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 Orders_cancelMultipleShipmentsByShipmentId_example import Foundation let headers = [ "shipbob_channel_id": "shipbob_channel_id", "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://api.shipbob.com/1.0/shipment/cancelbulk")! 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() ```