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.
Endpoints
POST
/api/202412/product/{productId}/variants: Create product variant
PUT
/api/202412/variants: Update product variant
DELETE
/api/202412/variants/{variantId}: Delete product variant
GET
/api/202412/variants/{variantId}: Get variant
Product Variant Object ​
The product variant object.
Properties ​
{
"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/product/{productId}/variants
Request Params
Response Data
curl -X POST \
https://{shop}.genmystore.com/api/202412/product/{productId}/variants" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"productVariant":{
"inventoryManagement":"true",
"productId":"102744460756584",
"price":"10",
"costPrice":"3",
"options":[
{
"name":"size",
"id":"10034623756584",
"position":"1",
"value":{
"name":"L",
"id":"10034623756585",
"position":"1"
}
}
],
"weight":"1",
"isDisabled":"true",
"sku":"P001",
"compareOfPrice":"22",
"barcode":"AXOYX49XOPEX6",
"inventoryQuantities":[
{
"locationId":"50002",
"available":"666"
}
],
"weightUnit":"kg"
}
}'
HTTP/1.1 200 OK
{
"productVariant": {
"inventoryManagement": "true",
"productId": "102744460756584",
"costPrice": "3",
"weight": "1",
"compareOfPrice": "22",
"inventoryQuantities": [
{
"locationId": "50002",
"available": "666"
}
],
"price": "10",
"options": [
{
"name": "size",
"id": "10167791756584",
"position": "1",
"value": {
"name": "L",
"id": "10167791756585",
"position": "1"
}
}
],
"variantId": "107362030756584",
"isDisabled": "true",
"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
Request Params
Response Data
curl -X PUT \
https://{shop}.genmystore.com/api/202412/variants" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"productVariant":{
"inventoryManagement":"true",
"productId":"102744460756584",
"price":"1",
"costPrice":"1",
"weight":"1",
"variantId":"107362030756584",
"isDisabled":"false",
"sku":"P001",
"compareOfPrice":"1",
"barcode":"AXOYX49XOPEX6",
"inventoryQuantities":[
{
"locationId":"50002",
"available":"60"
}
],
"weightUnit":"kg"
}
}'
HTTP/1.1 200 OK
{
"productVariant": {
"inventoryManagement": "true",
"productId": "102744460756584",
"costPrice": "1",
"weight": "1",
"compareOfPrice": "1",
"inventoryQuantities": [
{
"locationId": "50002",
"available": "60"
}
],
"price": "1",
"options": [
{
"name": "size",
"id": "10034623756584",
"position": "1",
"value": {
"name": "L",
"id": "10034623756585",
"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
Response Data
curl -X DELETE \
https://{shop}.genmystore.com/api/202412/variants/{variantId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{}
GET
Get variant ​
Retrieves a single product variant by ID.
Access scope
Requires ANY of the following access scopes: write_products
read_products
Endpoint
GET
/api/202412/variants/{variantId}
Request Params
Response Data
curl -X GET \
https://{shop}.genmystore.com/api/202412/variants/{variantId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"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"
}
}
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
POST
Create product variant
Creates a new product variant.
Access scope
Requires ANY of the following access scopes: write_products
Endpoint
POST
/api/202412/product/{productId}/variants
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
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}
GET
Get variant
Retrieves a single product variant by ID.
Access scope
Requires ANY of the following access scopes: write_products
read_products
Endpoint
GET
/api/202412/variants/{variantId}