Create Product
curl --request POST \
--url https://api.wizcommerce.com/v2/products \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"group_code": "PRD1",
"variants": [
{
"sku_id": "66112458-fda7-4a96-8121-9c1d57a8651d",
"reference_id": "PRD1",
"name": "8'X10'",
"product_prices": [
{
"price_list_id": "PRC123",
"price": 100,
"min_order_quantity": 1,
"max_order_quantity": 100,
"step_increment": 1,
"sale_price": 90,
"default_order_quantity": 2,
"volume_tiers": [
{
"price": 1,
"start_quantity": 50000,
"step_increment": 1
}
]
}
],
"categories": [
"<string>"
],
"collections": [
"<string>"
],
"medias": [
{
"url": "https://example.com/image1.jpg",
"order": 1,
"type": "image",
"is_default": true
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"is_primary": true,
"priority": 123,
"url_slug": "blue-t-shirt-xl",
"seo_info": {
"primary_title": "<string>",
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
]
},
"channel_visibility": {
"website": "DontShow"
},
"volume": {
"cbm": 12.5,
"cft": 441.43
},
"tags": [
"<string>"
]
}
],
"grouping_attributes": [
"color",
"size"
],
"brand": "Acme"
}
EOFimport requests
url = "https://api.wizcommerce.com/v2/products"
payload = {
"group_code": "PRD1",
"variants": [
{
"sku_id": "66112458-fda7-4a96-8121-9c1d57a8651d",
"reference_id": "PRD1",
"name": "8'X10'",
"product_prices": [
{
"price_list_id": "PRC123",
"price": 100,
"min_order_quantity": 1,
"max_order_quantity": 100,
"step_increment": 1,
"sale_price": 90,
"default_order_quantity": 2,
"volume_tiers": [
{
"price": 1,
"start_quantity": 50000,
"step_increment": 1
}
]
}
],
"categories": ["<string>"],
"collections": ["<string>"],
"medias": [
{
"url": "https://example.com/image1.jpg",
"order": 1,
"type": "image",
"is_default": True
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"is_primary": True,
"priority": 123,
"url_slug": "blue-t-shirt-xl",
"seo_info": {
"primary_title": "<string>",
"title": "<string>",
"description": "<string>",
"keywords": ["<string>"]
},
"channel_visibility": { "website": "DontShow" },
"volume": {
"cbm": 12.5,
"cft": 441.43
},
"tags": ["<string>"]
}
],
"grouping_attributes": ["color", "size"],
"brand": "Acme"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
group_code: 'PRD1',
variants: [
{
sku_id: '66112458-fda7-4a96-8121-9c1d57a8651d',
reference_id: 'PRD1',
name: '8\'X10\'',
product_prices: [
{
price_list_id: 'PRC123',
price: 100,
min_order_quantity: 1,
max_order_quantity: 100,
step_increment: 1,
sale_price: 90,
default_order_quantity: 2,
volume_tiers: [{price: 1, start_quantity: 50000, step_increment: 1}]
}
],
categories: ['<string>'],
collections: ['<string>'],
medias: [
{
url: 'https://example.com/image1.jpg',
order: 1,
type: 'image',
is_default: true
}
],
attributes: [{name: '1234567890', value: 'red'}],
is_primary: true,
priority: 123,
url_slug: 'blue-t-shirt-xl',
seo_info: {
primary_title: '<string>',
title: '<string>',
description: '<string>',
keywords: ['<string>']
},
channel_visibility: {website: 'DontShow'},
volume: {cbm: 12.5, cft: 441.43},
tags: ['<string>']
}
],
grouping_attributes: ['color', 'size'],
brand: 'Acme'
})
};
fetch('https://api.wizcommerce.com/v2/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.wizcommerce.com/v2/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([
'group_code' => 'PRD1',
'variants' => [
[
'sku_id' => '66112458-fda7-4a96-8121-9c1d57a8651d',
'reference_id' => 'PRD1',
'name' => '8\'X10\'',
'product_prices' => [
[
'price_list_id' => 'PRC123',
'price' => 100,
'min_order_quantity' => 1,
'max_order_quantity' => 100,
'step_increment' => 1,
'sale_price' => 90,
'default_order_quantity' => 2,
'volume_tiers' => [
[
'price' => 1,
'start_quantity' => 50000,
'step_increment' => 1
]
]
]
],
'categories' => [
'<string>'
],
'collections' => [
'<string>'
],
'medias' => [
[
'url' => 'https://example.com/image1.jpg',
'order' => 1,
'type' => 'image',
'is_default' => true
]
],
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
],
'is_primary' => true,
'priority' => 123,
'url_slug' => 'blue-t-shirt-xl',
'seo_info' => [
'primary_title' => '<string>',
'title' => '<string>',
'description' => '<string>',
'keywords' => [
'<string>'
]
],
'channel_visibility' => [
'website' => 'DontShow'
],
'volume' => [
'cbm' => 12.5,
'cft' => 441.43
],
'tags' => [
'<string>'
]
]
],
'grouping_attributes' => [
'color',
'size'
],
'brand' => 'Acme'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/products"
payload := strings.NewReader("{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.wizcommerce.com/v2/products")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"parent_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "SKU123",
"sku": "SKU123",
"name": "Product Name",
"group_code": "PRD1",
"medias": [
{
"is_default": true,
"order": 1,
"type": "image",
"url": "https://example.com/image1.jpg"
}
],
"is_primary": true,
"priority": 1,
"status": "active",
"attributes": [
{
"id": "1234567890",
"name": "color",
"value": "red"
}
],
"created_at": "<string>",
"updated_at": "<string>",
"channel_visibility": {
"website": "DontShow"
},
"volume": {
"cbm": 0.042475,
"cft": 1.5
}
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Product
Create Product
Create Product
POST
/
v2
/
products
Create Product
curl --request POST \
--url https://api.wizcommerce.com/v2/products \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data @- <<EOF
{
"group_code": "PRD1",
"variants": [
{
"sku_id": "66112458-fda7-4a96-8121-9c1d57a8651d",
"reference_id": "PRD1",
"name": "8'X10'",
"product_prices": [
{
"price_list_id": "PRC123",
"price": 100,
"min_order_quantity": 1,
"max_order_quantity": 100,
"step_increment": 1,
"sale_price": 90,
"default_order_quantity": 2,
"volume_tiers": [
{
"price": 1,
"start_quantity": 50000,
"step_increment": 1
}
]
}
],
"categories": [
"<string>"
],
"collections": [
"<string>"
],
"medias": [
{
"url": "https://example.com/image1.jpg",
"order": 1,
"type": "image",
"is_default": true
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"is_primary": true,
"priority": 123,
"url_slug": "blue-t-shirt-xl",
"seo_info": {
"primary_title": "<string>",
"title": "<string>",
"description": "<string>",
"keywords": [
"<string>"
]
},
"channel_visibility": {
"website": "DontShow"
},
"volume": {
"cbm": 12.5,
"cft": 441.43
},
"tags": [
"<string>"
]
}
],
"grouping_attributes": [
"color",
"size"
],
"brand": "Acme"
}
EOFimport requests
url = "https://api.wizcommerce.com/v2/products"
payload = {
"group_code": "PRD1",
"variants": [
{
"sku_id": "66112458-fda7-4a96-8121-9c1d57a8651d",
"reference_id": "PRD1",
"name": "8'X10'",
"product_prices": [
{
"price_list_id": "PRC123",
"price": 100,
"min_order_quantity": 1,
"max_order_quantity": 100,
"step_increment": 1,
"sale_price": 90,
"default_order_quantity": 2,
"volume_tiers": [
{
"price": 1,
"start_quantity": 50000,
"step_increment": 1
}
]
}
],
"categories": ["<string>"],
"collections": ["<string>"],
"medias": [
{
"url": "https://example.com/image1.jpg",
"order": 1,
"type": "image",
"is_default": True
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"is_primary": True,
"priority": 123,
"url_slug": "blue-t-shirt-xl",
"seo_info": {
"primary_title": "<string>",
"title": "<string>",
"description": "<string>",
"keywords": ["<string>"]
},
"channel_visibility": { "website": "DontShow" },
"volume": {
"cbm": 12.5,
"cft": 441.43
},
"tags": ["<string>"]
}
],
"grouping_attributes": ["color", "size"],
"brand": "Acme"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
group_code: 'PRD1',
variants: [
{
sku_id: '66112458-fda7-4a96-8121-9c1d57a8651d',
reference_id: 'PRD1',
name: '8\'X10\'',
product_prices: [
{
price_list_id: 'PRC123',
price: 100,
min_order_quantity: 1,
max_order_quantity: 100,
step_increment: 1,
sale_price: 90,
default_order_quantity: 2,
volume_tiers: [{price: 1, start_quantity: 50000, step_increment: 1}]
}
],
categories: ['<string>'],
collections: ['<string>'],
medias: [
{
url: 'https://example.com/image1.jpg',
order: 1,
type: 'image',
is_default: true
}
],
attributes: [{name: '1234567890', value: 'red'}],
is_primary: true,
priority: 123,
url_slug: 'blue-t-shirt-xl',
seo_info: {
primary_title: '<string>',
title: '<string>',
description: '<string>',
keywords: ['<string>']
},
channel_visibility: {website: 'DontShow'},
volume: {cbm: 12.5, cft: 441.43},
tags: ['<string>']
}
],
grouping_attributes: ['color', 'size'],
brand: 'Acme'
})
};
fetch('https://api.wizcommerce.com/v2/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.wizcommerce.com/v2/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([
'group_code' => 'PRD1',
'variants' => [
[
'sku_id' => '66112458-fda7-4a96-8121-9c1d57a8651d',
'reference_id' => 'PRD1',
'name' => '8\'X10\'',
'product_prices' => [
[
'price_list_id' => 'PRC123',
'price' => 100,
'min_order_quantity' => 1,
'max_order_quantity' => 100,
'step_increment' => 1,
'sale_price' => 90,
'default_order_quantity' => 2,
'volume_tiers' => [
[
'price' => 1,
'start_quantity' => 50000,
'step_increment' => 1
]
]
]
],
'categories' => [
'<string>'
],
'collections' => [
'<string>'
],
'medias' => [
[
'url' => 'https://example.com/image1.jpg',
'order' => 1,
'type' => 'image',
'is_default' => true
]
],
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
],
'is_primary' => true,
'priority' => 123,
'url_slug' => 'blue-t-shirt-xl',
'seo_info' => [
'primary_title' => '<string>',
'title' => '<string>',
'description' => '<string>',
'keywords' => [
'<string>'
]
],
'channel_visibility' => [
'website' => 'DontShow'
],
'volume' => [
'cbm' => 12.5,
'cft' => 441.43
],
'tags' => [
'<string>'
]
]
],
'grouping_attributes' => [
'color',
'size'
],
'brand' => 'Acme'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/products"
payload := strings.NewReader("{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.wizcommerce.com/v2/products")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"group_code\": \"PRD1\",\n \"variants\": [\n {\n \"sku_id\": \"66112458-fda7-4a96-8121-9c1d57a8651d\",\n \"reference_id\": \"PRD1\",\n \"name\": \"8'X10'\",\n \"product_prices\": [\n {\n \"price_list_id\": \"PRC123\",\n \"price\": 100,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 100,\n \"step_increment\": 1,\n \"sale_price\": 90,\n \"default_order_quantity\": 2,\n \"volume_tiers\": [\n {\n \"price\": 1,\n \"start_quantity\": 50000,\n \"step_increment\": 1\n }\n ]\n }\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"medias\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"order\": 1,\n \"type\": \"image\",\n \"is_default\": true\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"is_primary\": true,\n \"priority\": 123,\n \"url_slug\": \"blue-t-shirt-xl\",\n \"seo_info\": {\n \"primary_title\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n },\n \"channel_visibility\": {\n \"website\": \"DontShow\"\n },\n \"volume\": {\n \"cbm\": 12.5,\n \"cft\": 441.43\n },\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"grouping_attributes\": [\n \"color\",\n \"size\"\n ],\n \"brand\": \"Acme\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"parent_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "SKU123",
"sku": "SKU123",
"name": "Product Name",
"group_code": "PRD1",
"medias": [
{
"is_default": true,
"order": 1,
"type": "image",
"url": "https://example.com/image1.jpg"
}
],
"is_primary": true,
"priority": 1,
"status": "active",
"attributes": [
{
"id": "1234567890",
"name": "color",
"value": "red"
}
],
"created_at": "<string>",
"updated_at": "<string>",
"channel_visibility": {
"website": "DontShow"
},
"volume": {
"cbm": 0.042475,
"cft": 1.5
}
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Authorizations
API Key for authentication
Body
application/json
Product Create Request
If no grouping is available, the group code will be the sku_id
Example:
"PRD1"
Show child attributes
Show child attributes
Ordered list of attribute names used to distinguish and group variants under the same product (e.g., size, then shape). Example: ["color", "size"]
Example:
["color", "size"]
Brand name (required when brand management is enabled).
Example:
"Acme"
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
