curl --request POST \
--url https://api.komerza.com/stores/{storeId}/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"stock": 1073741823,
"deliveryTypes": [
"<string>"
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"customIntervalDays": 123
}
],
"name": "<string>",
"description": "<string>",
"isBestSeller": true,
"hideStock": true,
"slug": "<string>"
}
'import requests
url = "https://api.komerza.com/stores/{storeId}/products"
payload = {
"variants": [
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"stock": 1073741823,
"deliveryTypes": ["<string>"],
"disableVolumeDiscountOnCoupon": True,
"randomizeKeyDelivery": True,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"customIntervalDays": 123
}
],
"name": "<string>",
"description": "<string>",
"isBestSeller": True,
"hideStock": True,
"slug": "<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({
variants: [
{
name: '<string>',
cost: 50000,
minimumQuantity: 1073741824,
maximumQuantity: 1073741823,
order: 1073741824,
stock: 1073741823,
deliveryTypes: ['<string>'],
disableVolumeDiscountOnCoupon: true,
randomizeKeyDelivery: true,
description: '<string>',
dynamicUrl: '<string>',
deliveryMessage: '<string>',
customIntervalDays: 123
}
],
name: '<string>',
description: '<string>',
isBestSeller: true,
hideStock: true,
slug: '<string>'
})
};
fetch('https://api.komerza.com/stores/{storeId}/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.komerza.com/stores/{storeId}/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([
'variants' => [
[
'name' => '<string>',
'cost' => 50000,
'minimumQuantity' => 1073741824,
'maximumQuantity' => 1073741823,
'order' => 1073741824,
'stock' => 1073741823,
'deliveryTypes' => [
'<string>'
],
'disableVolumeDiscountOnCoupon' => true,
'randomizeKeyDelivery' => true,
'description' => '<string>',
'dynamicUrl' => '<string>',
'deliveryMessage' => '<string>',
'customIntervalDays' => 123
]
],
'name' => '<string>',
'description' => '<string>',
'isBestSeller' => true,
'hideStock' => true,
'slug' => '<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://api.komerza.com/stores/{storeId}/products"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\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://api.komerza.com/stores/{storeId}/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komerza.com/stores/{storeId}/products")
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 \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": 50000,
"deliveryTypes": [
"<string>"
],
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"friendlyName": "<string>",
"ipAddress": "<string>",
"userId": "<string>"
}
],
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"imageNames": [
"<string>"
],
"stock": 123,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 1073741823
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"volumeDiscounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1073741824,
"discountValue": 50000
}
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"metadata": "<string>",
"customIntervalDays": 123
}
],
"badges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"order": 123,
"color": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"imageNames": [
"<string>"
],
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "<string>",
"shouldBlockVpns": true,
"order": 123,
"isBestSeller": true,
"hideStock": true,
"blacklistedPaymentGateways": [
"<string>"
],
"additionalFees": {},
"additionalFixedFees": {},
"slug": "<string>",
"metaDescription": "<string>",
"metadata": "<string>",
"customAffiliateDiscountPercentage": 50,
"subscriptionAllowPause": true,
"subscriptionMaxPauseDurationDays": 123,
"subscriptionMaxPauseCount": 123,
"subscriptionAllowCancel": true,
"subscriptionAllowReactivate": true,
"subscriptionGracePeriodDays": 123,
"subscriptionRevokeOnExpiry": true,
"subscriptionApplyGracePeriodOnManualRenewal": true
}
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}Create Product
Creates a new product in the store.
Requires the stores.products.create permission.
curl --request POST \
--url https://api.komerza.com/stores/{storeId}/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"stock": 1073741823,
"deliveryTypes": [
"<string>"
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"customIntervalDays": 123
}
],
"name": "<string>",
"description": "<string>",
"isBestSeller": true,
"hideStock": true,
"slug": "<string>"
}
'import requests
url = "https://api.komerza.com/stores/{storeId}/products"
payload = {
"variants": [
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"stock": 1073741823,
"deliveryTypes": ["<string>"],
"disableVolumeDiscountOnCoupon": True,
"randomizeKeyDelivery": True,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"customIntervalDays": 123
}
],
"name": "<string>",
"description": "<string>",
"isBestSeller": True,
"hideStock": True,
"slug": "<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({
variants: [
{
name: '<string>',
cost: 50000,
minimumQuantity: 1073741824,
maximumQuantity: 1073741823,
order: 1073741824,
stock: 1073741823,
deliveryTypes: ['<string>'],
disableVolumeDiscountOnCoupon: true,
randomizeKeyDelivery: true,
description: '<string>',
dynamicUrl: '<string>',
deliveryMessage: '<string>',
customIntervalDays: 123
}
],
name: '<string>',
description: '<string>',
isBestSeller: true,
hideStock: true,
slug: '<string>'
})
};
fetch('https://api.komerza.com/stores/{storeId}/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.komerza.com/stores/{storeId}/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([
'variants' => [
[
'name' => '<string>',
'cost' => 50000,
'minimumQuantity' => 1073741824,
'maximumQuantity' => 1073741823,
'order' => 1073741824,
'stock' => 1073741823,
'deliveryTypes' => [
'<string>'
],
'disableVolumeDiscountOnCoupon' => true,
'randomizeKeyDelivery' => true,
'description' => '<string>',
'dynamicUrl' => '<string>',
'deliveryMessage' => '<string>',
'customIntervalDays' => 123
]
],
'name' => '<string>',
'description' => '<string>',
'isBestSeller' => true,
'hideStock' => true,
'slug' => '<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://api.komerza.com/stores/{storeId}/products"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\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://api.komerza.com/stores/{storeId}/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komerza.com/stores/{storeId}/products")
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 \"variants\": [\n {\n \"name\": \"<string>\",\n \"cost\": 50000,\n \"minimumQuantity\": 1073741824,\n \"maximumQuantity\": 1073741823,\n \"order\": 1073741824,\n \"stock\": 1073741823,\n \"deliveryTypes\": [\n \"<string>\"\n ],\n \"disableVolumeDiscountOnCoupon\": true,\n \"randomizeKeyDelivery\": true,\n \"description\": \"<string>\",\n \"dynamicUrl\": \"<string>\",\n \"deliveryMessage\": \"<string>\",\n \"customIntervalDays\": 123\n }\n ],\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"isBestSeller\": true,\n \"hideStock\": true,\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": 50000,
"deliveryTypes": [
"<string>"
],
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"friendlyName": "<string>",
"ipAddress": "<string>",
"userId": "<string>"
}
],
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"imageNames": [
"<string>"
],
"stock": 123,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 1073741823
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"volumeDiscounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 1073741824,
"discountValue": 50000
}
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"metadata": "<string>",
"customIntervalDays": 123
}
],
"badges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"order": 123,
"color": "<string>"
}
],
"name": "<string>",
"description": "<string>",
"imageNames": [
"<string>"
],
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "<string>",
"shouldBlockVpns": true,
"order": 123,
"isBestSeller": true,
"hideStock": true,
"blacklistedPaymentGateways": [
"<string>"
],
"additionalFees": {},
"additionalFixedFees": {},
"slug": "<string>",
"metaDescription": "<string>",
"metadata": "<string>",
"customAffiliateDiscountPercentage": 50,
"subscriptionAllowPause": true,
"subscriptionMaxPauseDurationDays": 123,
"subscriptionMaxPauseCount": 123,
"subscriptionAllowCancel": true,
"subscriptionAllowReactivate": true,
"subscriptionGracePeriodDays": 123,
"subscriptionRevokeOnExpiry": true,
"subscriptionApplyGracePeriodOnManualRenewal": true
}
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}Authorizations
Your API key goes here
Path Parameters
The ID of the store.
Body
The Komerza.Common.Forms.Products.CreateProductForm with product details.
Form for creating a product in a store
The list of variants to create in the product
Show child attributes
Show child attributes
The name of the product, this is displayed publicly on the store page and marketplace
3 - 64The description of the product, supports markdown and images from IMGBB only
16384Whether the product should be marked as the bestseller on the user's store page, does nothing for the marketplace
When true, stock/quantity is hidden from customers on the storefront for this product and its variants.
The slug of the product, if null then the ID is used
1 - 72Response
The object was successfully created.
Represents a default generic response for API endpoints.
Indicates whether the operation or response was successful.
A descriptive message providing additional context or information about the response.
The error code (if there was an error) to use when referencing the error
Represents a product that belongs to a specific store and contains details such as name, description, visibility, and associated information.
Show child attributes
Show child attributes