Manage Inventory Locations
With the /v2/inventory_locations
endpoints, you can create and delete inventory locations in inventory warehouses, list inventory inventory locations, and update inventory location names.
Inventory Locations Properties
Inventory locations have five properties:
Property | Type | Description |
---|---|---|
inventory_location_id | string | Generated automatically when you create an inventory location. This property is required to update or delete a specific inventory location and if you want to update SKU stock levels. You can also use it as a query parameter when listing SKU inventory levels. |
inventory_warehouse_id | string | Generated automatically when you create an inventory warehouse. This property is required if you want to add a new inventory location. |
name | string | The name that will appear in ShipStation for this inventory location. The name property reflects the area - unit - shelf - bin warehouse layout set for your warehouse locations in ShipStation. You’ll define the inventory location name when you add a new inventory location. This is also the only property you can update for an existing inventory location. |
created_at | string (date-time) | The date and time the inventory location was created. |
updated_at | string (date-time) | The date and time the inventory location was last updated. |
List Inventory Locations
To see which inventory locations are associated with which inventory warehouses, you’ll need to list all inventory locations.
GET /v2/inventory_locations
To see which inventory warehouse is associated with a specific inventory location, add the inventory_location_id
to the endpoint path.
GET /v2/inventory_locations/{inventory_loation_id}
Add an Inventory Location
When adding an inventory location, you’ll define its name
and set which inventory_warehouse_id
it will be associated with in the request body.
The inventory location name
must correspond to the location layout you’ve defined in ShipStation: area - unit - shelf - bin. For example, the location of a specific SKU is in:
- Area: A1
- Unit: 12
- Shelf: B2
- Bin: 24
The location name should be A1 - 12 - B2 - 24
Example Request & Response
POST /v2/inventory_locations
- Production https://api.shipstation.com/v2/inventory_locations
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.shipstation.com/v2/inventory_locations \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"name": "string",
"inventory_warehouse_id": "string"
}'
{ "inventory_location_id": "string", "name": "string", "inventory_warehouse_id": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }
Update an Inventory Location
You can update the name of an existing inventory location using the PUT method with the /v2/inventory_locations endpoint. Just add the inventory_location_id
you wish to update to the endpoint path, then include the name
property in the request body with the updated inventory location name.
Delete an Inventory Location
Deleting an inventory location is a bit of a special case because all inventory must be removed from the location before it can be deleted.
You can add the remove_inventory
query parameter to the endpoint path if you wish to remove inventory in the same request to delete the location.
Query Parameter | Type | Description |
---|---|---|
remove_inventory | enumerated string |
|
Example Request & Response
DELETE /v2/inventory_locations/{inventory_location_id}
- Production https://api.shipstation.com/v2/inventory_locations/{inventory_location_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://api.shipstation.com/v2/inventory_locations/{inventory_location_id}?remove_inventory=0' \
-H 'api-key: YOUR_API_KEY_HERE'