List all variants
curl --request GET \
--url https://api-eu.flexportal.io/v1/products/variants \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/products/variants"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/products/variants', 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-eu.flexportal.io/v1/products/variants",
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>",
"Tenant-ID: <tenant-id>"
],
]);
$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-eu.flexportal.io/v1/products/variants"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/products/variants")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/products/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"variants": [
{
"variantId": "<string>",
"tenantId": "<string>",
"productId": "<string>",
"productSku": "<string>",
"variantSku": "<string>",
"variantName": "<string>",
"grade": "<string>",
"pricing": [
{
"contractLength": 123,
"monthlyPrice": 123,
"setupFee": 123,
"discount": {
"type": "percentage",
"value": 123,
"description": "<string>"
},
"source": "suggested",
"calculatedAt": "<string>",
"presetUsed": "<string>"
}
],
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"condition": "<string>",
"colorName": "<string>",
"images": [
"<string>"
],
"listPrice": 123,
"acquisitionCost": 123
}
],
"count": 123,
"limit": 123,
"hasMore": true,
"nextCursor": "<string>"
}Products
List Variants
Returns all product variants. Useful for building pricing tables or dropdowns.
GET
/
v1
/
products
/
variants
List all variants
curl --request GET \
--url https://api-eu.flexportal.io/v1/products/variants \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/products/variants"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/products/variants', 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-eu.flexportal.io/v1/products/variants",
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>",
"Tenant-ID: <tenant-id>"
],
]);
$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-eu.flexportal.io/v1/products/variants"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/products/variants")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/products/variants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"variants": [
{
"variantId": "<string>",
"tenantId": "<string>",
"productId": "<string>",
"productSku": "<string>",
"variantSku": "<string>",
"variantName": "<string>",
"grade": "<string>",
"pricing": [
{
"contractLength": 123,
"monthlyPrice": 123,
"setupFee": 123,
"discount": {
"type": "percentage",
"value": 123,
"description": "<string>"
},
"source": "suggested",
"calculatedAt": "<string>",
"presetUsed": "<string>"
}
],
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"condition": "<string>",
"colorName": "<string>",
"images": [
"<string>"
],
"listPrice": 123,
"acquisitionCost": 123
}
],
"count": 123,
"limit": 123,
"hasMore": true,
"nextCursor": "<string>"
}Overview
Query variants across all products. Unlike Get Product which returns variants for a single product, this endpoint lets you search, filter, and paginate across your entire variant catalog.When to Use This Endpoint
| Use Case | Recommended Endpoint |
|---|---|
| Get variants for one product | Get Product |
| Search variants by SKU | List Variants |
| Filter variants by grade/status | List Variants |
| Build variant search/autocomplete | List Variants |
| Export variant catalog | List Variants |
Common Use Cases
SKU Lookup
Find variant details by SKU for order validation or inventory management
Inventory View
Display all variants with pricing for warehouse or operations teams
Grade Filtering
Find all Grade B or Grade C variants for promotional pricing
Bulk Export
Export complete variant catalog for external systems
Filtering Variants
# Get all active variants
GET /v1/products/variants?status=active
# Filter by grade
GET /v1/products/variants?grade=A
# Filter by category (from parent product)
GET /v1/products/variants?category=Laptops
# Find specific SKU
GET /v1/products/variants?sku=MACBOOK-PRO-16-M3
# Combine filters
GET /v1/products/variants?status=active&grade=A&brand=Apple
Response Fields
Each variant includes:| Field | Description |
|---|---|
variantId | Unique variant identifier |
sku | Variant SKU (used in orders) |
productId | Parent product ID |
productName | Parent product name |
specification | Technical specification |
grade | Condition grade (A-E) |
color | Color option |
status | active or inactive |
listPrice | MSRP/retail price |
acquisitionCost | Your cost to acquire |
pricing | Monthly prices by contract length |
Pagination
This endpoint supports higher limits for bulk operations:| Parameter | Default | Maximum |
|---|---|---|
limit | 50 | 5,000 |
startAfter | — | Cursor from previous response |
# Fetch up to 1,000 variants at once
GET /v1/products/variants?limit=1000&status=active
Example: Build SKU Autocomplete
async function searchVariants(query) {
// Search variants where SKU starts with query
const { variants } = await listVariants({
sku: query, // Partial match support
status: 'active',
limit: 10
});
return variants.map(v => ({
sku: v.sku,
label: `${v.productName} - ${v.specification}`,
price24mo: v.pricing['24']
}));
}
// Usage
const results = await searchVariants('MACBOOK');
// Returns matching MacBook variants for autocomplete
Example: Export Pricing Catalog
async function exportPricingCatalog() {
const allVariants = [];
let cursor = null;
do {
const params = {
status: 'active',
limit: 1000
};
if (cursor) params.startAfter = cursor;
const { variants, nextCursor } = await listVariants(params);
allVariants.push(...variants);
cursor = nextCursor;
} while (cursor);
// Transform for export
return allVariants.map(v => ({
sku: v.sku,
product: v.productName,
spec: v.specification,
grade: v.grade,
listPrice: v.listPrice,
cost: v.acquisitionCost,
price6mo: v.pricing['6'],
price12mo: v.pricing['12'],
price24mo: v.pricing['24'],
price36mo: v.pricing['36']
}));
}
Related Endpoints
- Get Product - Get variants for specific product
- Create Product - Add new variants via product
- Update Product - Modify variant details
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Query Parameters
Items per page (default: 5000, max: 5000)
Cursor for pagination
Filter by status (active, inactive)
Filter by product SKU
Filter by grade (A, B, C, D, E)
Was this page helpful?