Skip to main content
POST
/
stores
/
{storeId}
/
products
Create product
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,
      "type": 0,
      "stock": 1073741823,
      "deliveryTypes": [
        "<string>"
      ],
      "stockMode": 0,
      "dynamicUrl": "<string>",
      "deliveryMessage": "<string>",
      "subscriptionPeriod": "<string>"
    }
  ],
  "name": "<string>",
  "description": "<string>",
  "isBestSeller": true,
  "slug": "<string>"
}
'
{
  "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,
        "stockMode": 0,
        "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>"
          }
        ],
        "dynamicUrl": "<string>",
        "deliveryMessage": "<string>",
        "metadata": "<string>"
      }
    ],
    "name": "<string>",
    "description": "<string>",
    "visibility": 0,
    "imageNames": [
      "<string>"
    ],
    "storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "userId": "<string>",
    "shouldBlockVpns": true,
    "order": 123,
    "isBestSeller": true,
    "blacklistedPaymentGateways": [
      "<string>"
    ],
    "additionalFees": {},
    "slug": "<string>",
    "metadata": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Your API key goes here

Path Parameters

storeId
string<uuid>
required

The ID of the store.

Body

application/json

The Komerza.Common.Forms.Products.CreateProductForm with product details.

Form for creating a product in a store

variants
object[]
required

The list of variants to create in the product

name
string
required

The name of the product, this is displayed publicly on the store page and marketplace

Required string length: 3 - 64
description
string
required

The description of the product, supports markdown and images from IMGBB only

Maximum string length: 16384
isBestSeller
boolean
required

Whether the product should be marked as the bestseller on the user's store page, does nothing for the marketplace

slug
string | null

The slug of the product, 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 product that belongs to a specific store and contains details such as name, description, visibility, and associated information.