> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer-stage.shipbob.dev/llms.txt.
> For full documentation content, see https://developer-stage.shipbob.dev/llms-full.txt.

# Get a list of inventory items by product id


GET https://sandbox-api.shipbob.com/1.0/product/{productId}/inventory

Reference: https://developer-stage.shipbob.dev/v1.0/api/inventory/get-a-list-of-inventory-items-by-product-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: api-1.0
  version: 1.0.0
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:
            $ref: >-
              #/components/schemas/Inventory.Get.Api.Product.ProductId.Inventory.ProductId.Integer
        - 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:
            $ref: >-
              #/components/schemas/Inventory.Get.Api.Product.ProductId.Inventory.Shipbob.Channel.Id.Integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Inventory.InventoryViewModelArray'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Inventory.Get.Api.Product.ProductId.Inventory.Bad.Request.Object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Inventory.ProblemDetails'
servers:
  - url: https://sandbox-api.shipbob.com
components:
  schemas:
    Inventory.Get.Api.Product.ProductId.Inventory.ProductId.Integer:
      type: integer
      title: Inventory.Get.Api.Product.ProductId.Inventory.ProductId.Integer
    Inventory.Get.Api.Product.ProductId.Inventory.Shipbob.Channel.Id.Integer:
      type: integer
      title: Inventory.Get.Api.Product.ProductId.Inventory.Shipbob.Channel.Id.Integer
    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
      description: Information about an inventory item's dimensions
      title: Inventory.DimensionViewModel
    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
          description: Name of the fulfillment center
        onhand_quantity:
          type: integer
          description: Amount of onhand quantity at this fulfillment center
      description: Break down of fulfillable quantity by fulfillment center
      title: Inventory.FulfillmentCenterQuantityViewModel
    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
          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
          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
          description: Identification number of this lot
        onhand_quantity:
          type: integer
          description: OnHand quantity of inventory items belonging to this lot
      description: Break down of fulfillable quantity by lot
      title: Inventory.LotQuantityViewModel
    Inventory.PackagingAttribute:
      type: string
      enum:
        - None
        - Fragile
        - Foldable
        - Stackable
        - Book
        - CustomPackaging
        - CustomDunnage
        - MarketingInsert
        - Poster
      title: Inventory.PackagingAttribute
    Inventory.InventoryViewModel:
      type: object
      properties:
        dimensions:
          $ref: '#/components/schemas/Inventory.DimensionViewModel'
        fulfillable_quantity_by_fulfillment_center:
          type: array
          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
          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
          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."
      description: Information about an inventory item
      title: Inventory.InventoryViewModel
    Inventory.InventoryViewModelArray:
      type: array
      items:
        $ref: '#/components/schemas/Inventory.InventoryViewModel'
      title: Inventory.InventoryViewModelArray
    Inventory.Get.Api.Product.ProductId.Inventory.Bad.Request.Object:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      title: Inventory.Get.Api.Product.ProductId.Inventory.Bad.Request.Object
    Inventory.ProblemDetails:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
        title:
          type: string
        type:
          type: string
      title: Inventory.ProblemDetails
  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 default
import requests

url = "https://sandbox-api.shipbob.com/1.0/product/1/inventory"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript default
const url = 'https://sandbox-api.shipbob.com/1.0/product/1/inventory';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.shipbob.com/1.0/product/1/inventory"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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/1.0/product/1/inventory")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox-api.shipbob.com/1.0/product/1/inventory")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox-api.shipbob.com/1.0/product/1/inventory', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp default
using RestSharp;

var client = new RestClient("https://sandbox-api.shipbob.com/1.0/product/1/inventory");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/1.0/product/1/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()
```