Overview
The Product Variants API allows you to manage different variations of a product (e.g., different sizes, colors, or configurations). Each variant has its own SKU, price, and stock tracking. Base URL:http://localhost:8083
Create product variant
Create a new variant for a product. Requires ADMIN role.Path parameters
Product ID to add variant to
Body parameters
Unique SKU (Stock Keeping Unit) for this variant
Variant name (e.g., “Large”, “Blue”, “128GB”)
Variant attributes as key-value pairs
Price for this variant. Can differ from base product price.
Initial stock quantity
Optional variant-specific image URL
Example
List product variants
Get all variants for a specific product.Path parameters
Product ID
Example
Update product variant
Update an existing product variant. Requires ADMIN role.Path parameters
Product ID
Variant ID to update
Body parameters
Updated variant name
Updated variant attributes
Updated price
Updated stock quantity
Updated image URL
Example
Delete product variant
Delete a product variant. Requires ADMIN role.Path parameters
Product ID
Variant ID to delete
Example
Variant attributes
Variants use flexible key-value attributes. Common attribute keys include:Size attributes
Size attributes
size: Clothing sizes (XS, S, M, L, XL, XXL)dimensions: Physical dimensions (e.g., “10x15cm”)capacity: Volume or capacity (e.g., “500ml”, “1L”)
Color attributes
Color attributes
color: Color name (e.g., “Red”, “Blue”, “Black”)hexColor: Hex color code for precise color matching (e.g., “#FF0000”)finish: Surface finish (e.g., “Matte”, “Glossy”, “Metallic”)
Technical attributes
Technical attributes
storage: Storage capacity for electronics (e.g., “64GB”, “256GB”)memory: RAM amount (e.g., “8GB”, “16GB”)processor: Processor type or speedmaterial: Material composition (e.g., “Cotton”, “Polyester”, “Leather”)
Next steps
Products API
Manage parent products
Inventory API
Track variant stock levels