Home › Docs › Inventory API

Inventory API

Endpoints for reading product listings, querying by physical location, and updating stock quantities, prices, and UPC barcodes.

GET /hub_inventory

Retrieve the complete inventory listing for a specific hub, including all products, quantities, and physical location details.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hub_inventory/
Auth API Key or Firebase
Required Scope inventory:read

Example Request

cURL
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

JSON — 200 OK
[
  {
    "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 CodeDescription
hub_access_denied API key does not have access to the specified hub
hub_not_found The specified hub does not exist
GET /hubs/product

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.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/product/
Auth API Key or Firebase
Required Scope inventory:read

Example Request

cURL
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

ParameterTypeRequiredDescription
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

JSON — 200 OK
{
  "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 CodeDescription
product_not_found No product exists at the specified location
invalid_location Cabinet, shelf, or row number is out of range
PUT /hubs/product/{product_id}/update_quantity

Update the stock quantity for a product. The new value completely replaces the current quantity.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/product/{product_id}/update_quantity
Auth API Key or Firebase
Required Scope inventory:write

Example Request

cURL
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

ParameterTypeLocationRequiredDescription
product_id Integer Path Required ID of the product to update
quantity Integer Body Required New stock quantity (must be ≥ 0)

Response

JSON — 200 OK
{
  "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 CodeDescription
product_not_found The specified product does not exist
invalid_quantity Quantity must be a non-negative integer
PUT /product/{product_id}/update_price

Update the selling price for a product. All prices are in cents — pass 399 to set a price of $3.99.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/product/{product_id}/update_price
Auth API Key or Firebase
Required Scope inventory:write

Example Request

cURL
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

ParameterTypeLocationRequiredDescription
product_id Integer Path Required ID of the product to update
price Integer Body Required New selling price in cents (must be > 0)

Response

JSON — 200 OK
{
  "data": {
    "id": 456,
    "name": "Organic Apple",
    "upc": "012345678901",
    "quantity": 25,
    "original_price": 399,
    "discounted_price": 399,
    "purchase_price": 150
  }
}

Errors

Error CodeDescription
product_not_found The specified product does not exist
invalid_price Price must be a positive integer in cents
PUT /product/{product_id}/update_purchase_price

Update the wholesale/cost price for a product. Used for margin calculations and reporting. Value is in cents.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/product/{product_id}/update_purchase_price
Auth API Key or Firebase
Required Scope inventory:write

Example Request

cURL
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

ParameterTypeLocationRequiredDescription
product_id Integer Path Required ID of the product to update
purchase_price Integer Body Required New wholesale/cost price in cents

Response

JSON — 200 OK
{
  "data": {
    "id": 456,
    "name": "Organic Apple",
    "upc": "012345678901",
    "quantity": 25,
    "original_price": 299,
    "discounted_price": 299,
    "purchase_price": 199
  }
}
PUT /product/{product_id}/update_upc

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.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/product/{product_id}/update_upc
Auth API Key or Firebase
Required Scope inventory:write

Example Request

cURL
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

ParameterTypeLocationRequiredDescription
product_id Integer Path Required ID of the product to update
upc String Body Required New UPC barcode string (12-digit)

Response

JSON — 200 OK
{
  "success": true,
  "data": {
    "id": 456,
    "upc": "012345678901"
  }
}