Skip to main content
POST
/
stores
/
{storeId}
/
categories
Create category
curl --request POST \
  --url https://api.komerza.com/stores/{storeId}/categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "visibility": 0,
  "productIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "slug": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "code": "<string>",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "dateCreated": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "visibility": 0,
    "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,
        "visibility": 0,
        "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,
            "type": 0,
            "deliveryTypes": [
              "<string>"
            ],
            "imageNames": [
              "<string>"
            ],
            "stock": 123,
            "stockMode": 0,
            "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>"
              }
            ],
            "subscriptionPeriod": "<string>",
            "subscriptionId": "<string>"
          }
        ],
        "isBestSeller": true,
        "slug": "<string>",
        "metadata": "<string>"
      }
    ],
    "slug": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Your API key goes here

Path Parameters

storeId
string<uuid>
required

The ID of the store to create the category in

Body

application/json

The form containing the details of the new category

Form for creating or updating a category in a store

name
string
required

The name of the category

Required string length: 3 - 128
visibility
enum<integer>
required

List of product visibility (or privacy) levels

Available options:
0,
1,
2
productIds
string<uuid>[]
required

The list of product IDs in this category. This replaces the existing product list.

slug
string | null

The slug of the category, if null then the ID is used

Required string length: 1 - 72

Response

The object was successfully created.

Represents a default generic response for API endpoints.

success
boolean
required

Indicates whether the operation or response was successful.

message
string | null

A descriptive message providing additional context or information about the response.

code
string | null

The error code (if there was an error) to use when referencing the error

data
object

Represents a category within a store for organizing products