Home › Docs › Promotions API

Promotions API

Endpoints for managing promotional banners and deals. Banners display in the hub's customer-facing interface. Deals combine triggers, rewards and constraints, and are checked and calculated against a cart at checkout. See How Deals Work.

Banners

GET /owner/banners

List promotional banners configured for a hub.

Version1
URLhttps://tina-api.venhub.com/api/v1/owners/owner/banners
AuthAPI Key or Firebase
Required Scopepromotions:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/owners/owner/banners?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_idIntegerQueryRequiredHub ID to retrieve banners for

Response

JSON - 200 OK
[
  {
    "id": 1,
    "name": "Summer Sale",
    "image_url": "https://storage.example.com/banners/summer.jpg",
    "order_by": 1
  },
  {
    "id": 2,
    "name": "New Products",
    "image_url": "https://storage.example.com/banners/new.jpg",
    "order_by": 2
  }
]
POST /owner/banners

Create a new promotional banner with image upload.

Version1
URLhttps://tina-api.venhub.com/api/v1/owners/owner/banners
AuthAPI Key or Firebase
Required Scopepromotions:write
ℹ️
This endpoint uses multipart/form-data for file upload. Include the hub_id as a query parameter.

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/owners/owner/banners?hub_id=123" \
  --header "X-API-Key: vh_abc123..." \
  --form 'name=Summer Sale' \
  --form 'order_by=1' \
  --form '[email protected]'

Parameters

ParameterTypeLocationRequiredDescription
hub_idIntegerQueryRequiredHub ID to create the banner for
nameStringFormRequiredBanner display name
order_byIntegerFormRequiredDisplay order position
fileFileFormRequiredBanner image file

Response

JSON - 200 OK
{
  "id": 3,
  "name": "Summer Sale",
  "image_url": "https://storage.example.com/banners/abc123.jpg",
  "order_by": 1
}
DELETE /owner/banners/{banner_id}

Delete a promotional banner from the hub.

Version1
URLhttps://tina-api.venhub.com/api/v1/owners/owner/banners/{banner_id}
AuthAPI Key or Firebase
Required Scopepromotions:write

Example Request

cURL
curl -X DELETE \
  "https://tina-api.venhub.com/api/v1/owners/owner/banners/3?hub_id=123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
banner_idIntegerPathRequiredID of the banner to delete
hub_idIntegerQueryRequiredHub ID the banner belongs to

Response

ℹ️
200 OK with an empty body. This endpoint doesn't return {success: true} or any other JSON, so check the status code to confirm the delete succeeded.

Deals

How Deals Work

A deal is made up of one or more triggers (what activates it), one or more rewards (what the customer gets), and optional constraints (limits on redemption). When a cart meets all of a deal's triggers and constraints, the deal is eligible and its reward can be calculated against the cart. Each is passed as an object in the triggers, rewards and constraints arrays when you create a deal. See Trigger, Reward and Constraint Objects for their fields.

ℹ️
Deals can also be created and managed in TINA, the VenHub dashboard. Use Quick Deal for simple discounts or New Promotion for full campaigns. TINA also suggests deals for expiring and overstocked items. Deals created in TINA and through the API are the same objects and are returned by the same endpoints.

Pricing

Each product has a retail price and a purchase (cost) price, both integers in cents. Deals discount from the retail price. Set them with update_price and update_purchase_price. Because both prices are tracked, the Analytics API can report revenue, cost and profit, including the effect of discounts.

Trigger Types

Triggers define what activates a deal. Set the type with the trigger's trigger_type field. The fields column lists what each type reads.

TypeActivates whenFieldsExample
CARTVALThe cart total is at least min_val_trigger centsmin_val_triggerSpend $10 or more to unlock the deal
CONTAINSITEMThe cart has at least min_val_trigger units across the listed productsmin_val_trigger, product_idBuy 3 energy drinks
CONTAINSCATThe cart has at least min_val_trigger units across the listed subcategoriesmin_val_trigger, subcategory_idBuy 2 items from Chips
FIRSTORDERIt's the customer's first order-Welcome discount for new customers
NTHORDERIt's the customer's nth_orderth ordernth_order10% off your 5th purchase
TIMEThe order falls inside the daily time window on one of the listed daystime_window_start, time_window_end, days_of_the_weekHappy hour pricing, weekend flash sales
⚠️
CONTAINSCAT matches on subcategory_id only. When you create a deal with POST /deals/, pass the subcategories in subcategory_id. A trigger with only category_id is accepted but never qualifies. /deals/create_from_owner expands categories into their subcategories for you.
⚠️
BDAY and REFERRAL aren't implemented yet. Both trigger types are accepted but currently treat every cart as eligible, so don't use them in live deals.

Reward Types

Rewards define what the customer receives. Set the type with reward_type and the amount with discount_pct_or_price, whose meaning depends on the type.

TypeEffectdiscount_pct_or_priceExample
ITEMVALFixed amount off one matching unitCents off$0.50 off one water bottle
MULTVALFixed amount off every matching unitCents off each unit$0.50 off every energy drink
ITEMDISCPercentage off one matching unitPercent15% off one candy bar; 100 makes it free
MULTDISCPercentage off every matching unitPercent20% off all snacks
CARTDISCPercentage off the cart totalPercent10% off the entire order
CARTVALSets the cart total to a fixed amountFinal total in centsYour whole cart for $10.00
ℹ️
Rewards have no quantity field. ITEMVAL and ITEMDISC apply to one matching unit per checkout, and MULTVAL and MULTDISC apply to every matching unit. Discounting a set number of units, such as exactly two, isn't supported. A discount_pct_or_price of 0 is skipped, so use ITEMDISC at 100 for a free item.

Constraint Types

Constraints limit how often a deal can be redeemed. Set the type with constraint_type.

TypeEffectFieldsExample
REDEMPTIONSLimits each customer to redemption_limit paid orders with this deal within a rolling period of days. Omit period for a lifetime limit.redemption_limit, periodMax 1 use per customer per day: redemption_limit: 1, period: 1
SALEAMTEnds the deal after redemption_limit paid orders have used it, counted across all customers and every hub the deal is assigned toredemption_limitDeal ends after the first 100 orders
ℹ️
SALEAMT counts paid orders that used the deal, not units sold. It has no per-hub setting. To give each hub its own limit, create a separate deal for each hub.

Deal Properties

Alongside its triggers, rewards and constraints, every deal has:

FieldDescription
nameDisplay name for the deal
hub_idThe hubs the deal runs at, as an array of hub IDs
start / endWhen the deal becomes active and when it expires. Both are required.
stackableWhether this deal is meant to combine with other deals. Returned by check_eligibility for you to act on; not enforced when rewards are calculated
priorityHigher numbers sort first in active and eligible deal lists; ties sort newest first. Not enforced when rewards are calculated

Common Deal Recipes

Combine triggers, rewards and constraints to build common promotions:

PromotionTriggerRewardConstraint
Buy one, get oneCONTAINSCAT (2 from a subcategory)ITEMDISC at 100 on the same subcategory-
Flash saleTIME (set hours and days)MULTDISC (% off a category)-
Holiday saleTIME, with the deal's start and end set to the holidayCARTDISC (% off cart)-
Expiring stockCONTAINSITEM (the expiring product)ITEMDISC on the same productSALEAMT set to the units on hand (one discounted unit per order)
Free gift over a spendCARTVAL ($15+)ITEMDISC at 100 on the gift product-
Free gift with a purchaseCONTAINSCAT (e.g. 1 from Chips)ITEMDISC at 100 on the gift product-
Spend-and-saveCARTVAL ($50+)CARTDISC (20% off)-
New customer welcomeFIRSTORDERCARTDISC (15% off)-
Loyalty milestoneNTHORDER (10th order)CARTDISC-
ℹ️
For a free gift, the gift product must already be in the cart. The reward discounts it; it doesn't add it.

Deals at Checkout

Deals are evaluated server-side against the customer's cart. Checking eligibility and calculating a reward are two separate calls, so you choose which deals to show and use:

StepEndpointWhat happens
1. PreviewPOST /deals/check_eligibilityReturns the active deals the cart qualifies for and each deal's potential_savings. Nothing is applied yet.
2. CalculatePOST /deals/apply_rewardCalculates the chosen deals against the cart and returns the discounted line items and cart total. Nothing is saved.
3. PayYour checkout flowThe order is placed with the selected deal. VenHub recalculates the discount and stores it on the order, and the redemption counts once the order's payment succeeds.
4. TrackGET /deals/{deal_id}/redemption_statusReturns a deal's aggregate redemption count and limit status.
ℹ️
apply_reward is calculation-only and records nothing. Redemptions are counted from successfully paid orders, not from apply_reward calls. It doesn't save the deal against the order, and it doesn't re-check eligibility, stackable or priority. It calculates whichever deal_ids you send. Pass only deals that check_eligibility returned, and decide yourself which ones to combine.
ℹ️
Deals can only match what you send with the cart. Include subcategory_id on each cart item so CONTAINSCAT deals can match, and pass user_order_count so FIRSTORDER and NTHORDER deals can be evaluated.

Deal Endpoints

GET /deals/active/{hub_id}

Get currently active deals for a hub, sorted by priority (highest first, then newest).

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/active/{hub_id}
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/deals/active/123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_idIntegerPathRequiredHub ID to retrieve active deals for

Response

JSON - 200 OK
[
  {
    "id": 1,
    "name": "Buy 2 Get 1 Free",
    "description": "Buy any 2 bags of chips, get a third free",
    "display_text": "Buy any 2 bags of chips, get 1 free!",
    "display_image": "https://storage.example.com/deals/bogo.jpg",
    "priority": 1
  }
]
GET /deals/{deal_id}

Get detailed information about a specific deal.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/{deal_id}
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/deals/1" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
deal_idIntegerPathRequiredID of the deal to retrieve

Response

ℹ️
Same fields as the create body, plus id, created_at and modified_at on the deal and an id on every trigger, reward and constraint.
JSON - 200 OK
{
  "id": 1,
  "name": "Buy 2 Get 1 Free",
  "description": "Buy any 2 bags of chips, get a third free",
  "hub_id": [123],
  "is_deal_active": true,
  "start": "2027-01-01T00:00:00Z",
  "end": "2027-01-31T23:59:59Z",
  "stackable": false,
  "priority": 1,
  "created_at": "2026-11-02T09:12:00Z",
  "modified_at": "2026-11-02T09:12:00Z",
  "triggers": [
    { "id": 10, "name": "3 bags of chips in cart", "trigger_type": "CONTAINSCAT", "min_val_trigger": 3, "subcategory_id": [52] }
  ],
  "rewards": [
    { "id": 11, "name": "1 free bag of chips", "reward_type": "ITEMDISC", "discount_pct_or_price": 100, "subcategory_id": [52] }
  ],
  "constraints": [
    { "id": 12, "name": "1 per customer per day", "constraint_type": "REDEMPTIONS", "redemption_limit": 1, "period": 1 }
  ]
}
GET /deals/hub/{hub_id}

Get all deals (active and inactive) for a hub. Returns an array of deal objects in the same shape as GET /deals/{deal_id}.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/hub/{hub_id}
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/deals/hub/123" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
hub_idIntegerPathRequiredHub ID to retrieve all deals for

Response

JSON - 200 OK
[
  {
    "id": 1,
    "name": "Buy 2 Get 1 Free",
    "description": "Buy any 2 bags of chips, get a third free",
    "hub_id": [123],
    "is_deal_active": true,
    "start": "2027-01-01T00:00:00Z",
    "end": "2027-01-31T23:59:59Z",
    "stackable": false,
    "priority": 1,
    "created_at": "2026-11-02T09:12:00Z",
    "modified_at": "2026-11-02T09:12:00Z",
    "triggers": [
      { "id": 10, "name": "3 bags of chips in cart", "trigger_type": "CONTAINSCAT", "min_val_trigger": 3, "subcategory_id": [52] }
    ],
    "rewards": [
      { "id": 11, "name": "1 free bag of chips", "reward_type": "ITEMDISC", "discount_pct_or_price": 100, "subcategory_id": [52] }
    ],
    "constraints": [
      { "id": 12, "name": "1 per customer per day", "constraint_type": "REDEMPTIONS", "redemption_limit": 1, "period": 1 }
    ]
  }
]
POST /deals/create_from_owner

Create a new promotional deal, with an optional banner image upload.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/create_from_owner
AuthAPI Key or Firebase
Required Scopedeals:write
ℹ️
Deal configuration is passed as a JSON-encoded string in the dealData field, with a single trigger and reward. In this endpoint, category_id and subcategory_id accept IDs or names, and categories are expanded into their subcategories automatically.

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/deals/create_from_owner" \
  --header "X-API-Key: vh_abc123..." \
  --form 'dealData={"deal":{"name":"Chips Week","hub_id":[123],"start":"2027-01-01T00:00:00Z","end":"2027-01-07T23:59:59Z"},"trigger":{"name":"2+ bags of chips in cart","trigger_type":"CONTAINSCAT","min_val_trigger":2,"category_id":["Chips"]},"reward":{"name":"20% off chips","reward_type":"MULTDISC","discount_pct_or_price":20,"category_id":["Chips"]},"constraints":[]}' \
  --form '[email protected]'

Parameters

ParameterTypeLocationRequiredDescription
dealDataJSON StringFormRequiredJSON-encoded deal configuration
fileFileFormOptionalBanner image for the deal

dealData Fields

FieldTypeRequiredDescription
deal.nameStringRequiredDisplay name for the deal
deal.hub_idArray<Integer>RequiredHubs the deal runs at
deal.descriptionStringOptionalInternal description
deal.startTimestampRequiredWhen the deal becomes active (ISO 8601, UTC)
deal.endTimestampRequiredWhen the deal expires (ISO 8601, UTC)
deal.stackableBooleanOptionalWhether the deal is meant to combine with other deals. Informational; not enforced
deal.priorityIntegerOptionalHigher numbers sort first in active and eligible deal lists; ties sort newest first
triggerObjectRequiredA single trigger object
rewardObjectRequiredA single reward object
constraintsArrayOptionalConstraint objects

Response

JSON - 200 OK
{
  "id": 3,
  "name": "Summer Sale",
  "is_deal_active": true,
  "display_image": "https://storage.example.com/deals/abc123.jpg"
}
PUT /deals/{deal_id}

Update an existing deal's configuration.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/{deal_id}
AuthAPI Key or Firebase
Required Scopedeals:write

Example Request

cURL
curl -X PUT \
  "https://tina-api.venhub.com/api/v1/deals/1" \
  --header "X-API-Key: vh_abc123..." \
  --header "Content-Type: application/json" \
  --data '{"name": "Updated Deal Name", "is_deal_active": false}'

Parameters

ParameterTypeLocationRequiredDescription
deal_idIntegerPathRequiredID of the deal to update
nameStringBodyOptionalUpdated display name for the deal
is_deal_activeBooleanBodyOptionalEnable or disable the deal
startTimestampBodyOptionalUpdated start (ISO 8601, UTC)
endTimestampBodyOptionalUpdated end (ISO 8601, UTC)
stackableBooleanBodyOptionalWhether the deal is meant to combine with other deals. Informational; not enforced
priorityIntegerBodyOptionalHigher numbers sort first in active and eligible deal lists; ties sort newest first

Response

JSON - 200 OK
{
  "id": 1,
  "name": "Updated Deal Name",
  "description": "Buy any 2 bags of chips, get a third free",
  "hub_id": [123],
  "is_deal_active": false,
  "start": "2027-01-01T00:00:00Z",
  "end": "2027-01-31T23:59:59Z",
  "stackable": false,
  "priority": 1,
  "created_at": "2026-11-02T09:12:00Z",
  "modified_at": "2026-11-02T09:12:00Z",
  "triggers": [
    { "id": 10, "name": "3 bags of chips in cart", "trigger_type": "CONTAINSCAT", "min_val_trigger": 3, "subcategory_id": [52] }
  ],
  "rewards": [
    { "id": 11, "name": "1 free bag of chips", "reward_type": "ITEMDISC", "discount_pct_or_price": 100, "subcategory_id": [52] }
  ],
  "constraints": [
    { "id": 12, "name": "1 per customer per day", "constraint_type": "REDEMPTIONS", "redemption_limit": 1, "period": 1 }
  ]
}
DELETE /deals/{deal_id}

Delete a deal and all associated triggers and rewards.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/{deal_id}
AuthAPI Key or Firebase
Required Scopedeals:write

Example Request

cURL
curl -X DELETE \
  "https://tina-api.venhub.com/api/v1/deals/1" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
deal_idIntegerPathRequiredID of the deal to delete

Response

JSON - 200 OK
{
  "success": true,
  "message": "Deal 1 deleted successfully"
}

Errors

Error CodeDescription
deal_not_foundThe specified deal does not exist

Additional Deal Routes

POST /deals/

Create a deal directly with a JSON body, as an alternative to /deals/create_from_owner's multipart form. Unlike create_from_owner, it accepts several triggers and rewards, but doesn't expand categories into subcategories.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/
AuthAPI Key or Firebase
Required Scopedeals:write

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/deals/" \
  --header "X-API-Key: vh_abc123..." \
  --header "Content-Type: application/json" \
  --data '{"name":"Buy 2 Get 1 Free","hub_id":[123],"description":"Buy any 2 bags of chips, get a third free","start":"2027-01-01T00:00:00Z","end":"2027-01-31T23:59:59Z","stackable":false,"priority":1,"triggers":[{"name":"3 bags of chips in cart","trigger_type":"CONTAINSCAT","min_val_trigger":3,"subcategory_id":[52]}],"rewards":[{"name":"1 free bag of chips","reward_type":"ITEMDISC","discount_pct_or_price":100,"subcategory_id":[52]}],"constraints":[{"name":"1 per customer per day","constraint_type":"REDEMPTIONS","redemption_limit":1,"period":1}]}'

Body

FieldTypeRequiredDescription
nameStringRequiredDisplay name for the deal
hub_idArray<Integer>RequiredHubs the deal runs at
descriptionStringOptionalInternal description
startTimestampRequiredWhen the deal becomes active (ISO 8601, UTC)
endTimestampRequiredWhen the deal expires (ISO 8601, UTC)
stackableBooleanOptionalWhether the deal is meant to combine with other deals. Informational; not enforced
priorityIntegerOptionalHigher numbers sort first in active and eligible deal lists; ties sort newest first
triggersArrayRequiredOne or more trigger objects
rewardsArrayRequiredOne or more reward objects
constraintsArrayOptionalConstraint objects

Trigger Object

FieldTypeRequiredDescription
nameStringRequiredName for the trigger
trigger_typeStringRequiredOne of the trigger types
min_val_triggerIntegerOptionalThreshold: cart total in cents for CARTVAL, minimum quantity for CONTAINSITEM and CONTAINSCAT
product_idArray<Integer>OptionalProducts to match, for CONTAINSITEM
subcategory_idArray<Integer>OptionalSubcategories to match, for CONTAINSCAT
category_idArray<Integer>OptionalAccepted but not checked at checkout. Use subcategory_id for CONTAINSCAT
nth_orderIntegerOptionalOrder number that activates NTHORDER
time_window_startTimeOptionalStart of the daily window, for TIME
time_window_endTimeOptionalEnd of the daily window, for TIME
days_of_the_weekArrayOptionalDays the window applies, for TIME

Reward Object

FieldTypeRequiredDescription
nameStringRequiredName for the reward
reward_typeStringRequiredOne of the reward types
discount_pct_or_priceIntegerRequiredPercent for ITEMDISC, MULTDISC and CARTDISC; cents off for ITEMVAL and MULTVAL; final cart total in cents for CARTVAL. 0 is skipped
product_idArray<Integer>OptionalProducts the reward applies to
category_idArray<Integer>OptionalCategories the reward applies to
subcategory_idArray<Integer>OptionalSubcategories the reward applies to

Constraint Object

FieldTypeRequiredDescription
nameStringRequiredName for the constraint
constraint_typeStringRequiredOne of the constraint types
redemption_limitIntegerRequiredUses per customer for REDEMPTIONS; total orders for SALEAMT
periodIntegerOptionalRolling window in days, for REDEMPTIONS. Omit for a lifetime limit

Response

JSON - 200 OK
{
  "id": 4,
  "name": "Buy 2 Get 1 Free",
  "description": "Buy any 2 bags of chips, get a third free",
  "hub_id": [123],
  "is_deal_active": true,
  "start": "2027-01-01T00:00:00Z",
  "end": "2027-01-31T23:59:59Z",
  "stackable": false,
  "priority": 1,
  "created_at": "2026-11-02T09:12:00Z",
  "modified_at": "2026-11-02T09:12:00Z",
  "triggers": [
    { "id": 13, "name": "3 bags of chips in cart", "trigger_type": "CONTAINSCAT", "min_val_trigger": 3, "subcategory_id": [52] }
  ],
  "rewards": [
    { "id": 14, "name": "1 free bag of chips", "reward_type": "ITEMDISC", "discount_pct_or_price": 100, "subcategory_id": [52] }
  ],
  "constraints": [
    { "id": 15, "name": "1 per customer per day", "constraint_type": "REDEMPTIONS", "redemption_limit": 1, "period": 1 }
  ]
}
POST /deals/check_eligibility

Check which active deals a cart qualifies for, before applying any reward.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/check_eligibility
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/deals/check_eligibility" \
  --header "X-API-Key: vh_abc123..." \
  --header "Content-Type: application/json" \
  --data '{"hub_id":123,"cart_items":[{"product_id":456,"category_id":14,"subcategory_id":52,"quantity":3,"unit_price":299}],"cart_total":897}'

Body

FieldTypeRequiredDescription
hub_idIntegerRequiredHub the cart belongs to
user_idIntegerOptionalCustomer placing the order
cart_itemsArrayRequiredEach item: product_id, category_id (optional), subcategory_id (optional, but needed for CONTAINSCAT deals to match), quantity, unit_price
cart_totalIntegerRequiredCart total in cents
user_order_countIntegerOptionalCustomer's prior order count, for first-time-buyer style deals
device_uuidStringOptionalDevice identifier

Response

JSON - 200 OK
{
  "eligible_deals": [
    {
      "deal_id": 1,
      "deal_name": "Buy 2 Get 1 Free",
      "description": "Buy any 2 bags of chips, get a third free",
      "display_text": "Buy any 2 bags of chips, get 1 free!",
      "reward_description": "1 free item",
      "potential_savings": 299,
      "start": "2027-01-01T00:00:00Z",
      "end": "2027-01-31T23:59:59Z",
      "stackable": false
    }
  ]
}
ℹ️
description and display_text are optional and may be absent. This is a preview only. Results are sorted by priority, highest first; stackable is returned so you can decide which deals to combine. Use apply_reward to calculate the discounted cart.
POST /deals/apply_reward

Calculate one or more deals' rewards against a cart and return the discounted result. This is a preview: nothing is saved, and eligibility, stackable and priority aren't re-checked. Call check_eligibility first and send only deals it returned.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/apply_reward
AuthAPI Key or Firebase
Required Scopedeals:write

Example Request

cURL
curl -X POST \
  "https://tina-api.venhub.com/api/v1/deals/apply_reward" \
  --header "X-API-Key: vh_abc123..." \
  --header "Content-Type: application/json" \
  --data '{"deal_ids":[1],"hub_id":123,"cart_items":[{"product_id":456,"category_id":14,"subcategory_id":52,"quantity":3,"unit_price":299}]}'

Body

FieldTypeRequiredDescription
deal_idsArray<Integer>RequiredDeals to calculate. Not re-checked for eligibility or stacking
hub_idIntegerRequiredHub the cart belongs to
user_idIntegerOptionalCustomer placing the order
cart_itemsArrayRequiredSame shape as check_eligibility's cart_items
device_uuidStringOptionalDevice identifier

Response

ℹ️
deal_applied is a string naming the deals that were calculated. On each item, discount_applied is a boolean.
JSON - 200 OK
{
  "success": true,
  "deal_applied": "Buy 2 Get 1 Free",
  "modified_cart_items": [
    {
      "product_id": 456,
      "category_id": 14,
      "subcategory_id": 52,
      "quantity": 3,
      "original_unit_price": 299,
      "discounted_unit_price": 0,
      "discount_applied": true,
      "quantity_discounted": 1
    }
  ],
  "original_cart_total": 897,
  "discounted_cart_total": 598,
  "total_savings": 299,
  "message": "Deal applied successfully"
}
GET /deals/{deal_id}/redemption_status

Get aggregate redemption status for a specific deal. This is a summary, not a per-redemption history.

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/{deal_id}/redemption_status
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/deals/123/redemption_status" \
  --header "X-API-Key: vh_abc123..."

Parameters

ParameterTypeLocationRequiredDescription
deal_idIntegerPathRequiredID of the deal to check

Response

JSON - 200 OK
{
  "deal_id": 123,
  "deal_name": "Buy 2 Get 1 Free",
  "total_redemptions": 42,
  "redemption_limit": 100,
  "limit_reached": false,
  "is_active": true
}
ℹ️
total_redemptions counts successfully paid orders that used the deal. redemption_limit comes from the deal's SALEAMT constraint and is null when it has none. is_active reflects the deal's stored is_deal_active flag only; it doesn't check whether the current time is between start and end.
GET /deals/promo_products/{hub_id}

List product IDs currently attached to any active deal for a hub (union of every reward and trigger product ID across the hub's active deals).

Version1
URLhttps://tina-api.venhub.com/api/v1/deals/promo_products/{hub_id}
AuthAPI Key or Firebase
Required Scopedeals:read

Example Request

cURL
curl -X GET \
  "https://tina-api.venhub.com/api/v1/deals/promo_products/123" \
  --header "X-API-Key: vh_abc123..."

Response

JSON - 200 OK
[456, 789]