Skip to main content
GET
/
v1
/
prices
/
products
/
{id}
Get single product pricing with dynamic pricing and multi-currency support
curl --request GET \
  --url https://api.tybritelabs.com/v1/prices/products/{id} \
  --header 'Authorization: Bearer <token>'
{
  "product_id": "9b2bb0c5-666d-4729-a59d-2526ec38add9",
  "name": "Apple MacBook Pro",
  "sku": "APP-MBP-13",
  "description": "13-inch MacBook Pro with M2 chip",
  "brand": "Apple",
  "stock": 39,
  "has_variants": false,
  "base_price": 189999,
  "base_currency": "EUR",
  "resolved_price": 174799.08,
  "display_price": 152105.09,
  "display_currency": "GBP",
  "currency_symbol": "£",
  "exchange_rate": 0.870171,
  "price_breakdown": {
    "base_price": 189999,
    "discounts": [
      {
        "rule_id": "ff70de41-8af4-4578-817b-54413db314cd",
        "rule_name": "United Kingdom",
        "type": "percentage",
        "value": 8,
        "amount": 15199.92
      }
    ],
    "final_price": 174799.08,
    "currency_conversion": {
      "from_currency": "EUR",
      "to_currency": "GBP",
      "rate": 0.870171,
      "converted_amount": 152105.09
    }
  },
  "pricing_context": {
    "location": null,
    "region": "United Kingdom",
    "customer_segment": null,
    "customer_tier": null,
    "quantity": 1,
    "currency": "GBP",
    "exchange_rate": 0.870171
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.tybritelabs.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API Key Authentication

Use your API key in the Authorization header:

Authorization: Bearer tybrite_sk_live_YOUR_KEY

Key Types:

Secret Keys (Server-Side Only):

  • Format: tybrite_sk_live_* (production) or tybrite_sk_test_* (sandbox)
  • Full read/write access to all endpoints
  • ⚠️ NEVER expose in client-side code or public repositories
  • Required for: write operations, authentication, payment verification, AI recommendations

Publishable Keys (Client-Safe):

  • Format: tybrite_pk_live_* (production) or tybrite_pk_test_* (sandbox)
  • Read-only access (GET requests only, plus POST semantic search)
  • ✅ Safe for client-side JavaScript, mobile apps, and public code
  • Allowed for: browsing products, search, CMS content, pricing queries

Endpoint-Specific Requirements:

  • Authentication endpoints (/v1/auth/*): Secret key required
  • Payment verification (POST /v1/payments/verify): Secret key required
  • AI Recommendations (POST /v1/recommendations): Secret key required
  • Semantic Search (POST /v1/search): Both key types allowed (read-only operation)
  • All write operations: Secret key required
  • All read operations: Both key types allowed

Using a publishable key for restricted operations returns 403 Forbidden.

Path Parameters

id
string<uuid>
required

Product UUID or variant UUID

Query Parameters

fields
string

Comma-separated list of fields to return (reduces bandwidth by up to 55%).

Root-level fields: product_id, name, brand, description, total_stock, price_range, has_variants, variant_count, base_currency, display_currency, currency_symbol, exchange_rate

Variant fields (use dot notation): variants.variant_id, variants.sku, variants.display_price, variants.stock, variants.variant_attributes, variants.price_breakdown, variants.price_breakdown.*

Example (35% reduction): fields=product_id,name,brand,total_stock,price_range,variants

Example (55% reduction): fields=name,price_range,variants.sku,variants.display_price,variants.stock

place_name
string

City or region name for geographic currency detection.

Works with variants: All variant prices converted to detected currency.

Examples:

  • place_name=New York → USD
  • place_name=London, UK → GBP
  • place_name=Nairobi, Kenya → KES
latitude
number<double>

Customer latitude for precise currency detection (use with longitude).

Works with variants: All variant prices converted based on detected region.

longitude
number<double>

Customer longitude for precise currency detection (use with latitude)

location
string

DEPRECATED: Use place_name instead.

Location/country for location-based pricing

region
string

Manual region override for pricing rules

customer_id
string<uuid>

Customer UUID for personalized pricing.

When provided, the worker resolves the customer's RFM segment and tier server-side (from the customers + customer_stores tables) and feeds them into pricing rule evaluation. There is no need to pass segment/tier directly.

quantity
integer

Quantity for volume-based pricing

Required range: x >= 1

Response

Successfully retrieved product with dynamic pricing and currency conversion.

Response Structure:

  • Simple products: Flat structure with pricing at root
  • Multi-variant products: Hierarchical with variants array, each variant has own pricing

Response includes:

  • Product details with converted prices
  • Price breakdown showing discounts per variant
  • Pricing context with currency and region info
  • Aggregate price_range for multi-variant products
product_id
string<uuid>
name
string
description
string
brand
string | null
category_name
string | null
images
string[]
product_slug
string | null
thumbnail_url
string | null

Primary image URL for list views

media
object[]

Array of product media objects

variant_id
string<uuid> | null

Only present for simple products

sku
string | null

Only present for simple products

stock
integer | null

Only present for simple products

base_price
number | null

Price in store's base currency (only for simple products)

resolved_price
number | null

Price after discounts before conversion (only for simple products)

display_price
number | null

Final price in customer's currency (only for simple products)

price_breakdown
object

Detailed price calculation (only for simple products)

total_stock
integer | null

Sum of stock across all variants (only for multi-variant)

price_range
object

Price range calculated from variant display_prices (only for multi-variant)

has_variants
boolean

Whether product has multiple variants

variant_count
integer | null

Number of variants (only for multi-variant)

variants
object[] | null

Array of variants with pricing (only for multi-variant)

base_currency
string

Store's base currency code

Example:

"EUR"

display_currency
string

Customer's currency code

Example:

"GBP"

currency_symbol
string

Currency symbol for display

Example:

"£"

exchange_rate
number<float>

Exchange rate applied

Example:

0.870171

pricing_context
object

Global context used for pricing rule evaluation. customer_segment and customer_tier are resolved server-side from customer_id (they are not request parameters).