POST
/
catalog
/
products
/
{id}
/
variants
curl --request POST \
  --url https://services.commercengine.dev/api/v1/x2yh61zw4k/admin/catalog/products/{id}/variants \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "name": "<string>",
    "active": true,
    "stock_available": true,
    "short_description": "<string>",
    "description": "<string>",
    "metadata": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "associated_options": {},
    "sku": "<string>",
    "pricing": [
      {
        "customer_group_id": "<string>",
        "cost_price": 123,
        "listing_price": 123,
        "selling_price": 123,
        "min_order_quantity": 123,
        "max_order_quantity": 123,
        "incremental_quantity": 123,
        "tax_type": "<string>",
        "tax_rate": 123
      }
    ],
    "images": [
      {
        "title": "<string>",
        "alternate_text": "<string>",
        "sort_order": 123,
        "url_tiny": "<string>",
        "url_thumbnail": "<string>",
        "url_standard": "<string>",
        "url_zoom": "<string>",
        "other_details": {}
      }
    ],
    "shipping": {
      "is_free_shipping": false,
      "is_fixed_cost_shipping": false,
      "fixed_cost_shipping_price": 123,
      "is_shipping_price_include_tax": true,
      "availability_description": "<string>",
      "ships_internationally": true,
      "mid_code": "<string>",
      "country_of_origin": "<string>"
    },
    "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": "<string>",
        "starts_at": "<string>",
        "expires_at": "<string>",
        "details": [
          {
            "discount_type": "percentage",
            "discount_percent": 123,
            "discount_fixed_amount": 123,
            "customer_group_id": "<string>"
          }
        ]
      }
    ],
    "subscriptions": [
      {
        "subscription_plan": "<string>",
        "billing_interval": 123,
        "billing_frequency": "<string>",
        "billing_limit": 123,
        "billing_trial_days": 123,
        "order_interval": 123,
        "order_frequency": "<string>",
        "order_limit": 123,
        "fulfill_separately": true,
        "subscription_price": [
          {
            "customer_group_id": "<string>",
            "min_quantity": 123,
            "suscription_price": 123
          }
        ],
        "quantity": 123
      }
    ],
    "sales_channels": [
      {
        "id": "<string>",
        "sales_channel_sku": "<string>"
      }
    ],
    "seo": {
      "meta_title": "<string>",
      "meta_description": "<string>",
      "meta_keywords": [
        "<string>"
      ],
      "slug": "<string>"
    }
  }
]'
{
  "message": "<string>",
  "success": true,
  "content": {
    "variants": [
      {
        "id": "<string>",
        "name": "<string>",
        "active": true,
        "short_description": "<string>",
        "description": "<string>",
        "metadata": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "associated_options": {},
        "sku": "<string>",
        "pricing": [
          {
            "id": 123,
            "customer_group_id": "<string>",
            "cost_price": 123,
            "listing_price": 123,
            "selling_price": 123,
            "min_order_quantity": 123,
            "max_order_quantity": 123,
            "incremental_quantity": 123,
            "tax_type": "<string>",
            "tax_rate": 123
          }
        ],
        "images": [
          {
            "id": 123,
            "title": "<string>",
            "alternate_text": "<string>",
            "sort_order": 123,
            "url_tiny": "<string>",
            "url_thumbnail": "<string>",
            "url_standard": "<string>",
            "url_zoom": "<string>",
            "other_details": {}
          }
        ],
        "shipping": {
          "is_free_shipping": false,
          "is_fixed_cost_shipping": false,
          "fixed_cost_shipping_price": 123,
          "is_shipping_price_include_tax": true,
          "availability_description": "<string>",
          "ships_internationally": true,
          "mid_code": "<string>",
          "country_of_origin": "<string>"
        },
        "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": "<string>",
            "starts_at": "<string>",
            "expires_at": "<string>",
            "details": [
              {
                "discount_type": "percentage",
                "discount_percent": 123,
                "discount_fixed_amount": 123,
                "customer_group_id": "<string>"
              }
            ]
          }
        ],
        "subscriptions": [
          {
            "subscription_plan": "<string>",
            "billing_interval": 123,
            "billing_frequency": "<string>",
            "billing_limit": 123,
            "billing_trial_days": 123,
            "order_interval": 123,
            "order_frequency": "<string>",
            "order_limit": 123,
            "fulfill_separately": true,
            "subscription_price": [
              {
                "customer_group_id": "<string>",
                "min_quantity": 123,
                "suscription_price": 123
              }
            ],
            "quantity": 123
          }
        ],
        "sales_channels": [
          {
            "id": "<string>",
            "channel_name": "<string>",
            "sales_channel_sku": "<string>"
          }
        ],
        "seo": {
          "meta_title": "<string>",
          "meta_description": "<string>",
          "meta_keywords": [
            "<string>"
          ],
          "slug": "<string>"
        }
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

product id

Body

application/json · object[]
name
string

variant name

active
boolean
stock_available
boolean
short_description
string
description
string
metadata
object[]
associated_options
object
sku
string

variant sku

pricing
object[]
images
object[]
shipping
object
packaging
object
promotions
object[]
subscriptions
object[]
sales_channels
object[]
seo
object

Response

200 - application/json
OK
message
string
success
boolean
content
object