Variants
Every product has one or more variants — the concrete items a customer buys (a specific size, colour, or configuration). To place an order later, you need the variant ID, not the product ID.
Shape
{
"variants": [
{
"id": "1797628372869189632",
"sku": "SKU-DEMO-001",
"priceNgn": 3450.00,
"attributes": {
"color": "White Gold",
"size": "Adjustable Opening"
}
}
]
}Field reference
| Field | Type | Notes |
|---|---|---|
id | string | Variant ID. Use as variantId when placing an order. |
sku | string | undefined | Unique SKU. Optional. |
priceNgn | number | Variant-specific reseller price. May differ from the base product price. |
attributes.color | string | undefined | Colour name, when applicable. |
attributes.size | string | undefined | Size or configuration label, when applicable. |
Why variants matter
- Correct pricing. A product may have several prices — the variant price is the accurate one.
- Correct delivery. Some variants (e.g. oversized items) have different shipping weight.
- Correct fulfilment. When you place an order, you must send the variant ID; sending just the product ID is not enough.
Example: choosing a variant
A product has multiple variants. You display them as size / colour buttons and let the customer pick one. The chosen variant's id is what you store and, eventually, send with the checkout.
JavaScript
const product = data.products[0]; // Suppose the customer picked the first variant: const chosenVariant = product.variants[0]; console.log(chosenVariant.id); // variant ID for checkout console.log(chosenVariant.priceNgn); // price for this variant console.log(chosenVariant.attributes.color); // "White Gold"
Python
product = data["products"][0]
chosen = product["variants"][0]
print(chosen["id"]) # variant ID for checkout
print(chosen["priceNgn"]) # price
print(chosen.get("attributes", {}))What happens if a product has no variants?
A very small number of products may have an empty variants array (edge cases during catalogue updates). When that happens, treat the product as unavailable for that request and skip it. New syncs restore the variants.
Multiple variants: how to display
Most products have one attribute (color) or two (color + size). To display them:
- Group by
attributes.colorfirst, then byattributes.size. - Show the price from the selected variant, not the base price.
- Disable sizes that do not exist for the currently selected colour.
- Pass
variant.idto your checkout flow.