GuidesInventoryGet Inventory Levels

How to get inventory levels for a product

Educational video from PromoStandards



Function getInventoryLevels

In order to get inventory for a given product we need to use Inventory service (INV). Our API allows easy access by a GET request to our inventory endpoint.

HTTP VERB: GET

URL: https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/inventory/{PRODUCT_ID}/

Query Parameters

ParameterTypeRequiredDescription
part_idstring[]NoFilter by specific part ID(s). Can be repeated for multiple parts
colorstring[]NoFilter by color(s). Can be repeated for multiple colors
sizestring[]NoFilter by size(s). Can be repeated for multiple sizes
environmentstringNoEnvironment: PROD or STAGING (default: PROD)

Example Request

curl -X GET "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/55414/" \
  -H "X-API-Key: your-api-key"

Example with Filters

Get inventory for specific colors:

curl -X GET "https://api.psrestful.com/v2.0.0/suppliers/HIT/inventory/55414/?color=WHITE&color=BLACK" \
  -H "X-API-Key: your-api-key"

Example Response

This is the response from calling with: SUPPLIER_CODE = HIT PRODUCT_ID = 55414

The response has been truncated to show 2 parts:

{
    "Inventory": {
        "productId": "55414",
        "PartInventoryArray": {
            "PartInventory": [
                {
                    "partId": "5414SWHT",
                    "mainPart": true,
                    "partColor": "WHITE",
                    "labelSize": null,
                    "partDescription": "14OZ ELVATION MUG WHT 77-87047",
                    "quantityAvailable": {
                        "Quantity": {
                            "value": 26,
                            "uom": "EA"
                        }
                    },
                    "manufacturedItem": false,
                    "buyToOrder": false,
                    "replenishmentLeadTime": null,
                    "lastModified": "2023-07-28T15:29:00+00:00",
                    "InventoryLocationArray": {
                        "InventoryLocation": [
                            {
                                "inventoryLocationId": "42",
                                "inventoryLocationName": "WEAR MAGIC",
                                "inventoryLocationQuantity": {
                                    "Quantity": {
                                        "value": 15,
                                        "uom": "EA"
                                    }
                                },
                                "Address": {
                                    "city": "FAIRFIELD",
                                    "country": "US",
                                    "postalCode": "45014"
                                }
                            },
                            {
                                "inventoryLocationId": "10",
                                "inventoryLocationName": "BRYAN DAIRY",
                                "inventoryLocationQuantity": {
                                    "Quantity": {
                                        "value": 11,
                                        "uom": "EA"
                                    }
                                },
                                "Address": {
                                    "city": "LARGO",
                                    "country": "US",
                                    "postalCode": "33777"
                                }
                            }
                        ]
                    }
                },
                {
                    "partId": "5414SBLK",
                    "mainPart": true,
                    "partColor": "BLACK",
                    "labelSize": null,
                    "partDescription": "14OZ ELVATION MUG BLK 77-63605",
                    "quantityAvailable": {
                        "Quantity": {
                            "value": 18,
                            "uom": "EA"
                        }
                    },
                    "manufacturedItem": false,
                    "buyToOrder": false,
                    "lastModified": "2023-07-28T15:29:00+00:00",
                    "InventoryLocationArray": {
                        "InventoryLocation": [
                            {
                                "inventoryLocationId": "42",
                                "inventoryLocationName": "WEAR MAGIC",
                                "inventoryLocationQuantity": {
                                    "Quantity": {
                                        "value": 14,
                                        "uom": "EA"
                                    }
                                },
                                "Address": {
                                    "city": "FAIRFIELD",
                                    "country": "US",
                                    "postalCode": "45014"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    },
    "ServiceMessageArray": null
}

Response Structure

FieldDescription
productIdProduct identifier
PartInventoryArrayArray of inventory by part/variant
partIdPart/variant identifier
mainPartWhether this is the main part
partColorColor of the part
labelSizeSize label (for apparel)
partDescriptionDescription of the part
quantityAvailableTotal quantity available across all locations
lastModifiedWhen inventory was last updated
InventoryLocationArrayBreakdown by warehouse location

API Versions

Both v1.2.1 and v2.0.0 are supported:

https://api.psrestful.com/v1.2.1/suppliers/{SUPPLIER_CODE}/inventory/{PRODUCT_ID}/
https://api.psrestful.com/v2.0.0/suppliers/{SUPPLIER_CODE}/inventory/{PRODUCT_ID}/

Note: The part_id filter is only available in v2.0.0.

Use Cases

  • Order validation: Check stock before placing orders
  • Real-time availability: Display inventory to customers
  • Multi-location shipping: Find which warehouse has stock
  • Low stock alerts: Monitor inventory levels