Crea una nueva variante (ProductVariantCombination) para un producto existente.
Este endpoint permite agregar una sola variante a un producto sin afectar las variantes existentes.
Ideal para integraciones POS que necesitan agregar SKUs uno por uno sin reenviar todo el catálogo.
{ "variant": { "option1": "XXL", "price": 35.00, "quantity": 10, "sku": "CAMISETA-XXL" } }
{ "variant": { "option1": "XXL", "option2": "Azul", "price": 35.00, "quantity": 10, "sku": "CAMISETA-XXL-AZUL" } }
- Los valores de
option1,option2,option3deben existir en las opciones del producto. - Si la combinación ya existe, retorna error
409 Conflict. - Las variantes existentes no se ven afectadas.
Security
api-key
- Shops API Production serverhttps://mercately.shop/api/v1/products/product_web_id/variants
curl -i -X POST \
https://mercately.shop/api/v1/products/product_web_id/variants \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"variant": {
"option1": "XXL",
"option2": "Azul",
"option3": "Algodón",
"price": 35,
"wholesale_price": 28,
"quantity": 10,
"sku": "CAMISETA-XXL-AZUL",
"selling_without_stock": false,
"variant_url": "https://example.com/product?variant=123"
}
}'Response
{ "message": "Variante creada con éxito", "variant": { "web_id": "newVariantId", "name": "XXL/Azul", "price": "35.0", "wholesale_price": "28.0", "sku": "CAMISETA-XXL-AZUL", "quantity": 10, "variant_option_web_ids": [ … ], "image": "", "variant_url": "https://example.com/product?variant=123" } }