# Update shipment line items POST https://sandbox-api.shipbob.com/2025-07/shipments/{shipmentId}:updateLineItems Content-Type: application/json Updates the line items for a specific shipment. The request body must include the complete list of line items as returned by the GET /{shipmentId}:getLineItems endpoint — partial updates are not supported. Retrieve the current line items first, modify the desired fields, and submit the full payload. Reference: https://developer-stage.shipbob.dev/2025-07/api/shipments/update-shipment-line-items ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-2025-07 version: 1.0.0 paths: /2025-07/shipments/{shipmentId}:updateLineItems: post: operationId: update-shipment-line-items summary: | Update shipment line items description: > Updates the line items for a specific shipment. The request body must include the complete list of line items as returned by the GET /{shipmentId}:getLineItems endpoint — partial updates are not supported. Retrieve the current line items first, modify the desired fields, and submit the full payload. tags: - subpackage_shipments parameters: - name: shipmentId in: path description: '' required: true schema: type: integer - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Shipments.ShipmentLineItemsApiResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/Shipments.UpdateLineItemsRequest' servers: - url: https://sandbox-api.shipbob.com components: schemas: Shipments.ShipmentLineItemsViewModel: type: object properties: fulfillment_center_id: type: integer id: type: integer inventory_id: type: integer is_manually_assigned_lot: type: boolean lot_date: type: - string - 'null' lot_number: type: - string - 'null' quantity: type: integer required: - inventory_id - quantity title: Shipments.ShipmentLineItemsViewModel Shipments.UpdateLineItemsRequest: type: object properties: items: type: array items: $ref: '#/components/schemas/Shipments.ShipmentLineItemsViewModel' required: - items title: Shipments.UpdateLineItemsRequest Shipments.ErrorCode: type: string enum: - INVALID_PARAMETER - VALIDATION_ERROR - DATABASE_UPDATE_ERROR - REPROCESSING_ERROR - DEALLOCATE_ERROR - NOT_FOUND - CONFLICT title: Shipments.ErrorCode Shipments.ErrorResponse: type: object properties: code: $ref: '#/components/schemas/Shipments.ErrorCode' message: type: - string - 'null' title: Shipments.ErrorResponse Shipments.ShipmentLineItemResponse: type: object properties: action: type: - string - 'null' inventory_id: type: integer new_value: type: - string - 'null' previous_value: type: - string - 'null' title: Shipments.ShipmentLineItemResponse Shipments.ShipmentLineItemsApiResponse: type: object properties: error: $ref: '#/components/schemas/Shipments.ErrorResponse' id: type: integer format: int64 is_success: type: boolean shipment_line_items: type: - array - 'null' items: $ref: '#/components/schemas/Shipments.ShipmentLineItemResponse' title: Shipments.ShipmentLineItemsApiResponse 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 Shipments_updateShipmentLineItems_example import requests url = "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems" payload = { "items": [ { "inventory_id": 789012, "quantity": 2, "fulfillment_center_id": 8, "id": 123456, "is_manually_assigned_lot": False, "lot_date": "2024-06-01", "lot_number": "LOT-2024-001" } ] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Shipments_updateShipmentLineItems_example const url = 'https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"items":[{"inventory_id":789012,"quantity":2,"fulfillment_center_id":8,"id":123456,"is_manually_assigned_lot":false,"lot_date":"2024-06-01","lot_number":"LOT-2024-001"}]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Shipments_updateShipmentLineItems_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems" payload := strings.NewReader("{\n \"items\": [\n {\n \"inventory_id\": 789012,\n \"quantity\": 2,\n \"fulfillment_center_id\": 8,\n \"id\": 123456,\n \"is_manually_assigned_lot\": false,\n \"lot_date\": \"2024-06-01\",\n \"lot_number\": \"LOT-2024-001\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) 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 Shipments_updateShipmentLineItems_example require 'uri' require 'net/http' url = URI("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"items\": [\n {\n \"inventory_id\": 789012,\n \"quantity\": 2,\n \"fulfillment_center_id\": 8,\n \"id\": 123456,\n \"is_manually_assigned_lot\": false,\n \"lot_date\": \"2024-06-01\",\n \"lot_number\": \"LOT-2024-001\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Shipments_updateShipmentLineItems_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"items\": [\n {\n \"inventory_id\": 789012,\n \"quantity\": 2,\n \"fulfillment_center_id\": 8,\n \"id\": 123456,\n \"is_manually_assigned_lot\": false,\n \"lot_date\": \"2024-06-01\",\n \"lot_number\": \"LOT-2024-001\"\n }\n ]\n}") .asString(); ``` ```php Shipments_updateShipmentLineItems_example request('POST', 'https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems', [ 'body' => '{ "items": [ { "inventory_id": 789012, "quantity": 2, "fulfillment_center_id": 8, "id": 123456, "is_manually_assigned_lot": false, "lot_date": "2024-06-01", "lot_number": "LOT-2024-001" } ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Shipments_updateShipmentLineItems_example using RestSharp; var client = new RestClient("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"items\": [\n {\n \"inventory_id\": 789012,\n \"quantity\": 2,\n \"fulfillment_center_id\": 8,\n \"id\": 123456,\n \"is_manually_assigned_lot\": false,\n \"lot_date\": \"2024-06-01\",\n \"lot_number\": \"LOT-2024-001\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Shipments_updateShipmentLineItems_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["items": [ [ "inventory_id": 789012, "quantity": 2, "fulfillment_center_id": 8, "id": 123456, "is_manually_assigned_lot": false, "lot_date": "2024-06-01", "lot_number": "LOT-2024-001" ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateLineItems")! 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() ```