# Get shipment line items GET https://sandbox-api.shipbob.com/2025-07/shipments/{shipmentId}:getLineItems Retrieves the line items for a specific shipment. Reference: https://developer-stage.shipbob.dev/2025-07/api/shipments/get-shipment-line-items ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-2025-07 version: 1.0.0 paths: /2025-07/shipments/{shipmentId}:getLineItems: get: operationId: get-shipment-line-items summary: | Get shipment line items description: | Retrieves the line items for a specific shipment. 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.ShipmentLineItemDetailArray' servers: - url: https://sandbox-api.shipbob.com components: schemas: Shipments.LotSelectionMethod: type: string enum: - ShipbobChooses - Specific title: Shipments.LotSelectionMethod Shipments.LotInfo: type: object properties: lot_date: type: - string - 'null' format: date-time lot_number: type: - string - 'null' selection_method: $ref: '#/components/schemas/Shipments.LotSelectionMethod' title: Shipments.LotInfo Shipments.ProductVariantDetail: type: object properties: id: type: integer name: type: - string - 'null' sku: type: - string - 'null' title: Shipments.ProductVariantDetail Shipments.ShipmentLineItemDetail: type: object properties: committed_quantity: type: integer inventory_id: type: integer is_hazmat: type: - boolean - 'null' is_lot: type: - boolean - 'null' lot: $ref: '#/components/schemas/Shipments.LotInfo' product_variant: $ref: '#/components/schemas/Shipments.ProductVariantDetail' quantity: type: integer serial_numbers: type: - array - 'null' items: type: string title: Shipments.ShipmentLineItemDetail Shipments.ShipmentLineItemDetailArray: type: array items: $ref: '#/components/schemas/Shipments.ShipmentLineItemDetail' title: Shipments.ShipmentLineItemDetailArray 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_getShipmentLineItems_example import requests url = "https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Shipments_getShipmentLineItems_example const url = 'https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Shipments_getShipmentLineItems_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Shipments_getShipmentLineItems_example require 'uri' require 'net/http' url = URI("https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Shipments_getShipmentLineItems_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems") .header("Authorization", "Bearer ") .asString(); ``` ```php Shipments_getShipmentLineItems_example request('GET', 'https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Shipments_getShipmentLineItems_example using RestSharp; var client = new RestClient("https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Shipments_getShipmentLineItems_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2025-07/shipments/1:getLineItems")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```