Home › Docs › Inventory API

Inventory API

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

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, so 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"
  }
}

Product Requests

Ask VenHub to add a product that isn't in the catalog yet. Each request is tied to one hub, named by the numeric hub_id in the URL. Your API key decides which hubs you can use: even if a key covers several hubs, a request is created at, and listed from, only the hub in the URL. New requests start as pending until the VenHub team reviews them.

StatusMeaning
pendingWaiting for review
requires_more_informationThe reviewer needs more details. Check review_note for what's missing.
approvedThe product has been approved
rejectedThe request was rejected
ℹ️
With an API key you can submit and track requests, but you can't edit or cancel them. There's no cancel endpoint and no cancelled status. To submit many products at once, use CSV import in TINA.
⚠️
Submitting the same UPC twice creates two separate requests, even at the same hub. If a POST times out, check with GET using ?upc= before you retry.
ℹ️
These endpoints don't use the error shape in the Error Reference. Validation and not-found errors return a detail field. Auth errors return {"success": false, "error_message_key": …, "error_message": …}. These endpoints are not rate limited.
POST /hubs/{hub_id}/planograms/product-requests/

Submit a new product request for a hub. All five body fields are required. The server sets id, hub_id, client_id, status, review_note, and the timestamps.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/{hub_id}/planograms/product-requests/
Auth API Key
Required Scope inventory:write

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/owners/hubs/123/planograms/product-requests/" \
  --header "X-API-Key: vh_abc123..." \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Sparkling Water 330 mL",
    "upc": "012345678905",
    "product_type": "can",
    "dimensions": {
      "height_in": 4.5,
      "width_in": 2.6,
      "depth_in": 2.6,
      "weight_lb": 0.75
    },
    "image_url": "https://example.com/images/water.png"
  }'

Parameters

ParameterTypeLocationRequiredDescription
hub_id Integer Path Required Hub to create the request at. Your key must have access to it.
name String Body Required Product name. Can't be blank; up to 255 characters.
upc String Body Required Product UPC. Can't be blank; up to 255 characters. Send it as a string so leading zeros are kept.
product_type String Body Required One of can, bottle, soft_can, box, or thick_box. The type must also exist in the product catalog.
dimensions Object Body Required All four of height_in, width_in, depth_in, and weight_lb. Integers or decimals. Height, width, and depth must be greater than 0; weight_lb can be 0.
image_url String Body Required A public HTTPS image URL, or a base64 data URI containing a PNG, JPEG, or WebP image of up to 2 MiB (decoded).

Response

JSON - 201 Created
{
  "success": true,
  "data": {
    "id": "a1b2c3d4-0000-4000-8000-000000000001",
    "hub_id": 123,
    "client_id": null,
    "name": "Sparkling Water 330 mL",
    "upc": "012345678905",
    "product_type": "can",
    "dimensions": {
      "height_in": 4.5,
      "width_in": 2.6,
      "depth_in": 2.6,
      "weight_lb": 0.75
    },
    "image_url": "https://example.com/images/water.png",
    "status": "pending",
    "review_note": null,
    "created_at": "2026-11-23T18:00:00Z",
    "updated_at": "2026-11-23T18:00:00Z"
  }
}

Errors

HTTP StatusDescription
422 A field is missing, or the dimensions or image are invalid. detail is an array of validation errors; each entry names the field in loc and includes msg and type.
422 Unsupported product_type: {"detail": "Choose can, bottle, soft can, box, or thick box"}. Send the values with underscores (soft_can, thick_box).
403 error_message_key is User_Not_Authorized_Action. error_message is API key missing required scope: inventory:write, or API key does not have access to hub {hub_id}.
401 The key is invalid, expired, or revoked. error_message_key is INVALID_API_KEY.
GET /hubs/{hub_id}/planograms/product-requests/

List the product requests for a hub, newest first. The list isn't paginated. Filters are optional and can be combined.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/{hub_id}/planograms/product-requests/
Auth API Key
Required Scope inventory:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/hubs/123/planograms/product-requests/?upc=012345678905&status=pending" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_id Integer Path Required Hub to list requests for. Your key must have access to it.
name String Query Optional Matches any part of the product name, ignoring case
upc String Query Optional Exact UPC match
status String Query Optional pending, requires_more_information, approved, or rejected

Response

Each request includes can_edit, which is always false for API-key callers. can_review is true only for a VenHub admin with review permission.

JSON - 200 OK
{
  "success": true,
  "data": {
    "can_review": false,
    "requests": [
      {
        "id": "a1b2c3d4-0000-4000-8000-000000000001",
        "hub_id": 123,
        "client_id": null,
        "name": "Sparkling Water 330 mL",
        "upc": "012345678905",
        "product_type": "can",
        "dimensions": {
          "height_in": 4.5,
          "width_in": 2.6,
          "depth_in": 2.6,
          "weight_lb": 0.75
        },
        "image_url": "https://example.com/images/water.png",
        "status": "pending",
        "review_note": null,
        "created_at": "2026-11-23T18:00:00Z",
        "updated_at": "2026-11-23T18:00:00Z",
        "can_edit": false
      }
    ]
  }
}

Errors

HTTP StatusDescription
422 A filter value is invalid, such as an unknown status. detail is an array of validation errors with loc, msg, and type.
403 error_message_key is User_Not_Authorized_Action. error_message is API key missing required scope: inventory:read, or API key does not have access to hub {hub_id}.
401 The key is invalid, expired, or revoked. error_message_key is INVALID_API_KEY.
GET /hubs/{hub_id}/planograms/product-requests/{request_id}/

Get one product request by the id returned when you submitted it. Check status to see where it stands and review_note for anything the reviewer needs from you.

Version 1
URL https://tina-api.venhub.com/api/v1/owners/hubs/{hub_id}/planograms/product-requests/{request_id}/
Auth API Key
Required Scope inventory:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/hubs/123/planograms/product-requests/a1b2c3d4-0000-4000-8000-000000000001/" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_id Integer Path Required Hub the request belongs to. Your key must have access to it.
request_id String (UUID) Path Required The id returned when the request was submitted

Response

This example shows a request after the reviewer asked for more information.

JSON - 200 OK
{
  "success": true,
  "data": {
    "id": "a1b2c3d4-0000-4000-8000-000000000001",
    "hub_id": 123,
    "client_id": null,
    "name": "Sparkling Water 330 mL",
    "upc": "012345678905",
    "product_type": "can",
    "dimensions": {
      "height_in": 4.5,
      "width_in": 2.6,
      "depth_in": 2.6,
      "weight_lb": 0.75
    },
    "image_url": "https://example.com/images/water.png",
    "status": "requires_more_information",
    "review_note": "Please provide a clearer image of the front label.",
    "created_at": "2026-11-23T18:00:00Z",
    "updated_at": "2026-11-23T19:15:00Z"
  }
}

Errors

HTTP StatusDescription
404 {"detail": "Product request not found"}. Also returned when the request belongs to a different hub than the one in the URL.
403 error_message_key is User_Not_Authorized_Action. error_message is API key missing required scope: inventory:read, or API key does not have access to hub {hub_id}.
401 The key is invalid, expired, or revoked. error_message_key is INVALID_API_KEY.