Variants Batch Create

POST https://api.ecartapi.com/api/v2/products/{{productId}}/variants/batch

StartFragment

DISCLAIMMER FOR IMAGES PROPERTY

Only the first image will be taken into account the rest of the images in the array will be ignored

EndFragment

Request Body

{"variants"=>[{"name"=>"Black cotton shirt", "price"=>"144", "sku"=>"BLACKKCS", "images"=>[{"src"=>"https://png.pngtree.com/png-vector/20201128/ourlarge/pngtree-cotton-t-shirt-png-image_2401874.jpg"}], "options"=>[{"id"=>"1", "value"=>"Black"}, {"id"=>"2", "value"=>"S"}]}, {"name"=>"Green cotton shirt", "price"=>"144", "sku"=>"GREEENCS", "images"=>[{"src"=>"https://png.pngtree.com/element_our/png_detail/20180828/green-t-shirt-mockup-png_72948.jpg"}], "options"=>[{"id"=>"1", "value"=>"Green"}, {"id"=>"2", "value"=>"S"}]}]}

HEADERS

KeyDatatypeRequiredDescription
Authorizationstring
Content-Typestring

RESPONSES

status: OK

{"success":true,"variants":[{"statusCode":400,"error":"product_invalid_sku","details":"Invalid or duplicated SKU."},{"statusCode":400,"error":"product_invalid_sku","details":"Invalid or duplicated SKU."}]}