Inventory API
Endpoints for reading product listings, querying by physical location, and updating stock quantities, prices, and UPC barcodes.
Retrieve the complete inventory listing for a specific hub, including all products, quantities, and physical location details.
Example Request
curl -X GET \ "https://tina-api.venhub.com/api/v1/owners/hub_inventory/?hub_id=123" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json"
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id |
Integer | Required | The ID of the hub to retrieve inventory for |
Response
[
{
"id": 1,
"name": "Organic Apple",
"upc": "012345678901",
"quantity": 25,
"original_price": 299,
"discounted_price": 299,
"purchase_price": 150,
"cabinet": 1,
"shelf": 2,
"row": 3,
"category": "Produce"
}
]
Errors
| Error Code | Description |
|---|---|
| hub_access_denied | API key does not have access to the specified hub |
| hub_not_found | The specified hub does not exist |
Look up a product by its physical location (cabinet, shelf, row) within a hub. Useful for IoT devices or restocking systems that know the physical slot.
Example Request
curl -X GET \ "https://tina-api.venhub.com/api/v1/owners/hubs/product/?hub_id=123&cabinet=1&shelf=2&row=3" \ --header "X-API-Key: vh_abc123..."
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id |
Integer | Required | Hub ID to search in |
cabinet |
Integer | Required | Cabinet number (1–4) |
shelf |
Integer | Required | Shelf number within the cabinet |
row |
Integer | Required | Row number within the shelf |
Response
{
"id": 1,
"name": "Organic Apple",
"upc": "012345678901",
"quantity": 25,
"original_price": 299,
"discounted_price": 299,
"purchase_price": 150,
"category": "Produce",
"image_url": "https://storage.example.com/products/apple.jpg"
}
Errors
| Error Code | Description |
|---|---|
| product_not_found | No product exists at the specified location |
| invalid_location | Cabinet, shelf, or row number is out of range |
Update the stock quantity for a product. The new value completely replaces the current quantity.
Example Request
curl -X PUT \ "https://tina-api.venhub.com/api/v1/owners/hubs/product/456/update_quantity" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"quantity": 50}'
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
product_id |
Integer | Path | Required | ID of the product to update |
quantity |
Integer | Body | Required | New stock quantity (must be ≥ 0) |
Response
{
"data": {
"id": 456,
"name": "Organic Apple",
"upc": "012345678901",
"quantity": 50,
"original_price": 299,
"discounted_price": 299,
"purchase_price": 150,
"cabinet": 1,
"shelf": 2,
"row": 3
}
}
Errors
| Error Code | Description |
|---|---|
| product_not_found | The specified product does not exist |
| invalid_quantity | Quantity must be a non-negative integer |
Update the selling price for a product. All prices are in cents — pass 399 to set a price of $3.99.
Example Request
curl -X PUT \ "https://tina-api.venhub.com/api/v1/owners/product/456/update_price" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"price": 399}'
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
product_id |
Integer | Path | Required | ID of the product to update |
price |
Integer | Body | Required | New selling price in cents (must be > 0) |
Response
{
"data": {
"id": 456,
"name": "Organic Apple",
"upc": "012345678901",
"quantity": 25,
"original_price": 399,
"discounted_price": 399,
"purchase_price": 150
}
}
Errors
| Error Code | Description |
|---|---|
| product_not_found | The specified product does not exist |
| invalid_price | Price must be a positive integer in cents |
Update the wholesale/cost price for a product. Used for margin calculations and reporting. Value is in cents.
Example Request
curl -X PUT \ "https://tina-api.venhub.com/api/v1/owners/product/456/update_purchase_price" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"purchase_price": 199}'
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
product_id |
Integer | Path | Required | ID of the product to update |
purchase_price |
Integer | Body | Required | New wholesale/cost price in cents |
Response
{
"data": {
"id": 456,
"name": "Organic Apple",
"upc": "012345678901",
"quantity": 25,
"original_price": 299,
"discounted_price": 299,
"purchase_price": 199
}
}
Update the UPC (Universal Product Code) barcode for a product. Use this when reassigning a slot to a different product or correcting a barcode entry.
Example Request
curl -X PUT \ "https://tina-api.venhub.com/api/v1/owners/product/456/update_upc" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"upc": "012345678901"}'
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
product_id |
Integer | Path | Required | ID of the product to update |
upc |
String | Body | Required | New UPC barcode string (12-digit) |
Response
{
"success": true,
"data": {
"id": 456,
"upc": "012345678901"
}
}