curl --request POST \
--url https://api.komerza.com/stores/{storeId}/categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"productIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slug": "<string>"
}
'import requests
url = "https://api.komerza.com/stores/{storeId}/categories"
payload = {
"name": "<string>",
"productIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"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({
name: '<string>',
productIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slug: '<string>'
})
};
fetch('https://api.komerza.com/stores/{storeId}/categories', 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}/categories",
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([
'name' => '<string>',
'productIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'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}/categories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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}/categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komerza.com/stores/{storeId}/categories")
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 \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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",
"name": "<string>",
"order": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"imageNames": [
"<string>"
],
"rating": 123,
"order": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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": 123,
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"requireDiscordAuthorization": true,
"deliveryTypes": [
"<string>"
],
"imageNames": [
"<string>"
],
"stock": 123,
"hideStock": true,
"isOutOfStock": true,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 123
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"volumeDiscounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discountValue": 123
}
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"customIntervalDays": 123
}
],
"badges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"order": 123,
"color": "<string>"
}
],
"isBestSeller": true,
"hideStock": true,
"affiliateDiscountMode": 123,
"slug": "<string>",
"metadata": "<string>",
"customAffiliateDiscountPercentage": 123
}
],
"slug": "<string>",
"imageName": "<string>"
}
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"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 Category
Creates a new category in the store.
Requires the stores.categories.create permission.
curl --request POST \
--url https://api.komerza.com/stores/{storeId}/categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"productIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slug": "<string>"
}
'import requests
url = "https://api.komerza.com/stores/{storeId}/categories"
payload = {
"name": "<string>",
"productIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"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({
name: '<string>',
productIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slug: '<string>'
})
};
fetch('https://api.komerza.com/stores/{storeId}/categories', 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}/categories",
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([
'name' => '<string>',
'productIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'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}/categories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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}/categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.komerza.com/stores/{storeId}/categories")
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 \"name\": \"<string>\",\n \"productIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\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",
"name": "<string>",
"order": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"imageNames": [
"<string>"
],
"rating": 123,
"order": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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": 123,
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"requireDiscordAuthorization": true,
"deliveryTypes": [
"<string>"
],
"imageNames": [
"<string>"
],
"stock": 123,
"hideStock": true,
"isOutOfStock": true,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 123
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"volumeDiscounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discountValue": 123
}
],
"disableVolumeDiscountOnCoupon": true,
"randomizeKeyDelivery": true,
"description": "<string>",
"customIntervalDays": 123
}
],
"badges": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"order": 123,
"color": "<string>"
}
],
"isBestSeller": true,
"hideStock": true,
"affiliateDiscountMode": 123,
"slug": "<string>",
"metadata": "<string>",
"customAffiliateDiscountPercentage": 123
}
],
"slug": "<string>",
"imageName": "<string>"
}
}{
"success": true,
"message": "<string>",
"code": "<string>",
"data": "<unknown>"
}{
"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 to create the category in
Body
The form containing the details of the new category
Form for creating or updating a category in a store
The name of the category
3 - 128List of product visibility (or privacy) levels
0, 1, 2, 3 The list of product IDs in this category. This replaces the existing product list.
The slug of the category, 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 category within a store for organizing products
Show child attributes
Show child attributes