# Get a list of inventory items by product id GET https://api.shipbob.com/1.0/product/{productId}/inventory Reference: https://developer.shipbob.com/v1.0/api/products/get-a-list-of-inventory-items-by-product-id ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: | Get a list of inventory items by product id version: endpoint_inventory.getAListOfInventoryItemsByProductId paths: /1.0/product/{productId}/inventory: get: operationId: get-a-list-of-inventory-items-by-product-id summary: | Get a list of inventory items by product id tags: - - subpackage_inventory parameters: - name: productId in: path description: | The product id to get inventory for required: true schema: type: string format: int32 - 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: false schema: type: string format: int32 responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/Inventory.InventoryViewModelArray' '400': description: Bad Request content: {} '401': description: Unauthorized content: {} '403': description: Forbidden content: {} '404': description: Not Found content: {} components: schemas: Inventory.DimensionViewModel: type: object properties: depth: type: number format: double description: Depth in inches of this inventory item length: type: number format: double description: Length in inches of this inventory item weight: type: number format: double description: Weight in ounces of this inventory item width: type: number format: double description: Width in inches of this inventory item Inventory.FulfillmentCenterQuantityViewModel: type: object properties: awaiting_quantity: type: integer description: >- Amount of quantity awaiting arrival of a receiving order at this fulfillment center committed_quantity: type: integer description: Amount of committed quantity at this fulfillment center fulfillable_quantity: type: integer description: Amount of fulfillable quantity at this fulfillment center id: type: integer description: Unique id of the fulfillment center internal_transfer_quantity: type: integer description: "The quantity of items that are in the process of internal transit \r\nbetween ShipBob fulfillment centers, with a destination of this fulfillment center.\r\nThese items are not pickable or fulfillable until they have been received and moved \r\nto the \"On Hand\" quantity of the destination FC." name: type: - string - 'null' description: Name of the fulfillment center onhand_quantity: type: integer description: Amount of onhand quantity at this fulfillment center Inventory.LotQuantityViewModel: type: object properties: awaiting_quantity: type: integer description: >- Quantity of inventory items belonging to this lot awaiting arrival of a receiving order committed_quantity: type: integer description: Committed quantity of inventory items belonging to this lot expiration_date: type: - string - 'null' format: date-time description: Expiration date for this lot fulfillable_quantity: type: integer description: Fulfillable quantity of inventory items belonging to this lot fulfillable_quantity_by_fulfillment_center: type: - array - 'null' items: $ref: '#/components/schemas/Inventory.FulfillmentCenterQuantityViewModel' description: >- Fulfillable quantity of inventory items belonging to this lot broken down by fulfillment center location internal_transfer_quantity: type: integer description: "The quantity of all items belonging to this lot that are in the process of internal transit \r\nbetween ShipBob fulfillment centers. These items are not pickable or fulfillable\r\nuntil they have been received and moved to the \"On Hand\" quantity of the destination FC.\r\nInternal transit quantities for each FC represent the incoming transfer stock\r\nfor that specific location." lot_number: type: - string - 'null' description: Identification number of this lot onhand_quantity: type: integer description: OnHand quantity of inventory items belonging to this lot Inventory.PackagingAttribute: type: string enum: - value: None - value: Fragile - value: Foldable - value: Stackable - value: Book - value: CustomPackaging - value: CustomDunnage - value: MarketingInsert - value: Poster Inventory.InventoryViewModel: type: object properties: dimensions: $ref: '#/components/schemas/Inventory.DimensionViewModel' fulfillable_quantity_by_fulfillment_center: type: - array - 'null' items: $ref: '#/components/schemas/Inventory.FulfillmentCenterQuantityViewModel' description: >- Fulfillable quantity of this inventory item broken down by fulfillment center location fulfillable_quantity_by_lot: type: - array - 'null' items: $ref: '#/components/schemas/Inventory.LotQuantityViewModel' description: Fulfillable quantity of this inventory item broken down by lot id: type: integer description: Unique id of the inventory item is_active: type: boolean description: Whether the inventory is active or not is_case_pick: type: boolean description: True if the inventory item is marked as case pick is_digital: type: boolean description: True if the inventory item is marked as a digital item is_lot: type: boolean description: True if this inventory item is organized into lots name: type: - string - 'null' description: Name of the inventory item packaging_attribute: $ref: '#/components/schemas/Inventory.PackagingAttribute' total_awaiting_quantity: type: integer description: >- Total quantity in unreceived receiving orders for this inventory item total_backordered_quantity: type: integer description: "The amount of the item you need to send to ShipBob to fulfill all exception orders containing \r\nthe item. This is the exception_quantity less the fulfillable_quantity of the item." total_committed_quantity: type: integer description: Total committed quantity of this inventory item total_exception_quantity: type: integer description: "The total quantity of all items that are contained within orders that\r\nare in exception/out of stock status. Out of stock orders have not been\r\nprocessed and therefore do not have lot or fulfillment centers assigned." total_fulfillable_quantity: type: integer description: Total fulfillable quantity of this inventory item total_internal_transfer_quantity: type: integer description: "The total quantity of all items that are in the process of internal transit \r\nbetween ShipBob fulfillment centers. These items are not pickable or fulfillable\r\nuntil they have been received and moved to the \"On Hand\" quantity of the destination FC.\r\nInternal transit quantities for each FC represent the incoming transfer stock\r\nfor that specific location." total_onhand_quantity: type: integer description: Total onhand quantity of this inventory item total_sellable_quantity: type: integer description: "Total quantity that can be sold without overselling the inventory item.\r\nThis is calculated by subtracting the total exception quantity from the\r\nfulfillable quantity." Inventory.InventoryViewModelArray: type: array items: $ref: '#/components/schemas/Inventory.InventoryViewModel' ``` ## SDK Code Examples ```python Inventory_getAListOfInventoryItemsByProductId_example import requests url = "https://api.shipbob.com/1.0/product/productId/inventory" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Inventory_getAListOfInventoryItemsByProductId_example const url = 'https://api.shipbob.com/1.0/product/productId/inventory'; 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 Inventory_getAListOfInventoryItemsByProductId_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.shipbob.com/1.0/product/productId/inventory" 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 Inventory_getAListOfInventoryItemsByProductId_example require 'uri' require 'net/http' url = URI("https://api.shipbob.com/1.0/product/productId/inventory") 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 Inventory_getAListOfInventoryItemsByProductId_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.shipbob.com/1.0/product/productId/inventory") .header("Authorization", "Bearer ") .asString(); ``` ```php Inventory_getAListOfInventoryItemsByProductId_example request('GET', 'https://api.shipbob.com/1.0/product/productId/inventory', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Inventory_getAListOfInventoryItemsByProductId_example using RestSharp; var client = new RestClient("https://api.shipbob.com/1.0/product/productId/inventory"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Inventory_getAListOfInventoryItemsByProductId_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/1.0/product/productId/inventory")! 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() ```