Get single product pricing with dynamic pricing and multi-currency support
Calculate dynamic price for a single product with geographic currency detection.
Response Structure:
- Simple products: Flat structure with all data at root level
- Multi-variant products: Hierarchical structure with product-level data + variants array
- Each variant gets its own pricing calculation and price breakdown
Multi-Currency Support:
- Automatically detects currency based on customer location
- Converts prices from store’s base currency to detected currency
- Falls back to store’s default currency if no location provided
- Works with all variants in multi-variant products
Dynamic Pricing:
- Customer segment/tier-based pricing
- Volume/quantity-based discounts
- Region-specific pricing rules (applied per variant)
- Time-based promotions
Field Filtering:
- Root-level filtering: Reduce top-level fields
- Nested variant filtering: Filter specific variant fields using dot notation
- Example:
fields=name,price_range,variants.sku,variants.display_price,variants.stock - Bandwidth reduction: Up to 55% with nested filtering
curl --request GET \
--url https://api.tybritelabs.com/v1/prices/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/prices/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/prices/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/prices/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/prices/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tybritelabs.com/v1/prices/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/prices/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"product_id": "715b8c10-eb11-4289-8c0e-2966e78cf9a5",
"name": "Apple MacBook Pro",
"sku": "APP-MBP-13",
"brand": "Apple",
"stock": 42,
"has_variants": false,
"base_price": 1999,
"base_currency": "USD",
"resolved_price": 1999,
"display_price": 1579.21,
"display_currency": "GBP",
"currency_symbol": "£",
"exchange_rate": 0.79,
"price_breakdown": {
"base_price": 1999,
"discounts": [],
"final_price": 1999,
"currency_conversion": {
"from_currency": "USD",
"to_currency": "GBP",
"rate": 0.79,
"converted_amount": 1579.21
}
},
"pricing_context": {
"location": null,
"region": "United Kingdom",
"quantity": 1,
"currency": "GBP",
"exchange_rate": 0.79
}
}Authorizations
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) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: every write a shopper does not make for themselves, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Catalogue reads, plus the actions a shopper takes for themselves
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries, cart and wishlist, reviews, storefront events, and the Agent API's quotes, cart drafts and checkout intents
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) - Shopper actions (cart, wishlist, reviews, storefront events, Agent API quotes, cart drafts and checkout intents): Both key types allowed
- All other write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Headers
Galactic Core customer session access_token. Required, together with customer_id, for personalized pricing. Provide at most one of x-auth-token, x-external-auth or x-idp-token.
Bring-your-own-auth assertion for personalized pricing, resolving to the customer_id supplied. Format: <base64url(JSON)>.<base64url(HMAC-SHA256(JSON))> where the JSON is { "external_id": "...", "iat": <unix>, "exp": <unix> } signed with the store's hmac_secret. Provide at most one of x-auth-token, x-external-auth or x-idp-token.
A raw token from the store's own identity provider, verified by the store's configured Auth verifier, for personalized pricing; it must resolve to the customer_id supplied. Provide at most one of x-auth-token, x-external-auth or x-idp-token.
Path Parameters
Product UUID or variant UUID
Query Parameters
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
City or region name for geographic currency detection.
Works with variants: All variant prices converted to detected currency.
Examples:
place_name=New York→ USDplace_name=London, UK→ GBPplace_name=Nairobi, Kenya→ KES
Customer latitude for precise currency detection (use with longitude).
Works with variants: All variant prices converted based on detected region.
Customer longitude for precise currency detection (use with latitude)
DEPRECATED: Use place_name instead.
Location/country for location-based pricing
Manual region override for pricing rules
Customer UUID for personalized pricing.
Honored only together with that shopper's own credential: an
x-auth-token session, an x-external-auth assertion or an
x-idp-token that resolves to the same customer. The customer's segment, tier and first-purchase
status then feed pricing rule evaluation, and the response is private
to that shopper. Without a matching credential the request returns the
public price; it is not rejected.
Quantity for volume-based pricing
x >= 1The shopper's current cart subtotal. Send it whenever you know the cart total: pricing rules that depend on order value ("spend over $100") can only be evaluated when it is present, and are skipped otherwise.
x >= 0Response
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
Primary image URL for list views
Array of product media objects
Show child attributes
Show child attributes
Only present for simple products
Only present for simple products
Only present for simple products
Price in store's base currency (only for simple products)
Price after discounts before conversion (only for simple products)
Final price in customer's currency (only for simple products)
Detailed price calculation (only for simple products)
Show child attributes
Show child attributes
Sum of stock across all variants (only for multi-variant)
Price range calculated from variant display_prices (only for multi-variant)
Show child attributes
Show child attributes
Whether product has multiple variants
Number of variants (only for multi-variant)
Array of variants with pricing (only for multi-variant)
Show child attributes
Show child attributes
Store's base currency code
"USD"
Customer's currency code
"GBP"
Currency symbol for display
"£"
Exchange rate applied
0.79
Global context used for pricing rule evaluation.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.tybritelabs.com/v1/prices/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/prices/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/prices/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/prices/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/prices/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tybritelabs.com/v1/prices/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/prices/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"product_id": "715b8c10-eb11-4289-8c0e-2966e78cf9a5",
"name": "Apple MacBook Pro",
"sku": "APP-MBP-13",
"brand": "Apple",
"stock": 42,
"has_variants": false,
"base_price": 1999,
"base_currency": "USD",
"resolved_price": 1999,
"display_price": 1579.21,
"display_currency": "GBP",
"currency_symbol": "£",
"exchange_rate": 0.79,
"price_breakdown": {
"base_price": 1999,
"discounts": [],
"final_price": 1999,
"currency_conversion": {
"from_currency": "USD",
"to_currency": "GBP",
"rate": 0.79,
"converted_amount": 1579.21
}
},
"pricing_context": {
"location": null,
"region": "United Kingdom",
"quantity": 1,
"currency": "GBP",
"exchange_rate": 0.79
}
}
