Create catalog job
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "create-products",
"input_data": [
{
"name": "<string>",
"hsn_code": "<string>",
"short_description": "<string>",
"categories": [
"<string>"
],
"pricing": [
{
"customer_group_id": "<string>",
"cost_price": 123,
"listing_price": 123,
"selling_price": 123,
"tax_rate": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1
}
],
"slug": "<string>",
"sku": "<string>",
"tags": [
"<string>"
],
"attributes": [
{
"attribute_id": "<string>",
"attribute_value": "<string>"
}
],
"images": [
"<string>"
],
"videos": [
"<string>"
],
"subscriptions": [
{
"subscription_plan": "<string>",
"billing_interval": 123,
"billing_frequency": "monthly",
"billing_limit": 123,
"billing_trial_days": 0,
"fulfill_separately": true,
"subscription_price": [
{
"suscription_price": 123,
"minimum_quantity": 1,
"customer_group_id": "<string>"
}
],
"order_interval": 123,
"order_frequency": "monthly",
"order_limit": 123
}
],
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": true,
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
},
"promotions": {
"promotion_type": "discount",
"starts_at": "<string>",
"details": [
{
"discount_type": "percentage",
"discount_percent": 123,
"customer_group_id": "<string>",
"minimum_quantity": 1,
"maximum_quantity": 123,
"maximum_discount_amount": 123
}
],
"expires_at": "<string>"
}
}
]
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs"
payload = {
"kind": "create-products",
"input_data": [
{
"name": "<string>",
"hsn_code": "<string>",
"short_description": "<string>",
"categories": ["<string>"],
"pricing": [
{
"customer_group_id": "<string>",
"cost_price": 123,
"listing_price": 123,
"selling_price": 123,
"tax_rate": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1
}
],
"slug": "<string>",
"sku": "<string>",
"tags": ["<string>"],
"attributes": [
{
"attribute_id": "<string>",
"attribute_value": "<string>"
}
],
"images": ["<string>"],
"videos": ["<string>"],
"subscriptions": [
{
"subscription_plan": "<string>",
"billing_interval": 123,
"billing_frequency": "monthly",
"billing_limit": 123,
"billing_trial_days": 0,
"fulfill_separately": True,
"subscription_price": [
{
"suscription_price": 123,
"minimum_quantity": 1,
"customer_group_id": "<string>"
}
],
"order_interval": 123,
"order_frequency": "monthly",
"order_limit": 123
}
],
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": True,
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
},
"promotions": {
"promotion_type": "discount",
"starts_at": "<string>",
"details": [
{
"discount_type": "percentage",
"discount_percent": 123,
"customer_group_id": "<string>",
"minimum_quantity": 1,
"maximum_quantity": 123,
"maximum_discount_amount": 123
}
],
"expires_at": "<string>"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'create-products',
input_data: [
{
name: '<string>',
hsn_code: '<string>',
short_description: '<string>',
categories: ['<string>'],
pricing: [
{
customer_group_id: '<string>',
cost_price: 123,
listing_price: 123,
selling_price: 123,
tax_rate: 123,
min_order_quantity: 1,
max_order_quantity: 123,
incremental_quantity: 1
}
],
slug: '<string>',
sku: '<string>',
tags: ['<string>'],
attributes: [{attribute_id: '<string>', attribute_value: '<string>'}],
images: ['<string>'],
videos: ['<string>'],
subscriptions: [
{
subscription_plan: '<string>',
billing_interval: 123,
billing_frequency: 'monthly',
billing_limit: 123,
billing_trial_days: 0,
fulfill_separately: true,
subscription_price: [{suscription_price: 123, minimum_quantity: 1, customer_group_id: '<string>'}],
order_interval: 123,
order_frequency: 'monthly',
order_limit: 123
}
],
packaging: {
pack_width: 123,
pack_height: 123,
pack_length: 123,
pack_dry_weight: 123,
units_per_pack: 123,
vertical_rotation: true,
shipper_width: 123,
shipper_height: 123,
shipper_length: 123,
shipper_dry_weight: 123,
units_per_shipper: 123
},
promotions: {
promotion_type: 'discount',
starts_at: '<string>',
details: [
{
discount_type: 'percentage',
discount_percent: 123,
customer_group_id: '<string>',
minimum_quantity: 1,
maximum_quantity: 123,
maximum_discount_amount: 123
}
],
expires_at: '<string>'
}
}
]
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs', 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}/admin/catalog/jobs",
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([
'kind' => 'create-products',
'input_data' => [
[
'name' => '<string>',
'hsn_code' => '<string>',
'short_description' => '<string>',
'categories' => [
'<string>'
],
'pricing' => [
[
'customer_group_id' => '<string>',
'cost_price' => 123,
'listing_price' => 123,
'selling_price' => 123,
'tax_rate' => 123,
'min_order_quantity' => 1,
'max_order_quantity' => 123,
'incremental_quantity' => 1
]
],
'slug' => '<string>',
'sku' => '<string>',
'tags' => [
'<string>'
],
'attributes' => [
[
'attribute_id' => '<string>',
'attribute_value' => '<string>'
]
],
'images' => [
'<string>'
],
'videos' => [
'<string>'
],
'subscriptions' => [
[
'subscription_plan' => '<string>',
'billing_interval' => 123,
'billing_frequency' => 'monthly',
'billing_limit' => 123,
'billing_trial_days' => 0,
'fulfill_separately' => true,
'subscription_price' => [
[
'suscription_price' => 123,
'minimum_quantity' => 1,
'customer_group_id' => '<string>'
]
],
'order_interval' => 123,
'order_frequency' => 'monthly',
'order_limit' => 123
]
],
'packaging' => [
'pack_width' => 123,
'pack_height' => 123,
'pack_length' => 123,
'pack_dry_weight' => 123,
'units_per_pack' => 123,
'vertical_rotation' => true,
'shipper_width' => 123,
'shipper_height' => 123,
'shipper_length' => 123,
'shipper_dry_weight' => 123,
'units_per_shipper' => 123
],
'promotions' => [
'promotion_type' => 'discount',
'starts_at' => '<string>',
'details' => [
[
'discount_type' => 'percentage',
'discount_percent' => 123,
'customer_group_id' => '<string>',
'minimum_quantity' => 1,
'maximum_quantity' => 123,
'maximum_discount_amount' => 123
]
],
'expires_at' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs"
payload := strings.NewReader("{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"job_id": "<string>",
"kind": "marketplace-sync",
"status": "pending",
"input_data": {},
"message": "<string>",
"marketplace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"details": [
{
"status": "success",
"product_id": "<string>",
"product_name": "<string>",
"variant_id": "<string>",
"variant_name": "<string>",
"error_message": "<string>",
"output_error_file": {}
}
]
}
}Catalog
Create catalog job
Create a new catalog job for bulk product import or marketplace sync.
POST
/
catalog
/
jobs
Create catalog job
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "create-products",
"input_data": [
{
"name": "<string>",
"hsn_code": "<string>",
"short_description": "<string>",
"categories": [
"<string>"
],
"pricing": [
{
"customer_group_id": "<string>",
"cost_price": 123,
"listing_price": 123,
"selling_price": 123,
"tax_rate": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1
}
],
"slug": "<string>",
"sku": "<string>",
"tags": [
"<string>"
],
"attributes": [
{
"attribute_id": "<string>",
"attribute_value": "<string>"
}
],
"images": [
"<string>"
],
"videos": [
"<string>"
],
"subscriptions": [
{
"subscription_plan": "<string>",
"billing_interval": 123,
"billing_frequency": "monthly",
"billing_limit": 123,
"billing_trial_days": 0,
"fulfill_separately": true,
"subscription_price": [
{
"suscription_price": 123,
"minimum_quantity": 1,
"customer_group_id": "<string>"
}
],
"order_interval": 123,
"order_frequency": "monthly",
"order_limit": 123
}
],
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": true,
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
},
"promotions": {
"promotion_type": "discount",
"starts_at": "<string>",
"details": [
{
"discount_type": "percentage",
"discount_percent": 123,
"customer_group_id": "<string>",
"minimum_quantity": 1,
"maximum_quantity": 123,
"maximum_discount_amount": 123
}
],
"expires_at": "<string>"
}
}
]
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs"
payload = {
"kind": "create-products",
"input_data": [
{
"name": "<string>",
"hsn_code": "<string>",
"short_description": "<string>",
"categories": ["<string>"],
"pricing": [
{
"customer_group_id": "<string>",
"cost_price": 123,
"listing_price": 123,
"selling_price": 123,
"tax_rate": 123,
"min_order_quantity": 1,
"max_order_quantity": 123,
"incremental_quantity": 1
}
],
"slug": "<string>",
"sku": "<string>",
"tags": ["<string>"],
"attributes": [
{
"attribute_id": "<string>",
"attribute_value": "<string>"
}
],
"images": ["<string>"],
"videos": ["<string>"],
"subscriptions": [
{
"subscription_plan": "<string>",
"billing_interval": 123,
"billing_frequency": "monthly",
"billing_limit": 123,
"billing_trial_days": 0,
"fulfill_separately": True,
"subscription_price": [
{
"suscription_price": 123,
"minimum_quantity": 1,
"customer_group_id": "<string>"
}
],
"order_interval": 123,
"order_frequency": "monthly",
"order_limit": 123
}
],
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": True,
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
},
"promotions": {
"promotion_type": "discount",
"starts_at": "<string>",
"details": [
{
"discount_type": "percentage",
"discount_percent": 123,
"customer_group_id": "<string>",
"minimum_quantity": 1,
"maximum_quantity": 123,
"maximum_discount_amount": 123
}
],
"expires_at": "<string>"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: 'create-products',
input_data: [
{
name: '<string>',
hsn_code: '<string>',
short_description: '<string>',
categories: ['<string>'],
pricing: [
{
customer_group_id: '<string>',
cost_price: 123,
listing_price: 123,
selling_price: 123,
tax_rate: 123,
min_order_quantity: 1,
max_order_quantity: 123,
incremental_quantity: 1
}
],
slug: '<string>',
sku: '<string>',
tags: ['<string>'],
attributes: [{attribute_id: '<string>', attribute_value: '<string>'}],
images: ['<string>'],
videos: ['<string>'],
subscriptions: [
{
subscription_plan: '<string>',
billing_interval: 123,
billing_frequency: 'monthly',
billing_limit: 123,
billing_trial_days: 0,
fulfill_separately: true,
subscription_price: [{suscription_price: 123, minimum_quantity: 1, customer_group_id: '<string>'}],
order_interval: 123,
order_frequency: 'monthly',
order_limit: 123
}
],
packaging: {
pack_width: 123,
pack_height: 123,
pack_length: 123,
pack_dry_weight: 123,
units_per_pack: 123,
vertical_rotation: true,
shipper_width: 123,
shipper_height: 123,
shipper_length: 123,
shipper_dry_weight: 123,
units_per_shipper: 123
},
promotions: {
promotion_type: 'discount',
starts_at: '<string>',
details: [
{
discount_type: 'percentage',
discount_percent: 123,
customer_group_id: '<string>',
minimum_quantity: 1,
maximum_quantity: 123,
maximum_discount_amount: 123
}
],
expires_at: '<string>'
}
}
]
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs', 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}/admin/catalog/jobs",
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([
'kind' => 'create-products',
'input_data' => [
[
'name' => '<string>',
'hsn_code' => '<string>',
'short_description' => '<string>',
'categories' => [
'<string>'
],
'pricing' => [
[
'customer_group_id' => '<string>',
'cost_price' => 123,
'listing_price' => 123,
'selling_price' => 123,
'tax_rate' => 123,
'min_order_quantity' => 1,
'max_order_quantity' => 123,
'incremental_quantity' => 1
]
],
'slug' => '<string>',
'sku' => '<string>',
'tags' => [
'<string>'
],
'attributes' => [
[
'attribute_id' => '<string>',
'attribute_value' => '<string>'
]
],
'images' => [
'<string>'
],
'videos' => [
'<string>'
],
'subscriptions' => [
[
'subscription_plan' => '<string>',
'billing_interval' => 123,
'billing_frequency' => 'monthly',
'billing_limit' => 123,
'billing_trial_days' => 0,
'fulfill_separately' => true,
'subscription_price' => [
[
'suscription_price' => 123,
'minimum_quantity' => 1,
'customer_group_id' => '<string>'
]
],
'order_interval' => 123,
'order_frequency' => 'monthly',
'order_limit' => 123
]
],
'packaging' => [
'pack_width' => 123,
'pack_height' => 123,
'pack_length' => 123,
'pack_dry_weight' => 123,
'units_per_pack' => 123,
'vertical_rotation' => true,
'shipper_width' => 123,
'shipper_height' => 123,
'shipper_length' => 123,
'shipper_dry_weight' => 123,
'units_per_shipper' => 123
],
'promotions' => [
'promotion_type' => 'discount',
'starts_at' => '<string>',
'details' => [
[
'discount_type' => 'percentage',
'discount_percent' => 123,
'customer_group_id' => '<string>',
'minimum_quantity' => 1,
'maximum_quantity' => 123,
'maximum_discount_amount' => 123
]
],
'expires_at' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs"
payload := strings.NewReader("{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/catalog/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"create-products\",\n \"input_data\": [\n {\n \"name\": \"<string>\",\n \"hsn_code\": \"<string>\",\n \"short_description\": \"<string>\",\n \"categories\": [\n \"<string>\"\n ],\n \"pricing\": [\n {\n \"customer_group_id\": \"<string>\",\n \"cost_price\": 123,\n \"listing_price\": 123,\n \"selling_price\": 123,\n \"tax_rate\": 123,\n \"min_order_quantity\": 1,\n \"max_order_quantity\": 123,\n \"incremental_quantity\": 1\n }\n ],\n \"slug\": \"<string>\",\n \"sku\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"attributes\": [\n {\n \"attribute_id\": \"<string>\",\n \"attribute_value\": \"<string>\"\n }\n ],\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"subscriptions\": [\n {\n \"subscription_plan\": \"<string>\",\n \"billing_interval\": 123,\n \"billing_frequency\": \"monthly\",\n \"billing_limit\": 123,\n \"billing_trial_days\": 0,\n \"fulfill_separately\": true,\n \"subscription_price\": [\n {\n \"suscription_price\": 123,\n \"minimum_quantity\": 1,\n \"customer_group_id\": \"<string>\"\n }\n ],\n \"order_interval\": 123,\n \"order_frequency\": \"monthly\",\n \"order_limit\": 123\n }\n ],\n \"packaging\": {\n \"pack_width\": 123,\n \"pack_height\": 123,\n \"pack_length\": 123,\n \"pack_dry_weight\": 123,\n \"units_per_pack\": 123,\n \"vertical_rotation\": true,\n \"shipper_width\": 123,\n \"shipper_height\": 123,\n \"shipper_length\": 123,\n \"shipper_dry_weight\": 123,\n \"units_per_shipper\": 123\n },\n \"promotions\": {\n \"promotion_type\": \"discount\",\n \"starts_at\": \"<string>\",\n \"details\": [\n {\n \"discount_type\": \"percentage\",\n \"discount_percent\": 123,\n \"customer_group_id\": \"<string>\",\n \"minimum_quantity\": 1,\n \"maximum_quantity\": 123,\n \"maximum_discount_amount\": 123\n }\n ],\n \"expires_at\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"job_id": "<string>",
"kind": "marketplace-sync",
"status": "pending",
"input_data": {},
"message": "<string>",
"marketplace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"details": [
{
"status": "success",
"product_id": "<string>",
"product_name": "<string>",
"variant_id": "<string>",
"variant_name": "<string>",
"error_message": "<string>",
"output_error_file": {}
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
- ImportBulkProducts
- MarketplaceSyncAllProduct
- MarketplaceSyncSpecificProduct
Schema for bulk importing products.
Type of bulk operation
Available options:
create-products Array of products to import
Schema for importing a non-variant product.
- ImportNonVariantProduct
- ImportVariantBasedProduct
Show child attributes
Show child attributes
Was this page helpful?
⌘I