curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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{
"message": "<string>",
"success": true,
"content": {
"variant": {
"id": "<string>",
"product_id": "<string>",
"sku": "<string>",
"slug": "<string>",
"name": "<string>",
"product_name": "<string>",
"short_description": "<string>",
"active": true,
"stock_available": true,
"on_promotion": true,
"on_subscription": true,
"is_default": true,
"associated_options": {},
"images": [
{
"id": "<string>",
"title": "<string>",
"alternate_text": "<string>",
"sort_order": 123,
"url_tiny": "<string>",
"url_thumbnail": "<string>",
"url_standard": "<string>",
"url_zoom": "<string>"
}
],
"videos": [
{
"title": "<string>",
"alternate_text": "<string>",
"sort_order": 123,
"video_preview_url": "<string>",
"video_stream_hls_url": "<string>",
"video_stream_dash_url": "<string>",
"image_thumbnail_url": "<string>",
"video_duration": 123
}
],
"pricing": {
"currency": "<string>",
"tax_type": "GST",
"tax_rate": 123,
"price_including_tax": true,
"listing_price": 123,
"selling_price": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1,
"selling_price_excluding_tax": 123
},
"subscription": [
{
"id": "<string>",
"subscription_plan": "<string>",
"subscription_price": 123,
"billing_interval": 123,
"billing_limit": 123,
"fulfill_separately": false,
"order_interval": 123,
"order_limit": 123,
"minimum_quantity": 123,
"billing_trial_days": 123
}
],
"promotion": {
"id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"details": {
"discount_percent": 123,
"discount_fixed_amount": 123
}
},
"description": "<string>",
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"reviews_rating_sum": 123,
"reviews_count": 123,
"hsn_code": "<string>",
"variant_options": [
{
"name": "<string>",
"key": "<string>",
"value": [
"<string>"
]
}
],
"product_attributes": [
{
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "color",
"value": [
{
"name": "<string>",
"hexcode": "<string>"
}
]
}
],
"variant_attributes": [
{
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "color",
"value": [
{
"name": "<string>",
"hexcode": "<string>"
}
]
}
],
"shipping": {
"handling_charges_including_tax": 123,
"handling_charges_excluding_tax": 123,
"tax_type": "<string>",
"tax_rate": 123
},
"seo": {
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
]
},
"metadata": {},
"backorder": true,
"inventory": [
{
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>",
"stock_quantity": 123
}
]
}
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}Retrieve variant detail
Retrieves the details of a particular marketplace variant. Product slug is supported in place of product ID, and variant slug in place of variant ID, in the path.
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/variants/{variant_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{
"message": "<string>",
"success": true,
"content": {
"variant": {
"id": "<string>",
"product_id": "<string>",
"sku": "<string>",
"slug": "<string>",
"name": "<string>",
"product_name": "<string>",
"short_description": "<string>",
"active": true,
"stock_available": true,
"on_promotion": true,
"on_subscription": true,
"is_default": true,
"associated_options": {},
"images": [
{
"id": "<string>",
"title": "<string>",
"alternate_text": "<string>",
"sort_order": 123,
"url_tiny": "<string>",
"url_thumbnail": "<string>",
"url_standard": "<string>",
"url_zoom": "<string>"
}
],
"videos": [
{
"title": "<string>",
"alternate_text": "<string>",
"sort_order": 123,
"video_preview_url": "<string>",
"video_stream_hls_url": "<string>",
"video_stream_dash_url": "<string>",
"image_thumbnail_url": "<string>",
"video_duration": 123
}
],
"pricing": {
"currency": "<string>",
"tax_type": "GST",
"tax_rate": 123,
"price_including_tax": true,
"listing_price": 123,
"selling_price": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1,
"selling_price_excluding_tax": 123
},
"subscription": [
{
"id": "<string>",
"subscription_plan": "<string>",
"subscription_price": 123,
"billing_interval": 123,
"billing_limit": 123,
"fulfill_separately": false,
"order_interval": 123,
"order_limit": 123,
"minimum_quantity": 123,
"billing_trial_days": 123
}
],
"promotion": {
"id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"details": {
"discount_percent": 123,
"discount_fixed_amount": 123
}
},
"description": "<string>",
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"reviews_rating_sum": 123,
"reviews_count": 123,
"hsn_code": "<string>",
"variant_options": [
{
"name": "<string>",
"key": "<string>",
"value": [
"<string>"
]
}
],
"product_attributes": [
{
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "color",
"value": [
{
"name": "<string>",
"hexcode": "<string>"
}
]
}
],
"variant_attributes": [
{
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "color",
"value": [
{
"name": "<string>",
"hexcode": "<string>"
}
]
}
],
"shipping": {
"handling_charges_including_tax": 123,
"handling_charges_excluding_tax": 123,
"tax_type": "<string>",
"tax_rate": 123
},
"seo": {
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
]
},
"metadata": {},
"backorder": true,
"inventory": [
{
"lot_batch": "<string>",
"mfg_date": "2023-12-25",
"exp_date": "2023-12-25",
"manufacturer": "<string>",
"stock_quantity": 123
}
]
}
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}Authorizations
Access token
Headers
This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned.
Path Parameters
Product ID or product slug. Either is accepted in the path.
"01H7YK0C86V9PGT0HXRJVEZXJQ"
"detox-candy"
Variant ID or variant slug. Either is accepted in the path.
"01H7YK0D12ABC123VARIANT456"
"large-blue"
Query Parameters
Determines whether to include or exlude inventory details in response json
Was this page helpful?