Skip to content

About Product Variant

Access scope

Multiple access scopes needed — refer to each endpoint for access scope requirements.

Product Variants are different specifications or versions of the same product, often distinguished by attributes such as color and size.The Product Variants APIs provide a suite of RESTful interfaces for detailed management of these variants, including creation, retrieval, update, and deletion operations.

Core Features

  • Basic Operations: Create variant, update variant, delete variant.
  • Variant Information Query: List variants, get variant details, count variants.

Use Cases

  • SKU Management: Merchants can create and manage multiple variants of a product (such as different colors and sizes) through the API, enabling efficient multi-SKU product management and meeting diverse customer demands.
  • Inventory Management: Through the API, warehouse management systems can update inventory status based on variant information, ensuring accurate inventory data for each variant and facilitating inventory control.
  • Quick Product Updates: Merchants can rapidly update variant prices, inventory, and other information to adapt to market changes and maintain product information timeliness and competitiveness.

Product Variant Object

The product variant object.

Properties

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricenumber
The original price of the item before an adjustment or a sale.
pricenumberrequired
The price of the product variant.
costPricenumber
The cost price of product variant.
weightnumber
The weight of the product variant in the unit system specified with weightUnit.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
bash
{
  "productVariant": {
    "inventoryManagement": "true",
    "productId": "102744460756584",
    "costPrice": "3",
    "weight": "1",
    "compareOfPrice": "22",
    "inventoryQuantities": [
      {
        "locationId": "50002",
        "available": "666"
      }
    ],
    "price": "10",
    "options": [
      {
        "name": "size",
        "id": "10034623756584",
        "position": "1",
        "value": {
          "name": "L",
          "id": "10167791756584",
          "position": "1"
        }
      }
    ],
    "variantId": "107362030756584",
    "isDisabled": "false",
    "sku": "P001",
    "barcode": "AXOYX49XOPEX6",
    "weightUnit": "kg"
  }
}

POST Create product variant

Creates a new product variant.

Access scope

Requires ANY of the following access scopes: write_products

Endpoint

POST /api/202412/products/{productId}/variants 

Request Params

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricenumber
The original price of the item before an adjustment or a sale. with the value rounded to two decimal places.
pricenumberrequired
The price of the product variant. with the value rounded to two decimal places.
costPricenumber
The cost price of product variant. with the value rounded to two decimal places.
weightnumber
The weight of the product variant in the unit system specified with weightUnit. with the value rounded to two decimal places.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
inventoryPolicystring
The valid values for the inventory policy of a product variant once it is out of stock.Enumeration value: CONTINUE - Customers can buy this product variant after it's out of stock.DENY - Customers can't buy this product variant after it's out of stock. default is DENY.
mediaobjectrequired
The media info.
+ Show child properties

Response Data

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricenumber
The original price of the item before an adjustment or a sale. with the value rounded to two decimal places.
pricenumberrequired
The price of the product variant. with the value rounded to two decimal places.
costPricenumber
The cost price of product variant. with the value rounded to two decimal places.
weightnumber
The weight of the product variant in the unit system specified with weightUnit. with the value rounded to two decimal places.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
inventoryPolicystring
The valid values for the inventory policy of a product variant once it is out of stock.Enumeration value: CONTINUE - Customers can buy this product variant after it's out of stock.DENY - Customers can't buy this product variant after it's out of stock. default is DENY.
mediaobject
The media info.
+ Show child properties
bash
curl -X POST \ 
https://{shop}.genmystore.com/api/202412/products/{productId}/variants" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"productVariant":{
		"inventoryManagement":"true",
		"productId":"102744460756584",
		"inventoryPolicy":"",
		"costPrice":"3",
		"weight":"1",
		"media":{
			"productId":"",
			"src":"",
			"position":""
		},
		"compareOfPrice":"22",
		"inventoryQuantities":[
			{
				"locationId":"50002",
				"available":"666"
			}
		],
		"price":"10",
		"options":[
			{
				"name":"size",
				"id":"10034623756584",
				"position":"1",
				"value":{
					"name":"L",
					"id":"10167791756584",
					"position":"1"
				}
			}
		],
		"variantId":"107362030756584",
		"isDisabled":"false",
		"sku":"P001",
		"barcode":"AXOYX49XOPEX6",
		"weightUnit":"kg"
	}
}'
json
HTTP/1.1 200 OK
{
  "productVariant": {
    "inventoryManagement": "true",
    "productId": "102744460756584",
    "inventoryPolicy": "",
    "costPrice": "3",
    "weight": "1",
    "media": {
      "productId": "",
      "src": "",
      "position": ""
    },
    "compareOfPrice": "22",
    "inventoryQuantities": [
      {
        "locationId": "50002",
        "available": "666"
      }
    ],
    "price": "10",
    "options": [
      {
        "name": "size",
        "id": "10034623756584",
        "position": "1",
        "value": {
          "name": "L",
          "id": "10167791756584",
          "position": "1"
        }
      }
    ],
    "variantId": "107362030756584",
    "isDisabled": "false",
    "sku": "P001",
    "barcode": "AXOYX49XOPEX6",
    "weightUnit": "kg"
  }
}

PUT Update product variant

Updates an existing product variant.

Access scope

Requires ANY of the following access scopes: write_products

Endpoint

PUT /api/202412/variants/{variantId} 

Request Params

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricestring
The original price of the item before an adjustment or a sale.with the value rounded to two decimal places.
pricestringrequired
The price of the product variant. with the value rounded to two decimal places.
costPricestring
The cost price of product variant. with the value rounded to two decimal places.
weightstring
The weight of the product variant in the unit system specified with weightUnit. with the value rounded to two decimal places.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
inventoryPolicystring
The valid values for the inventory policy of a product variant once it is out of stock.Enumeration value: CONTINUE - Customers can buy this product variant after it's out of stock.DENY - Customers can't buy this product variant after it's out of stock. default is DENY.
mediaobject
The media info.
+ Show child properties

Response Data

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricenumber
The original price of the item before an adjustment or a sale.
pricenumberrequired
The price of the product variant.
costPricenumber
The cost price of product variant.
weightnumber
The weight of the product variant in the unit system specified with weightUnit.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
inventoryPolicystring
The valid values for the inventory policy of a product variant once it is out of stock.Enumeration value: CONTINUE - Customers can buy this product variant after it's out of stock.DENY - Customers can't buy this product variant after it's out of stock. default is DENY.
mediaobject
The media info.
+ Show child properties
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/variants/{variantId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"productVariant":{
		"inventoryManagement":"true",
		"productId":"102744460756584",
		"inventoryPolicy":"DENY",
		"costPrice":"3",
		"weight":"1",
		"media":{
			"productId":"10167791756584",
			"src":"https://media.genstore.ai/ol-aB/CJ/485ab75e766544b695e65231ab1c022c.jpg",
			"position":"1"
		},
		"compareOfPrice":"22",
		"inventoryQuantities":[
			{
				"locationId":"50002",
				"available":"666"
			}
		],
		"price":"10",
		"options":[
			{
				"name":"size",
				"id":"10034623756584",
				"position":"1",
				"value":{
					"name":"L",
					"id":"10167791756584",
					"position":"1"
				}
			}
		],
		"variantId":"107362030756584",
		"isDisabled":"false",
		"sku":"P001",
		"barcode":"AXOYX49XOPEX6",
		"weightUnit":"kg"
	}
}'
json
HTTP/1.1 200 OK
{
  "productVariant": {
    "inventoryManagement": "true",
    "productId": "102744460756584",
    "inventoryPolicy": "DENY",
    "costPrice": "3",
    "weight": "1",
    "media": {
      "productId": "10167791756584",
      "src": "https://media.genstore.ai/ol-aB/CJ/485ab75e766544b695e65231ab1c022c.jpg",
      "position": "1"
    },
    "compareOfPrice": "22",
    "inventoryQuantities": [
      {
        "locationId": "50002",
        "available": "666"
      }
    ],
    "price": "10",
    "options": [
      {
        "name": "size",
        "id": "10034623756584",
        "position": "1",
        "value": {
          "name": "L",
          "id": "10167791756584",
          "position": "1"
        }
      }
    ],
    "variantId": "107362030756584",
    "isDisabled": "false",
    "sku": "P001",
    "barcode": "AXOYX49XOPEX6",
    "weightUnit": "kg"
  }
}

DELETE Delete product variant

Remove an existing product variant.

Access scope

Requires ANY of the following access scopes: write_products

Endpoint

DELETE /api/202412/variants/{variantId} 

Request Params

variantIdnumberrequired
The unique numeric identifier for the product variant.

Response Data

{}
bash
curl -X DELETE \ 
https://{shop}.genmystore.com/api/202412/variants/{variantId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{}

GET Get variant

Retrieves a product variant by its ID.

A product variant is a specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another.

Access scope

Requires ANY of the following access scopes: read_products

Endpoint

GET /api/202412/variants/{variantId} 

Request Params

variantIdnumberrequired
The unique numeric identifier for the product variant.

Response Data

productVariantobject
A variant represents a specific sellable version of a product, defined by a unique combination of options.
- Hide child properties
variantIdnumber
The unique numeric identifier for the product variant.
productIdnumber
The unique numeric identifier for the product.
skustring
A unique case-sensitive identifier for the product variant in the shop.
barcodestring
The barcode, UPC, or ISBN number for the product.
compareOfPricenumber
The original price of the item before an adjustment or a sale. with the value rounded to two decimal places.
pricenumberrequired
The price of the product variant. with the value rounded to two decimal places.
costPricenumber
The cost price of product variant. with the value rounded to two decimal places.
weightnumber
The weight of the product variant in the unit system specified with weightUnit. with the value rounded to two decimal places.
weightUnitstring
The unit of measurement that applies to the product variant's weight. If you don't specify a value for weightUnit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.
isDisabledbooleanrequired
Whether the product variant is disabled.
inventoryManagementbooleanrequired
The fulfillment service that tracks the number of items in stock for the product variant.
optionsarray
The custom properties that a shop owner uses to define product variants.
+ Show child properties
inventoryQuantitiesarray
The inventory quantity information.
+ Show child properties
inventoryPolicystring
The valid values for the inventory policy of a product variant once it is out of stock.Enumeration value: CONTINUE - Customers can buy this product variant after it's out of stock.DENY - Customers can't buy this product variant after it's out of stock. default is DENY.
mediaobject
The media info.
+ Show child properties
bash
curl -X GET \ 
https://{shop}.genmystore.com/api/202412/variants/{variantId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "productVariant": {
    "inventoryManagement": "true",
    "productId": "102744460756584",
    "inventoryPolicy": "",
    "costPrice": "3",
    "weight": "1",
    "media": {
      "productId": "",
      "src": "",
      "position": ""
    },
    "compareOfPrice": "22",
    "inventoryQuantities": [
      {
        "locationId": "50002",
        "available": "666"
      }
    ],
    "price": "10",
    "options": [
      {
        "name": "size",
        "id": "10034623756584",
        "position": "1",
        "value": {
          "name": "L",
          "id": "10167791756584",
          "position": "1"
        }
      }
    ],
    "variantId": "107362030756584",
    "isDisabled": "false",
    "sku": "P001",
    "barcode": "AXOYX49XOPEX6",
    "weightUnit": "kg"
  }
}