VenCart API
Build a server-side storefront that browses VenHub hubs, places orders, pays with your saved business card, and lets your customers collect their orders.
How VenCart Works
Your business is the purchasing customer. One dedicated VenHub account owns your orders and saved cards, and you charge your own customers. VenHub doesn't receive your customers' identities, send them pickup notifications or call your servers back. Your server polls order status and keeps your customers informed.
Base URL
All VenCart endpoints are served under the versioned /api/v1 prefix:
https://api.venhub.com/api/v1
For example, the products list is reached at https://api.venhub.com/api/v1/hubs/{hub_id}/products.
Successful responses return {"success": true, "data": …}, plus metadata on paged lists. pay and DELETE return only {"success": true}. All prices are in cents.
Getting Access
There's no self-service signup. Your VenHub integration contact sets up:
| Item | Details |
|---|---|
| Your account | A dedicated VenHub account for the integration, separate from any hub-owner account. |
| Assigned hubs | The hub IDs your key can use. |
| VH+ API key | Issued from TINA's key manager as a VH+ key, with its scopes and expiry, delivered through an agreed secure channel. |
| Saved card | Your business card and its VenHub card ID. |
| Support contacts | Who to contact about a payment or pickup problem. |
API Keys & Scopes
Send your key in the X-API-Key header from your server only. Never put it in browser JavaScript, a mobile app or a public repository. A shopper login token isn't an API key, and Authorization: Bearer isn't used.
X-API-Key: vh_abc123...
VenCart needs a VH+ key. TINA's key manager issues TINA and VH+ keys separately: a TINA owner key doesn't work on VenCart, and a VH+ key doesn't give TINA owner or admin access.
The full key is shown once and VenHub can't recover it. If it's lost or exposed, contact VenHub for a replacement. Keep it out of logs, screenshots and support messages.
Request only the scopes you need. Hub restrictions still apply when a key has the right scope.
| Scope | Use |
|---|---|
| integrations:read | Check connectivity and read your account and key permissions. |
| account-hubs:read | List your assigned hubs and read their status. |
| catalog:read | Browse products, categories and product detail. |
| account-orders:read | Read your account's orders and queue position. |
| account-orders:write | Create and edit carts, check checkout, reorder, delete or cancel. |
| payments:read | List enabled saved cards by VenHub ID. |
| payments:write | Pay for your account's orders with an enabled saved card. |
| pickup:write | Open only the bins of your own order at an allowed hub. |
orders:read, orders:write and hubs:read are owner and admin permissions, not aliases for the VenCart account-* scopes. VenCart keys issued with the previous names (orders:read, orders:write, hubs:read) must be reissued; endpoints, parameters and responses didn't change.Your First Order
Nine calls take an order from your key to your customer's hands:
| Step | Endpoint | What happens |
|---|---|---|
| 1. Check your key | GET /integrations/me | Save user_id and check your scopes and hubs. |
| 2. Find an active hub | GET /integrations/hubs | Pick an assigned hub whose hub_status is active. |
| 3. Browse the catalog | GET /hubs/{hub_id}/products | Choose products from that hub. |
| 4. Create the cart | POST /users/{user_id}/orders | One cart per customer order, using your order number. |
| 5. Set quantities | PUT /users/{user_id}/orders/{order_id}/order_item | Set each product's total quantity. |
| 6. Check checkout | GET /users/{user_id}/orders/{order_id}/checkout-available | Confirm the cart can be paid, then re-read the totals. |
| 7. Pay once | POST /users/payments/pay | Pay with a saved card. Don't auto-retry. |
| 8. Poll the order | GET /users/{user_id}/orders/{order_id} | Track fulfillment and payment until the order is ready (6), or partial (3) with bins in bin_nums that aren't in claimed_bins. A partial order may never become ready, so handle both. |
| 9. Open the bins | POST /users/{user_id}/orders/{order_id}/open-delivery | Open the bins in bin_nums that aren't in claimed_bins. Your customer collects the order. |
Account & Hubs
Check connectivity and that your key can reach a hub.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/integrations/ping?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | The assigned hub to check. |
Response
{
"success": true,
"data": {
"status": "ok",
"hub_id": 12
}
}
A successful ping confirms connectivity and key permission for that check. It doesn't confirm that payment or pickup are ready.
Return your account and the permissions on your API key. Call this first.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/integrations/me" \ --header "X-API-Key: vh_abc123..."
Response
{
"success": true,
"data": {
"user_id": 4821,
"key_prefix": "vh_AbCdEfGhI",
"key_name": "Northfield Market",
"scopes": [
"integrations:read",
"catalog:read",
"account-hubs:read",
"account-orders:read",
"account-orders:write",
"payments:read",
"payments:write",
"pickup:write"
],
"hub_ids": [12],
"expires_at": "2027-02-08T17:00:00Z"
}
}
Response Fields
| Field | Description |
|---|---|
user_id | Your account ID. Save it: it's the {user_id} in every /users/... path. |
scopes | Only the scopes this key was given. |
hub_ids | Only the hubs this key was given. |
expires_at | The key's expiry as an ISO 8601 timestamp, or null for a key that doesn't expire. Plan rotation before this date: after it, requests return 401 API_KEY_EXPIRED. |
Hubs your API key can use, with each hub's current status.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/integrations/hubs" \ --header "X-API-Key: vh_abc123..."
Response
{
"success": true,
"data": [
{
"id": 12,
"name": "Downtown LA",
"geojson_location": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
},
"country": "US",
"state": "CA",
"city": "Los Angeles",
"postal_code": "90012",
"street_address_1": "100 Main St",
"street_address_2": null,
"tax_rates": {
"sales_tax": 0.09,
"bottle_tax": 0.04
},
"timezone": "America/Los_Angeles",
"approximate_order_limit": 60,
"approximate_bin_opening_limit": 60,
"max_cart_items": 6,
"hub_status": "active",
"loyalty_program_enabled": true
}
]
}
Response Fields
| Field | Description |
|---|---|
hub_status | Only active hubs accept orders. Hidden, maintenance and restocking hubs don't. |
Current status of a hub: active, maintenance, restocking or hidden. Orders can only be created at active hubs.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/status" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": "active"
}
Catalog
quantity_in_basket is the quantity of that product in your account's shared cart at that hub. Items in carts created with external_reference are never counted: with 1 in the shared cart and 3 in cart NF-10042, the product shows quantity_in_basket: 1. To see a numbered cart's items, read the order. is_favorite is your account's favorites, not the cart. Every product also has deal_ids; it's always [] for VenCart, so you can ignore it.Products at a hub. Use the returned product IDs when building a cart.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/products" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category_id | Integer | Optional | Only products in this category. |
subcategory_id | Integer | Optional | Only products in this subcategory. |
product_name | String | Optional | Search text. |
page | Integer | Optional | Page number. Default 1. |
size | Integer | Optional | Items per page. Default 50, max 100. |
Response
{
"success": true,
"data": [
{
"name": "Trail Mix",
"image_url": null,
"upc": "0123456789012",
"original_price": 499,
"discounted_price": 399,
"quantity_in_stock": 12,
"max_per_order": -1,
"subcategory_id": 9002,
"category_id": 9003,
"hub_id": 12,
"is_favorite": false,
"id": 9004,
"description": null,
"subcategory": "General",
"category": "Snacks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": null,
"deal_ids": []
},
{
"name": "Sparkling Water 12oz",
"image_url": null,
"upc": "0123456789012",
"original_price": 199,
"discounted_price": null,
"quantity_in_stock": 40,
"max_per_order": -1,
"subcategory_id": 9005,
"category_id": 9006,
"hub_id": 12,
"is_favorite": false,
"id": 9007,
"description": null,
"subcategory": "General",
"category": "Drinks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": null,
"deal_ids": []
}
]
}
The response has no total. Request pages until one has fewer than size items. With product_name, it returns the top size matches only, and page, category_id and subcategory_id are ignored.
A hub's categories, each with its subcategories.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hub-categories?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": [
{
"name": "Drinks",
"category_image": "https://cdn.example.com/categories/drinks.png",
"order_by": 1,
"hub_id": 12,
"id": 9006,
"subcategories": [
{
"name": "General",
"subcategory_image": null,
"order_by": 1,
"category_id": 9006,
"id": 9005
}
],
"created_at": "2026-11-06T19:28:55.020942Z"
},
{
"name": "Snacks",
"category_image": "https://cdn.example.com/categories/drinks.png",
"order_by": 1,
"hub_id": 12,
"id": 9003,
"subcategories": [
{
"name": "General",
"subcategory_image": null,
"order_by": 1,
"category_id": 9003,
"id": 9002
}
],
"created_at": "2026-11-06T19:28:55.102816Z"
}
]
}
Subcategories of one category.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hub-categories/9006/subcategories" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category_id | Integer | Required | Category ID from GET /hub-categories. Its hub must be one of your key's hubs. |
Response
{
"success": true,
"data": [
{
"name": "General",
"subcategory_image": null,
"order_by": 1,
"category_id": 9006,
"id": 9005
}
]
}
One product, with similar_products at the same hub.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/products/9007" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
product_id | Integer | Required | Product ID at this hub. |
Response
{
"success": true,
"data": {
"name": "Sparkling Water 12oz",
"image_url": null,
"upc": "0123456789012",
"original_price": 199,
"discounted_price": null,
"quantity_in_stock": 40,
"max_per_order": -1,
"subcategory_id": 9005,
"category_id": 9006,
"hub_id": 12,
"is_favorite": false,
"id": 9007,
"description": null,
"subcategory": "General",
"category": "Drinks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": [],
"deal_ids": []
}
}
The hub's bestselling products, in rank order. Same product fields as the products list.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/bestsellers" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category_id | Integer | Optional | Only products in this category. |
page | Integer | Optional | Page number. Default 1. |
size | Integer | Optional | Items per page. Default 50, max 100. |
Response
{
"success": true,
"data": [
{
"name": "Sparkling Water 12oz",
"image_url": null,
"upc": "0123456789012",
"original_price": 199,
"discounted_price": null,
"quantity_in_stock": 100,
"max_per_order": -1,
"subcategory_id": 9009,
"category_id": 9010,
"hub_id": 12,
"is_favorite": false,
"id": 9011,
"description": null,
"subcategory": "General",
"category": "Drinks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": null,
"deal_ids": []
}
],
"metadata": {
"total": 1,
"page": 1,
"size": 50,
"pages": 1
}
}
Products with a discounted_price. Same product fields as the products list.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/discounted" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category_id | Integer | Optional | Only products in this category. |
page | Integer | Optional | Page number. Default 1. |
size | Integer | Optional | Items per page. Default 50, max 100. |
Response
{
"success": true,
"data": [
{
"name": "Trail Mix",
"image_url": null,
"upc": "0123456789012",
"original_price": 499,
"discounted_price": 399,
"quantity_in_stock": 100,
"max_per_order": -1,
"subcategory_id": 9012,
"category_id": 9013,
"hub_id": 12,
"is_favorite": false,
"id": 9014,
"description": null,
"subcategory": "General",
"category": "Snacks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": null,
"deal_ids": []
}
],
"metadata": {
"total": 1,
"page": 1,
"size": 50,
"pages": 1
}
}
Products often bought together with this product at this hub, in rank order. Not paged; empty when there's no purchase data.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/hubs/12/products/9007/also-like" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
product_id | Integer | Required | Product ID. |
Response
{
"success": true,
"data": [
{
"name": "Trail Mix",
"image_url": null,
"upc": "0123456789012",
"original_price": 499,
"discounted_price": 399,
"quantity_in_stock": 100,
"max_per_order": -1,
"subcategory_id": 9012,
"category_id": 9013,
"hub_id": 12,
"is_favorite": false,
"id": 9014,
"description": null,
"subcategory": "General",
"category": "Snacks",
"quantity_in_basket": 0,
"tax_type": "sales_tax",
"type": null,
"nutrition": null,
"tax_code": null,
"similar_products": null,
"deal_ids": []
}
]
}
Orders
Your account's orders at your key's hubs, including open carts (processing_status 0).
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/4821/orders" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_processing_statuses | Integer (repeatable) | Optional | Only these statuses, e.g. ?order_processing_statuses=1&order_processing_statuses=6. |
order_by | String | Optional | Sort field. Default created_at. |
is_desc | Boolean | Optional | Newest first when true. Default false. |
external_reference | String | Optional | Only the order with this order number. |
page | Integer | Optional | Page number. Default 1. |
size | Integer | Optional | Items per page. Default 50, max 100. |
Response
{
"success": true,
"data": [
{
"reference_number": "8AA54B1B34BE4061",
"total_order_item_count": 3,
"total_price_discounted": 797,
"total_price_original": 897,
"tax_amount": 72,
"refunded_amt": null,
"uncaptured_amt": null,
"payment_status": "pending",
"processing_status": 0,
"bin_nums": null,
"claimed_bins": null,
"bins_status": null,
"user_id": 4821,
"coupon_id": null,
"points_redeemed": null,
"id": 1,
"hub": {
"id": 12,
"name": "Downtown LA",
"geojson_location": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
},
"country": "US",
"state": "CA",
"city": "Los Angeles",
"postal_code": "90012",
"street_address_1": "100 Main St",
"street_address_2": null,
"tax_rates": null,
"timezone": "America/Los_Angeles",
"approximate_order_limit": 60,
"approximate_bin_opening_limit": 60,
"max_cart_items": 6,
"hub_status": "active",
"loyalty_program_enabled": false
},
"external_reference": null,
"created_at": "2026-11-06T19:28:56.779966Z",
"order_placed_at": "2026-11-06T19:28:56.781158Z",
"updated_at": "2026-11-06T19:28:57.221708Z",
"applied_deal": null
},
{
"reference_number": "FD8178F7BC8047C8",
"total_order_item_count": 3,
"total_price_discounted": null,
"total_price_original": 897,
"tax_amount": 0,
"refunded_amt": null,
"uncaptured_amt": null,
"payment_status": "uncaptured",
"processing_status": 6,
"bin_nums": null,
"claimed_bins": null,
"bins_status": null,
"user_id": 4821,
"coupon_id": null,
"points_redeemed": null,
"id": 2,
"hub": {
"id": 12,
"name": "Downtown LA",
"geojson_location": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
},
"country": "US",
"state": "CA",
"city": "Los Angeles",
"postal_code": "90012",
"street_address_1": "100 Main St",
"street_address_2": null,
"tax_rates": null,
"timezone": "America/Los_Angeles",
"approximate_order_limit": 60,
"approximate_bin_opening_limit": 60,
"max_cart_items": 6,
"hub_status": "active",
"loyalty_program_enabled": false
},
"external_reference": null,
"created_at": "2026-11-06T19:28:57.762329Z",
"order_placed_at": "2026-11-06T19:28:57.797508Z",
"updated_at": "2026-11-06T19:28:57.762329Z",
"applied_deal": null
}
],
"metadata": {
"total": 2,
"page": 1,
"size": 50,
"pages": 1
}
}
One order with its items, totals, fulfillment state and payment state. Poll this to track an order.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/4821/orders/2?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": {
"reference_number": "FD8178F7BC8047C8",
"total_order_item_count": 3,
"total_price_discounted": null,
"total_price_original": 897,
"tax_amount": 0,
"refunded_amt": null,
"uncaptured_amt": null,
"payment_status": "uncaptured",
"processing_status": 6,
"bin_nums": null,
"claimed_bins": null,
"bins_status": null,
"user_id": 4821,
"coupon_id": null,
"points_redeemed": null,
"id": 2,
"hub": {
"id": 12,
"name": "Downtown LA",
"geojson_location": {
"type": "Point",
"coordinates": [-118.2437, 34.0522]
},
"country": "US",
"state": "CA",
"city": "Los Angeles",
"postal_code": "90012",
"street_address_1": "100 Main St",
"street_address_2": null,
"tax_rates": null,
"timezone": "America/Los_Angeles",
"approximate_order_limit": 60,
"approximate_bin_opening_limit": 60,
"max_cart_items": 6,
"hub_status": "active",
"loyalty_program_enabled": false
},
"external_reference": null,
"created_at": "2026-11-06T19:28:57.762329Z",
"order_placed_at": "2026-11-06T19:28:57.797508Z",
"updated_at": "2026-11-06T19:28:57.762329Z",
"applied_deal": null,
"user_phone_num": null,
"order_payment_method": null,
"order_items": [
{
"quantity": 2,
"dropped_quantity": 0,
"refunded_quantity": 0,
"purchased_price_original": 199,
"purchased_price_discounted": null,
"id": 3,
"product": {
"id": 9007,
"name": "Sparkling Water 12oz",
"image_url": null,
"category_id": 9006,
"category": "Drinks",
"subcategory_id": 9005,
"subcategory": "General",
"max_per_order": -1,
"quantity_in_stock": 38
}
},
{
"quantity": 1,
"dropped_quantity": 0,
"refunded_quantity": 0,
"purchased_price_original": 499,
"purchased_price_discounted": null,
"id": 4,
"product": {
"id": 9004,
"name": "Trail Mix",
"image_url": null,
"category_id": 9003,
"category": "Snacks",
"subcategory_id": 9002,
"subcategory": "General",
"max_per_order": -1,
"quantity_in_stock": 11
}
}
],
"pickup_deadline": "2026-11-07T00:28:57.762329+00:00"
}
}
Response Fields
| Field | Description |
|---|---|
processing_status | Fulfillment state. See Order States. |
payment_status | Payment state, separate from fulfillment. See Payment States. |
bin_nums | Bins assigned to this order. |
claimed_bins | Bins already opened or recorded as dropped. The bins still to collect are the ones in bin_nums that aren't in claimed_bins. |
pickup_deadline | When the pickup window closes: five hours after the order's last update. Set only while the order is ready (6); null for every other status. |
total_price_original | Order total before discounts, in cents. |
total_price_discounted | Order total after discounts, in cents. null or 0 when nothing in the order is discounted. |
tax_amount | Tax, in cents. |
The order total before tax is total_price_discounted when it's greater than 0, otherwise total_price_original. Add tax_amount to that.
6), or partial (3) with bins in bin_nums that aren't in claimed_bins. A partial order may never move to 6, so don't wait only for ready. There are no webhooks or push notifications. Poll about every 30–60 seconds per active order, and keep the total within your key's rate limit.The order's place in the hub's queue of paid orders.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/4821/orders/3/queue-position?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": {
"order_id": 3,
"hub_id": 12,
"queue_position": 1,
"processing_status": 1
}
}
Items in your account's shared cart at a hub. It doesn't count carts created with external_reference; for those, read the order.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/4821/orders/order-items/count?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": {
"order_id": 1,
"order_item_count": 2,
"total_order_item_count": 3
}
}
Response Fields
| Field | Description |
|---|---|
order_item_count | Distinct products in the cart. |
total_order_item_count | Total units in the cart. |
Cart & Cancellation
Create a cart for one of your customers. Pass your own order number as external_reference to give each customer order its own cart.
Example Request
curl -X POST \ "https://api.venhub.com/api/v1/users/4821/orders?hub_id=12&external_reference=NF-10042" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
external_reference | String | Optional | Your own order number: 1–64 printable ASCII characters, no spaces. URL-encode it. |
Response
{
"success": true,
"data": {
"order_id": 9102
}
}
Keep the returned order_id for every later call on this order. Without external_reference, the response has the same shape and returns your account's shared cart at that hub. Calling it again returns the same order_id until that cart is paid. Retrying, or calling from two places at once, returns the same cart.
external_reference belongs to one order for the lifetime of your account. Repeating it returns the same order, even after payment. Using it at another hub returns 409 EXTERNAL_REFERENCE_IN_USE. Generate a new number for each new customer order. A cart with an order number can't be deleted; set its items to 0 instead.external_reference, there's one shared open cart per account and hub, and checkout waits for the previous order at that hub to finish. Don't use the shared cart for customers ordering at the same time. Use external_reference to give each customer order its own cart.
Set a product's quantity in an open cart. quantity: 0 removes it.
Example Request
curl -X PUT \ "https://api.venhub.com/api/v1/users/4821/orders/9003/order_item?hub_id=12" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"product_id": 9007, "quantity": 2}'
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
product_id | Integer | Required | Product ID at this hub. |
quantity | Integer | Required | The new total quantity, not an increment. Use 0 to remove the item. |
Response
{
"success": true,
"data": {
"product_id": 9007,
"quantity": 2
}
}
Errors
| Status | Key | When |
|---|---|---|
| 400 | IN_STOCK_PRODUCT_QUANTITY_LIMIT_EXCEEDED | Not enough stock. |
| 400 | PRODUCT_MAX_QUANTITY_LIMIT_EXCEEDED | More than the product's per-order limit. |
| 400 | EXCLUSIVE_PRODUCT_MAX_QUANTITY_LIMIT_EXCEEDED | An exclusive product is limited to quantity 1, and a cart can contain only one exclusive product. |
| 400 | ORDER_QUANTITY_LIMIT_EXCEEDED | More items than the hub's cart limit. |
| 400 | PRODUCT_QUANTITY_IS_ZERO | A new product was added with quantity 0. |
| 409 | HUB_NOT_ACCEPTING_ORDERS | The hub isn't active. |
Check that a cart is ready to pay. This needs account-orders:write because it refreshes the cart's timestamps, which also restarts the 30-minute cart timer.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/4821/orders/9003/checkout-available?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": {
"checkout_available": true
}
}
When the cart can't be paid yet, or the order is already paid or finished, the response is the same 200 with checkout_available: false. A cart created with external_reference doesn't wait for your other orders at the hub. Continue only when it's true, then read the order to confirm items and totals before paying. If it's false, re-read the order and fix its state rather than forcing payment.
Delete an unpaid cart (processing_status 0). To stop a paid order, cancel it instead.
Example Request
curl -X DELETE \ "https://api.venhub.com/api/v1/users/4821/orders/9003" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Response
{
"success": true
}
external_reference returns 409 NUMBERED_ORDER_DELETE_NOT_ALLOWED; set its items to 0 instead.Cancel a paid order and release its card hold.
Example Request
curl -X POST \ "https://api.venhub.com/api/v1/users/4821/orders/3/cancel?hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
Response
{
"success": true,
"data": {
"order_id": 3,
"processing_status": 7,
"payment_status": "canceled"
}
}
An order can be canceled only while it's pending or processing (processing_status 1 or 2), before any bin is opened or dropped, and while the card hold can still be released. Otherwise the call returns 409 ORDER_NOT_CANCELLABLE. A successful cancellation sets the order and payment to canceled and releases the hold. Products aren't returned to stock. Canceling an already canceled order returns it unchanged.
Copy every item of a past order into your account's shared cart at target_hub_id.
Example Request
curl -X POST \ "https://api.venhub.com/api/v1/users/4821/orders/9002/reorder?target_hub_id=12" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
source_order_id | Integer | Required | The order to copy. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
target_hub_id | Integer | Required | Hub of the cart to copy into. Your key needs access to both the source order's hub and this one. |
Response
{
"success": true,
"data": [
{
"id": 9007,
"name": "Sparkling Water 12oz",
"image_url": null,
"category_id": 9006,
"category": "Drinks",
"subcategory_id": 9005,
"subcategory": "General",
"max_per_order": -1,
"available_count": 1
},
{
"id": 9004,
"name": "Trail Mix",
"image_url": null,
"category_id": 9003,
"category": "Snacks",
"subcategory_id": 9002,
"subcategory": "General",
"max_per_order": -1,
"available_count": 0
}
]
}
Products are matched by UPC. Each quantity is capped at the stock available at target_hub_id, and copied quantities are added to what's already in the cart. The response lists the items that couldn't be copied in full, each with available_count (how many were copied). [] means everything was copied.
external_reference. The target hub must be active, otherwise it returns 409 HUB_NOT_ACCEPTING_ORDERS.Payments & Pickup
Cards saved on your account. Pay with a card's id.
Example Request
curl -X GET \ "https://api.venhub.com/api/v1/users/payments/methods" \ --header "X-API-Key: vh_abc123..."
Response
{
"success": true,
"data": [
{
"user_id": 4821,
"brand": "visa",
"last4": "4242",
"wallet": null,
"exp_month": 12,
"exp_year": 2030,
"is_disabled": false,
"is_default": true,
"id": 1,
"created_at": "2026-11-06T19:28:55.146328Z"
}
]
}
Response Fields
| Field | Description |
|---|---|
id | Card ID. Send it as payment_method_id to pay. |
user_id | Your account ID. |
brand | Card brand, e.g. visa. |
last4 | Last four digits. |
wallet | Wallet type, if any. null for saved cards. |
exp_month | Expiry month. |
exp_year | Expiry year. |
is_disabled | true if the card can't be used. |
is_default | true for the default card. |
created_at | When the card was saved (ISO 8601). |
Pay with an enabled card's id. If no usable card is returned, stop and contact VenHub to attach or replace one.
Place a hold on a saved card and send the order to the hub. Nothing is charged until the order is fulfilled.
Example Request
curl -X POST \ "https://api.venhub.com/api/v1/users/payments/pay" \ --header "X-API-Key: vh_abc123..." \ --header "Content-Type: application/json" \ --data '{"order_id": 9003, "payment_method_id": 1}'
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | Integer | Required | Your open cart's ID. |
payment_method_id | Integer | Required | A saved card's id from GET /users/payments/methods. A number or a string of digits. |
Response
{
"success": true
}
A 200 means the hold was placed and the order was sent to the hub; processing_status moves to 1 (pending). The final amount is charged after the order is fulfilled, and any unused hold is released. The response has no data: poll the order and check processing_status and payment_status. The order's hub must be on your key and active.
Errors
| Status | Key | When |
|---|---|---|
| 400 | DEALS_NOT_AVAILABLE | The request named deal_id or a non-empty deal_ids. Null or empty deal fields are accepted. |
| 400 | VENBUCKS_NOT_AVAILABLE | The request included venbucks_to_redeem. VenBucks can't be used with an API key. |
| 404 | - | The order isn't yours, or the card isn't one of your enabled cards. |
| 409 | HUB_NOT_ACCEPTING_ORDERS | The order's hub isn't active. |
Open the bins holding an order so your customer can collect it. An order can be collected when it has assigned bins and its processing_status is 2 (processing), 6 (ready) or 3 (partial). An order uses one or two bins. Only your account's orders at allowed hubs can be opened.
Example Request
curl -X POST \ "https://api.venhub.com/api/v1/users/4821/orders/9103/open-delivery?hub_id=12&bin_nums=3,7" \ --header "X-API-Key: vh_abc123..."
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Required | Your account ID, from GET /integrations/me. |
order_id | Integer | Required | Order ID. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hub_id | Integer | Required | Hub ID. Must be one of your key's hubs. |
bin_nums | String | Required | Comma-separated bin numbers from this order, e.g. 3,7. bin_num is also accepted for one bin. |
Which Bins to Open
Read the order first. The bins your customer can still collect are the ones in bin_nums that aren't in claimed_bins, since claimed_bins lists every bin already opened or recorded as dropped. For example, bin_nums: [3, 7] with claimed_bins: [3] leaves bin 7. This applies to processing (2), ready (6) and partial (3) orders alike.
Response
{
"success": true,
"data": {
"order_id": 9103,
"opened_bins": [3, 7],
"claimed_bins": [3, 7],
"processing_status": 4
}
}
Opening only some of the order's bins (bin_nums=3 on an order with bins 3 and 7):
{
"success": true,
"data": {
"order_id": 9104,
"opened_bins": [3],
"claimed_bins": [3],
"processing_status": 6
}
}
Response Fields
| Field | Description |
|---|---|
opened_bins | Bins opened by this call. |
claimed_bins | All bins opened (or recorded as dropped) for the order so far. |
processing_status | Keeps its previous status (2, 3 or 6) until every bin is resolved, then becomes 4 (completed). Confirm payment separately. |
Errors
| Status | Key | When |
|---|---|---|
| 400 | INVALID_BIN_NUMS | bin_nums is missing or invalid. |
| 404 | BIN_NOT_ON_ORDER | A requested bin isn't on this order. |
| 409 | BIN_ALREADY_OPENED | The bin has already been opened for this order. |
| 409 | ORDER_NOT_READY_FOR_PICKUP | The order isn't in a collectable state (2, 3 or 6 with assigned bins). Repeating pickup on a completed order can also return this. |
bin_nums that aren't already in claimed_bins. Repeated or simultaneous calls never open an already recorded bin again. After an uncertain response, read the order before retrying, and don't treat every 409 as success.Reference
Order States
processing_status tracks fulfillment:
| Value | Status | Meaning | What to do |
|---|---|---|---|
0 | new | Open cart, not paid. | A payment error can still need hold reconciliation. |
1 | pending | Paid (card on hold), waiting for the hub. | Poll both order and payment state. |
2 | processing | The hub is preparing it. | Keep polling. Once bins are assigned, it can already be collected. |
3 | partial | Partly fulfilled or refunded. | Can still be collected: open the bins in bin_nums that aren't in claimed_bins. A partial order may never become ready (6), so treat status 3 with unclaimed bins like ready. It keeps status 3 until every bin is resolved. Check items, bins and payment amounts. |
4 | completed | Picked up and charged. | Confirm payment separately. |
5 | failed | Payment or hub placement failed. | Don't retry payment automatically. |
6 | ready | Ready for pickup. | Open the bins in bin_nums that aren't in claimed_bins. Use the returned pickup_deadline. |
7 | canceled | Canceled, hold released. | If the result was uncertain, confirm the hold was released. |
8 | unknown | Unmatched state. | Contact VenHub. |
9 | unclaimed | Not picked up before the deadline. | Contact VenHub. |
Payment States
payment_status is separate from processing_status. Values include pending, uncaptured (authorized, not captured), success, partially_captured, canceled, failed, refund_pending, refunded and partially_refunded.
pending or uncaptured as final payment. Reconcile success and partial captures against the order amounts. For unexpected, blocked, disputed or unknown states, contact VenHub. Never charge again just because fulfillment polling is slow, and escalate inconsistent states instead of retrying.Cart & Pickup Timing
| Rule | Details |
|---|---|
| Idle cart items expire after 30 minutes | After 30 minutes without edits, a cart's items expire and reserved stock returns to the hub. A cart created with external_reference keeps its order_id and order number: retrieve the same order and add items again. Checking checkout on an eligible cart restarts the timer. |
| Pickup window is 5 hours | While an order is ready (6), order detail returns pickup_deadline: five hours after the order's last update. Use it rather than calculating it yourself. It's null for every other status. After it passes, the order can become UNCLAIMED. Your storefront tells the customer the deadline. |
Errors & Recovery
Use the HTTP status and error_message_key to decide what to do. Don't match on the human-readable error_message.
{
"success": false,
"error_message_key": "RATE_LIMIT_EXCEEDED",
"error_message": "Rate limit exceeded. Try again later."
}
| Status | Key | What to do |
|---|---|---|
| 400 | quantity limits | IN_STOCK_PRODUCT_QUANTITY_LIMIT_EXCEEDED, PRODUCT_MAX_QUANTITY_LIMIT_EXCEEDED, EXCLUSIVE_PRODUCT_MAX_QUANTITY_LIMIT_EXCEEDED, ORDER_QUANTITY_LIMIT_EXCEEDED, PRODUCT_QUANTITY_IS_ZERO. See set quantity. |
| 400 | DEALS_NOT_AVAILABLE / VENBUCKS_NOT_AVAILABLE | Remove deal and VenBucks fields from pay. |
| 400 | INVALID_BIN_NUMS | Send a non-empty, numeric list of this order's assigned bins. |
| 401 | INVALID_API_KEY | The key is missing, malformed, invalid or revoked. Check the X-API-Key header (not Authorization: Bearer) and your base URL. |
| 401 | API_KEY_EXPIRED | The key has passed its expires_at. Contact VenHub to rotate it; retrying won't help. |
| 403 | authorization | The key lacks the scope (for example API key missing required scope: account-orders:write), the hub isn't on your key, or the user_id isn't yours. Don't change IDs to get around restrictions. |
| 404 | resource | The resource doesn't exist or isn't yours, or doesn't belong to the hub in the URL. Another account's order, or paying with a card that isn't one of your enabled cards, returns 404. BIN_NOT_ON_ORDER means a requested bin isn't on this order. |
| 409 | HUB_NOT_ACCEPTING_ORDERS | The hub is in maintenance, restocking or hidden. You can't create a cart, change items, reorder or pay there until it's active. |
| 409 | ORDER_NOT_CANCELLABLE | Re-read the order's state. |
| 409 | BIN_ALREADY_OPENED | Reconcile the order's bins. |
| 409 | ORDER_NOT_READY_FOR_PICKUP | The order isn't in a collectable state. Wait, then check its state. |
| 409 | EXTERNAL_REFERENCE_IN_USE | Find the original order and hub for that number. |
| 409 | NUMBERED_ORDER_DELETE_NOT_ALLOWED | A cart with an order number can't be deleted. Set its items to 0 instead. |
| 422 | invalid parameters | Fix the request. Check the external_reference format, required fields and limits such as size (max 100). These return {"detail": [...]} instead of error_message_key. |
| 429 | RATE_LIMIT_EXCEEDED | Wait for the minute window to reset and reduce traffic. |
| 5xx | server error / timeout | Back off reads. For pay or pickup, check the order's state before any retry, and contact VenHub about uncertain payments. |
Retry Rules
| Operation | Retry? |
|---|---|
| Reads | Retry transient failures with exponential backoff and jitter, within the rate limit. |
| Create cart | Retry with the same external_reference, then re-read the returned order. It may already be paid or finished. |
| Set quantities | Retry only if your edits are serialized and the quantity is still the latest total you want. |
| Reorder | Don't retry blindly. Each call adds the quantities again. |
| Pay | Never retry automatically after an error or uncertain result. Have VenHub reconcile the payment first. |
| Cancel | Safe to repeat: an already canceled order is returned unchanged. For uncertain results, re-read the order and have VenHub confirm the hold was released. |
| Open bins | After an uncertain response, check claimed_bins and the remaining bins. Don't treat every 409 as success, and don't open again just because a response was lost. |
Rate Limits
Each key gets 60 requests per minute by default, shared across all your servers and endpoints. On 429 RATE_LIMIT_EXCEEDED, pause until the fixed one-minute window resets, then back off if needed. Don't burst retries. Agree higher limits with VenHub before increasing traffic.
Key Rotation & Card Replacement
Keys last 90 days unless VenHub specifies otherwise. Check expires_at and arrange rotation with VenHub before it passes; an expired key returns 401 API_KEY_EXPIRED. Rotating revokes the old key immediately, with no overlap, so agree when to update your server's secret and verify the new key before resuming traffic. Rotation keeps your account, hubs and scopes, so you don't need new carts or a new saved card.
If your card expires or is declined, stop paying and contact VenHub to replace it on the same account. Never send card details or a processor ID through the API.
Before You Go Live
Complete these with VenHub before serving real customers:
| Check | Details |
|---|---|
| Setup | Your base URL, enabled endpoints, card onboarding, and support and escalation contacts. |
| Access control | Invalid, expired and revoked keys, missing scopes, unassigned hubs, and other accounts' orders and cards are all rejected. |
| Separate carts | Concurrent cart creation and retries don't mix items or duplicate orders. |
| Full purchase | A test order goes through hub fulfillment, final capture and customer pickup, and cancellation releases its hold. |
| Recovery | Payment failures, uncertain pickup responses and delayed or repeated hub events are handled. |
| Operations | Rate limits, key expiry and rotation, and an explicit launch approval. A demo run alone doesn't count. |
Getting Help
Use the support channel your VenHub integration contact gave you. Include the environment, UTC time, method and path, order ID, external_reference, hub ID, HTTP status and error_message_key. Remove keys, card details and your customers' personal information.
Not Included
The VenCart API doesn't cover deals, VenBucks, wallet, profile editing, favorites or the notification inbox. Card setup and replacement are handled by VenHub. Direct card management, Apple Pay and Google Pay, callbacks to your servers and hub-wide bin controls aren't part of VenCart.