Create a product
curl --request POST \
--url https://api-eu.flexportal.io/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"productSku": "MACBOOK-PRO-16-M3",
"name": "MacBook Pro 16\" M3 Pro",
"category": "Laptops",
"brand": "Apple",
"specification": {
"processor": "Apple M3 Pro",
"memory": "18GB",
"storage": "512GB SSD",
"display": "16.2-inch Liquid Retina XDR"
},
"status": "active",
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-A",
"variantName": "Grade A - Like New",
"grade": "A",
"listPrice": 2499,
"acquisitionCost": 1800,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 149.99
},
{
"contractLength": 24,
"monthlyPrice": 99.99
},
{
"contractLength": 36,
"monthlyPrice": 79.99
}
]
},
{
"variantSku": "MACBOOK-PRO-16-M3-B",
"variantName": "Grade B - Good",
"grade": "B",
"listPrice": 2199,
"acquisitionCost": 1500,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 129.99
},
{
"contractLength": 24,
"monthlyPrice": 89.99
},
{
"contractLength": 36,
"monthlyPrice": 69.99
}
]
}
]
}
'import requests
url = "https://api-eu.flexportal.io/v1/products"
payload = {
"productSku": "MACBOOK-PRO-16-M3",
"name": "MacBook Pro 16\" M3 Pro",
"category": "Laptops",
"brand": "Apple",
"specification": {
"processor": "Apple M3 Pro",
"memory": "18GB",
"storage": "512GB SSD",
"display": "16.2-inch Liquid Retina XDR"
},
"status": "active",
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-A",
"variantName": "Grade A - Like New",
"grade": "A",
"listPrice": 2499,
"acquisitionCost": 1800,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 149.99
},
{
"contractLength": 24,
"monthlyPrice": 99.99
},
{
"contractLength": 36,
"monthlyPrice": 79.99
}
]
},
{
"variantSku": "MACBOOK-PRO-16-M3-B",
"variantName": "Grade B - Good",
"grade": "B",
"listPrice": 2199,
"acquisitionCost": 1500,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 129.99
},
{
"contractLength": 24,
"monthlyPrice": 89.99
},
{
"contractLength": 36,
"monthlyPrice": 69.99
}
]
}
]
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productSku: 'MACBOOK-PRO-16-M3',
name: 'MacBook Pro 16" M3 Pro',
category: 'Laptops',
brand: 'Apple',
specification: {
processor: 'Apple M3 Pro',
memory: '18GB',
storage: '512GB SSD',
display: '16.2-inch Liquid Retina XDR'
},
status: 'active',
variants: [
{
variantSku: 'MACBOOK-PRO-16-M3-A',
variantName: 'Grade A - Like New',
grade: 'A',
listPrice: 2499,
acquisitionCost: 1800,
pricing: [
{contractLength: 12, monthlyPrice: 149.99},
{contractLength: 24, monthlyPrice: 99.99},
{contractLength: 36, monthlyPrice: 79.99}
]
},
{
variantSku: 'MACBOOK-PRO-16-M3-B',
variantName: 'Grade B - Good',
grade: 'B',
listPrice: 2199,
acquisitionCost: 1500,
pricing: [
{contractLength: 12, monthlyPrice: 129.99},
{contractLength: 24, monthlyPrice: 89.99},
{contractLength: 36, monthlyPrice: 69.99}
]
}
]
})
};
fetch('https://api-eu.flexportal.io/v1/products', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productSku' => 'MACBOOK-PRO-16-M3',
'name' => 'MacBook Pro 16" M3 Pro',
'category' => 'Laptops',
'brand' => 'Apple',
'specification' => [
'processor' => 'Apple M3 Pro',
'memory' => '18GB',
'storage' => '512GB SSD',
'display' => '16.2-inch Liquid Retina XDR'
],
'status' => 'active',
'variants' => [
[
'variantSku' => 'MACBOOK-PRO-16-M3-A',
'variantName' => 'Grade A - Like New',
'grade' => 'A',
'listPrice' => 2499,
'acquisitionCost' => 1800,
'pricing' => [
[
'contractLength' => 12,
'monthlyPrice' => 149.99
],
[
'contractLength' => 24,
'monthlyPrice' => 99.99
],
[
'contractLength' => 36,
'monthlyPrice' => 79.99
]
]
],
[
'variantSku' => 'MACBOOK-PRO-16-M3-B',
'variantName' => 'Grade B - Good',
'grade' => 'B',
'listPrice' => 2199,
'acquisitionCost' => 1500,
'pricing' => [
[
'contractLength' => 12,
'monthlyPrice' => 129.99
],
[
'contractLength' => 24,
'monthlyPrice' => 89.99
],
[
'contractLength' => 36,
'monthlyPrice' => 69.99
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/products"
payload := strings.NewReader("{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/products")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"productId": "<string>",
"productSku": "<string>",
"operation": "created",
"variantResults": [
{
"variantSku": "<string>",
"operation": "create"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Products
Create Product
Creates a new product with its variants. Uses upsert logic - will update if product SKU already exists. Products can have multiple variants representing different conditions/grades, each with their own pricing tiers for different contract lengths.
POST
/
v1
/
products
Create a product
curl --request POST \
--url https://api-eu.flexportal.io/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Tenant-ID: <tenant-id>' \
--data '
{
"productSku": "MACBOOK-PRO-16-M3",
"name": "MacBook Pro 16\" M3 Pro",
"category": "Laptops",
"brand": "Apple",
"specification": {
"processor": "Apple M3 Pro",
"memory": "18GB",
"storage": "512GB SSD",
"display": "16.2-inch Liquid Retina XDR"
},
"status": "active",
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-A",
"variantName": "Grade A - Like New",
"grade": "A",
"listPrice": 2499,
"acquisitionCost": 1800,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 149.99
},
{
"contractLength": 24,
"monthlyPrice": 99.99
},
{
"contractLength": 36,
"monthlyPrice": 79.99
}
]
},
{
"variantSku": "MACBOOK-PRO-16-M3-B",
"variantName": "Grade B - Good",
"grade": "B",
"listPrice": 2199,
"acquisitionCost": 1500,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 129.99
},
{
"contractLength": 24,
"monthlyPrice": 89.99
},
{
"contractLength": 36,
"monthlyPrice": 69.99
}
]
}
]
}
'import requests
url = "https://api-eu.flexportal.io/v1/products"
payload = {
"productSku": "MACBOOK-PRO-16-M3",
"name": "MacBook Pro 16\" M3 Pro",
"category": "Laptops",
"brand": "Apple",
"specification": {
"processor": "Apple M3 Pro",
"memory": "18GB",
"storage": "512GB SSD",
"display": "16.2-inch Liquid Retina XDR"
},
"status": "active",
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-A",
"variantName": "Grade A - Like New",
"grade": "A",
"listPrice": 2499,
"acquisitionCost": 1800,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 149.99
},
{
"contractLength": 24,
"monthlyPrice": 99.99
},
{
"contractLength": 36,
"monthlyPrice": 79.99
}
]
},
{
"variantSku": "MACBOOK-PRO-16-M3-B",
"variantName": "Grade B - Good",
"grade": "B",
"listPrice": 2199,
"acquisitionCost": 1500,
"pricing": [
{
"contractLength": 12,
"monthlyPrice": 129.99
},
{
"contractLength": 24,
"monthlyPrice": 89.99
},
{
"contractLength": 36,
"monthlyPrice": 69.99
}
]
}
]
}
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Tenant-ID': '<tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productSku: 'MACBOOK-PRO-16-M3',
name: 'MacBook Pro 16" M3 Pro',
category: 'Laptops',
brand: 'Apple',
specification: {
processor: 'Apple M3 Pro',
memory: '18GB',
storage: '512GB SSD',
display: '16.2-inch Liquid Retina XDR'
},
status: 'active',
variants: [
{
variantSku: 'MACBOOK-PRO-16-M3-A',
variantName: 'Grade A - Like New',
grade: 'A',
listPrice: 2499,
acquisitionCost: 1800,
pricing: [
{contractLength: 12, monthlyPrice: 149.99},
{contractLength: 24, monthlyPrice: 99.99},
{contractLength: 36, monthlyPrice: 79.99}
]
},
{
variantSku: 'MACBOOK-PRO-16-M3-B',
variantName: 'Grade B - Good',
grade: 'B',
listPrice: 2199,
acquisitionCost: 1500,
pricing: [
{contractLength: 12, monthlyPrice: 129.99},
{contractLength: 24, monthlyPrice: 89.99},
{contractLength: 36, monthlyPrice: 69.99}
]
}
]
})
};
fetch('https://api-eu.flexportal.io/v1/products', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'productSku' => 'MACBOOK-PRO-16-M3',
'name' => 'MacBook Pro 16" M3 Pro',
'category' => 'Laptops',
'brand' => 'Apple',
'specification' => [
'processor' => 'Apple M3 Pro',
'memory' => '18GB',
'storage' => '512GB SSD',
'display' => '16.2-inch Liquid Retina XDR'
],
'status' => 'active',
'variants' => [
[
'variantSku' => 'MACBOOK-PRO-16-M3-A',
'variantName' => 'Grade A - Like New',
'grade' => 'A',
'listPrice' => 2499,
'acquisitionCost' => 1800,
'pricing' => [
[
'contractLength' => 12,
'monthlyPrice' => 149.99
],
[
'contractLength' => 24,
'monthlyPrice' => 99.99
],
[
'contractLength' => 36,
'monthlyPrice' => 79.99
]
]
],
[
'variantSku' => 'MACBOOK-PRO-16-M3-B',
'variantName' => 'Grade B - Good',
'grade' => 'B',
'listPrice' => 2199,
'acquisitionCost' => 1500,
'pricing' => [
[
'contractLength' => 12,
'monthlyPrice' => 129.99
],
[
'contractLength' => 24,
'monthlyPrice' => 89.99
],
[
'contractLength' => 36,
'monthlyPrice' => 69.99
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eu.flexportal.io/v1/products"
payload := strings.NewReader("{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Tenant-ID", "<tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eu.flexportal.io/v1/products")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productSku\": \"MACBOOK-PRO-16-M3\",\n \"name\": \"MacBook Pro 16\\\" M3 Pro\",\n \"category\": \"Laptops\",\n \"brand\": \"Apple\",\n \"specification\": {\n \"processor\": \"Apple M3 Pro\",\n \"memory\": \"18GB\",\n \"storage\": \"512GB SSD\",\n \"display\": \"16.2-inch Liquid Retina XDR\"\n },\n \"status\": \"active\",\n \"variants\": [\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-A\",\n \"variantName\": \"Grade A - Like New\",\n \"grade\": \"A\",\n \"listPrice\": 2499,\n \"acquisitionCost\": 1800,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 149.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 99.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 79.99\n }\n ]\n },\n {\n \"variantSku\": \"MACBOOK-PRO-16-M3-B\",\n \"variantName\": \"Grade B - Good\",\n \"grade\": \"B\",\n \"listPrice\": 2199,\n \"acquisitionCost\": 1500,\n \"pricing\": [\n {\n \"contractLength\": 12,\n \"monthlyPrice\": 129.99\n },\n {\n \"contractLength\": 24,\n \"monthlyPrice\": 89.99\n },\n {\n \"contractLength\": 36,\n \"monthlyPrice\": 69.99\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"productId": "<string>",
"productSku": "<string>",
"operation": "created",
"variantResults": [
{
"variantSku": "<string>",
"operation": "create"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Create a new product with one or more variants. Products are the foundation of your subscription catalog—they define what customers can subscribe to, at what prices, and with what configurations.This endpoint uses upsert behavior: if a product with the same
productSku already exists, it will be updated instead of creating a duplicate.Common Use Cases
New Product Launch
Add new products to your catalog when expanding your offering
Integration Sync
Sync products from your e-commerce platform or inventory system
Catalog Migration
Migrate products from another subscription platform
Partner Catalog
Onboard products from new suppliers or partners
Minimal Request Example
Create a simple product with one variant:{
"productSku": "MACBOOK-PRO-16",
"name": "MacBook Pro 16\"",
"specification": "Apple Silicon laptop",
"category": "Laptops",
"brand": "Apple",
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-BASE",
"variantName": "M3 Pro, 18GB RAM, 512GB SSD",
"grade": "A",
"listPrice": 2499.00,
"acquisitionCost": 1800.00,
"pricing": [
{ "contractLength": 12, "monthlyPrice": 159.00 },
{ "contractLength": 24, "monthlyPrice": 129.00 },
{ "contractLength": 36, "monthlyPrice": 109.00 }
]
}
]
}
Complete Request Example
Product with multiple variants for different configurations:{
"productSku": "MACBOOK-PRO-16",
"name": "MacBook Pro 16\"",
"specification": "Apple Silicon laptop",
"category": "Laptops",
"brand": "Apple",
"description": "Professional laptop for creative and development work",
"images": ["https://example.com/images/macbook-pro-16.jpg"],
"variants": [
{
"variantSku": "MACBOOK-PRO-16-M3-18GB-SILVER",
"variantName": "M3 Pro, 18GB RAM, 512GB SSD",
"grade": "A",
"colorName": "Silver",
"listPrice": 2499.00,
"acquisitionCost": 1800.00,
"pricing": [
{ "contractLength": 6, "monthlyPrice": 199.00 },
{ "contractLength": 12, "monthlyPrice": 159.00 },
{ "contractLength": 24, "monthlyPrice": 129.00 },
{ "contractLength": 36, "monthlyPrice": 109.00 }
]
},
{
"variantSku": "MACBOOK-PRO-16-M3MAX-64GB-BLACK",
"variantName": "M3 Max, 64GB RAM, 1TB SSD",
"grade": "A",
"colorName": "Space Black",
"listPrice": 3999.00,
"acquisitionCost": 2800.00,
"pricing": [
{ "contractLength": 6, "monthlyPrice": 319.00 },
{ "contractLength": 12, "monthlyPrice": 249.00 },
{ "contractLength": 24, "monthlyPrice": 199.00 },
{ "contractLength": 36, "monthlyPrice": 169.00 }
]
},
{
"variantSku": "MACBOOK-PRO-16-M3-18GB-SILVER-B",
"variantName": "M3 Pro, 18GB RAM, 512GB SSD",
"grade": "B",
"colorName": "Silver",
"listPrice": 2499.00,
"acquisitionCost": 1500.00,
"pricing": [
{ "contractLength": 12, "monthlyPrice": 139.00 },
{ "contractLength": 24, "monthlyPrice": 109.00 },
{ "contractLength": 36, "monthlyPrice": 89.00 }
]
}
]
}
Product Fields
| Field | Required | Description |
|---|---|---|
productSku | Yes | Unique product identifier (parent SKU) |
name | Yes | Display name |
specification | Yes | Product specification/description |
category | Yes | Product category (e.g., “Laptops”, “Phones”) |
brand | Yes | Brand/manufacturer |
description | No | Detailed product description |
images | No | Array of product image URLs |
variants | Yes | Array of variant configurations |
Variant Fields
| Field | Required | Description |
|---|---|---|
variantSku | Yes | Unique variant SKU (used in orders) |
variantName | Yes | Variant name/specification |
grade | Yes | Condition: A, B, C, D, or E |
colorName | No | Color option |
listPrice | No | MSRP/retail price |
acquisitionCost | No | Your cost to acquire |
pricing | Yes | Array of pricing tiers (see below) |
Pricing Array Format
Each pricing tier in thepricing array:
| Field | Required | Description |
|---|---|---|
contractLength | Yes | Contract duration in months (e.g., 12, 24, 36) |
monthlyPrice | Yes | Monthly subscription price |
setupFee | No | One-time setup fee |
discount | No | Discount object with type (“percentage” or “fixed”) and value |
Pricing Strategy
Set monthly prices based on your cost recovery goals:// Example: Target 100% cost recovery in 24 months
const acquisitionCost = 1800;
const targetMonths = 24;
const marginPercent = 0.10; // 10% margin
const monthlyPrice = (acquisitionCost / targetMonths) * (1 + marginPercent);
// = 82.50/month for 24-month contract
Use shorter contract lengths for higher monthly prices (faster cost recovery) and longer contracts for lower monthly prices (better customer value).
Variant SKU Best Practices
Create predictable, searchable SKUs:{PRODUCT}-{SPEC}-{CONFIG}-{GRADE}
Examples:
- MACBOOK-PRO-16-M3PRO-18GB-SILVER-A
- IPAD-PRO-12-M2-256GB-WIFI-B
- EBIKE-VANMOOF-S5-DARK-A
Upsert Behavior
When you create a product with an existingproductSku:
- Product fields are updated with new values
- Existing variants (matching SKU) are updated
- New variants (new SKU) are added
- Missing variants (not in request) remain unchanged
To remove a variant, use the variant status update endpoint to set it to
inactive. Variants are never automatically deleted.Error Handling
| Error Code | Cause | Solution |
|---|---|---|
VALIDATION_ERROR | Missing required fields | Check details array for specific errors |
DUPLICATE_SKU | Variant SKU already exists on different product | Use unique SKUs per variant |
INVALID_PRICING | Pricing array is invalid | Each tier needs contractLength (integer) and monthlyPrice (number) |
Related Endpoints
- List Products - Browse catalog
- Get Product - View product details
- Update Product - Modify existing product
- Import CSV - Bulk import products
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum array length:
1Show child attributes
Show child attributes
Was this page helpful?