Get product by ID or variant ID
Retrieve complete details for a single product using either its product ID or variant ID.
Prices: each variant’s price is its online price (its in-store price when no online price is
set) and sale_price is its online sale price, present only when it is greater than zero and below
price; a client strikes price exactly when sale_price is present. price_range is the lowest
and highest price a shopper pays across the variants, where a variant’s price is its sale_price
when present and its price otherwise. The in-store price is not returned.
Response Structure:
- Simple products (no variants): Flat structure with all data at root level
- Multi-variant products: Hierarchical structure with:
- Product-level data at root (name, description, brand, media, etc.)
- Aggregate data (total_stock, price_range from each variant’s effective price)
- Clean variants array with only variant-specific fields (no redundancy)
Field Filtering: Supports both root-level and nested variant filtering:
- Root filtering: ~ 38% bandwidth reduction
- Nested filtering: ~ 52% bandwidth reduction
- Example:
fields=name,price_range,variants.sku,variants.price,variants.stock
Delivery kinds: fulfilment_kind states how the product is delivered. Each variant also
carries its own fulfilment_kind, and a variant that is not shipped carries a fulfilment
object with its public terms of sale. On an event ticket these are the sale window
(sale_starts_at, sale_ends_at), the entry window (valid_from, valid_until),
admits_per_unit, group_mode, max_per_order, entry_label, check_in and available,
the number of units that can still be bought (null when unlimited; omitted when it could not
be read). A response that carries a limited available figure is cached for seconds rather
than minutes, and checkout re-checks the figure.
Currency: Prices returned in store’s default currency. For multi-currency support with
geographic detection, use the /v1/prices/products/{id} endpoint instead.
curl --request GET \
--url https://api.tybritelabs.com/v1/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/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/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/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/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/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/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",
"category_id": "49f084e5-9ded-429c-aeb7-5918a2234953",
"category_name": "Laptops",
"brand": "Apple",
"thumbnail_url": "https://images.unsplash.com/photo-1517336714731-489689fd1ca8",
"media": [],
"variant_id": "15ca5a86-4b1b-47c3-8762-a1aa43941565",
"sku": "APP-MBP-13",
"price": 1999,
"stock": 42,
"has_variants": false,
"display_currency": "USD",
"currency_symbol": "$",
"is_active": true,
"created_at": "2026-06-20T10:12:03.673701+00:00",
"updated_at": "2026-06-20T10:12:03.673701+00:00"
}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/*): state-changingPOSTcalls require a secret key, for store and marketplace keys alike;GET /v1/auth/meaccepts either key - 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.
Limited publishable keys:
A publishable key can be limited to the products that carry one tag (for example starter:jewellery), created from
the store's Developers page. The limit applies to the key, never to the shopper: shopper sign-up and sign-in stay store-wide.
- Reads return only the slice: products (with their facets, filters, search, brands and specifications), categories and
subcategories that hold in-slice products, collections, promotions, posts and lookbooks that carry the tag, reviews of
in-slice products, prices, discovery lists and the store information summary, with every count computed on the slice.
A product outside the slice answers
404, as if it did not exist. - A write that names a product or variant outside the slice (adding to the cart or wishlist, reserving stock, an order line,
a review, a promotion calculation, a storefront event) answers
403with the error codeout_of_scope, and nothing is written or reserved. An order is refused as a whole. - A route that carries no slice behaviour is not available to the key: it answers
403withendpoint_not_allowed. - Orders placed through such a key record the tag on the order's attribution as
key_scope. - Secret keys and connected-app keys cannot be limited.
- Responses are cached per key limit: a limited key never receives a response cached for the whole store, and the reverse.
Path Parameters
Product ID or Variant ID. This endpoint accepts both types of IDs, providing flexible product retrieval.
Accepted ID Types:
- Product ID: The main product identifier (e.g.,
715b8c10-eb11-4289-8c0e-2966e78cf9a5) - Variant ID: A specific variant identifier (e.g.,
15ca5a86-4b1b-47c3-8762-a1aa43941565)
Why This Matters:
- Simplifies API usage - no need to know if you have a product or variant ID
- Useful for barcode scanning where you might have variant IDs
- Consistent behavior regardless of ID type
Validation:
- Must be a valid UUID format
- Must exist in your store's product catalog
- Returns 404 if product/variant not found
SDK Usage:
Query Parameters
Comma-separated list of fields to include in the response. Supports both root-level and nested variant filtering for maximum bandwidth optimization.
Root-Level Fields:
- Core:
product_id,variant_id,name,sku,description - Pricing:
price,sale_price,price_range,display_currency,currency_symbol - Inventory:
stock,total_stock,last_restocked(last_restockedis not in the default response — request it explicitly) - Media:
media,thumbnail_url - Metadata:
brand,category_name,subcategory_name,attributes.* - Flags:
has_variants,variant_count - Delivery:
fulfilment_kind,fulfilment,fulfilment.*,preorder_ship_date - Variants:
variants(includes all variant fields)
Nested Variant Filtering (52% bandwidth reduction): Use dot notation to filter specific fields within the variants array:
variants.variant_id- Variant identifiervariants.sku- Variant SKUvariants.price- The variant's online pricevariants.sale_price- The variant's online sale price, present when a sale appliesvariants.stock- Stock quantityvariants.variant_attributes- Variant attributes (color, size, etc.). Where a colour is set,coloris its name andcolor_hexthe matching#RRGGBBvalue, so a storefront can render a swatch rather than infer one from the name. Either may be absent.variants.variant_name- Variant display namevariants.is_default- Default variant flagvariants.fulfilment_kind- How the variant is deliveredvariants.fulfilment- The variant's delivery summary, withavailableplaces for event ticketsvariants.*- All variant fields (same as justvariants)
Bandwidth Savings:
- Full product: ~1720 bytes (baseline)
- Root filtering:
1060 bytes (38% reduction) - Nested filtering:
830 bytes (52% reduction)
Examples:
Root-level filtering (~ 38% reduction):
fields=product_id,name,brand,total_stock,price_range,variants
Nested variant filtering (~ 52% reduction):
fields=product_id,name,brand,total_stock,price_range,
variants.variant_id,variants.sku,variants.price,
variants.stock,variants.variant_attributes
Minimal cart validation:
fields=product_id,total_stock,variants.variant_id,variants.stock
SDK Usage:
Performance Impact:
- Nested filtering excludes non-default fields like last_restocked
- Perfect for mobile apps and bandwidth-constrained environments
- Recommended for product cards and listing pages
Response
Successfully retrieved product with complete details.
Response Structure:
For Simple Products (has_variants=false): Returns flat structure with all data at root level:
- All product fields (name, description, brand, media, etc.)
- All variant fields (variant_id, sku, price, stock, etc.)
- No variants array
For Multi-Variant Products (has_variants=true): Returns hierarchical structure:
- Product-level fields at root (name, description, brand, media, etc.)
- Aggregate data: total_stock, price_range (the lowest and highest variant price, sale included)
- Flags: has_variants=true, variant_count
- Clean variants array with only variant-specific fields:
- variant_id, sku, price, sale_price
- stock (last_restocked available via fields=variants.last_restocked)
- variant_attributes (color + color_hex, size, etc.)
- variant_name, is_default
Field Filtering:
- Root-level: Exclude unnecessary fields (~ 38% reduction)
- Nested: Filter variant fields using dot notation (~ 52% reduction)
- Example:
fields=name,price_range,variants.sku,variants.price,variants.stock
SDK Usage:
Represents a product in the catalog. Response structure varies based on endpoint and variant configuration:
List Endpoint (GET /v1/products):
- Returns flat structure with default variant data only
- No variants array (keeps payload small for browsing)
- Includes has_variants flag to indicate if detail fetch needed
Detail Endpoints (GET /v1/products/:id, GET /v1/products/by-slug/:slug):
- Multi-variant products: Hierarchical structure with product-level data at root + variants array
- Simple products: Flat structure with all data at root (no variants array)
Field Filtering:
- Root-level filtering: Reduce top-level fields
- Nested filtering: Filter specific variant fields using dot notation
- Example: fields=name,price_range,variants.sku,variants.price,variants.stock
Channel and logistics fields:
condition, gtin, mpn, weight_grams and dimensions_cm describe an
individual item for sales channels and shipping, so they belong to the
variant: two sizes of one shirt carry different codes and weights.
google_product_category, meta_product_category and tags classify the
listing as a whole and belong to the product. All of them are returned on
the list endpoint and on detail, and any of them can be named in fields=.
Marketplace listing only: each attribute the product's variants differ by, with the values on offer, e.g. {"Size": ["S", "M", "L"], "Colour": [{"value": "Moss", "hex": "#5B6B3A"}]}. A colour attribute lists { value, hex } pairs (hex null when the merchant set none). Empty when the product has one variant.
How the product is delivered. shipped is a physical item; digital is a file download; code is a licence key or voucher code; event_ticket is an entry ticket; service is delivered by the merchant and needs no shipping. On a product this is the default variant's kind; each variant carries its own.
shipped, digital, code, event_ticket, service "shipped"
The online price in major currency units (369.99 = $369.99), never a whole-number count of cents. It is the variant's online price, or its in-store price when no online price is set. On the list endpoint it is the price of the product's lowest-priced variant. Only present for simple products or the list endpoint.
369.99
The online sale price in major currency units (349.99 = $349.99). Present only when the sale price is greater than zero and below price, and null otherwise. A client strikes price exactly when sale_price is present. On the list endpoint it belongs to the same variant as price.
349.99
The manufacturer's Global Trade Item Number (UPC, EAN, or ISBN). Sales channels match a listing against this to identify the product. It is not the same as the barcode the merchant scans in store, which may be an internal label and is never returned by this API.
"0885909950805"
curl --request GET \
--url https://api.tybritelabs.com/v1/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/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/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/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/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/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/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",
"category_id": "49f084e5-9ded-429c-aeb7-5918a2234953",
"category_name": "Laptops",
"brand": "Apple",
"thumbnail_url": "https://images.unsplash.com/photo-1517336714731-489689fd1ca8",
"media": [],
"variant_id": "15ca5a86-4b1b-47c3-8762-a1aa43941565",
"sku": "APP-MBP-13",
"price": 1999,
"stock": 42,
"has_variants": false,
"display_currency": "USD",
"currency_symbol": "$",
"is_active": true,
"created_at": "2026-06-20T10:12:03.673701+00:00",
"updated_at": "2026-06-20T10:12:03.673701+00:00"
}
