Variants
POST https://api.ecartapi.com/api/v2/products/{{productId}}/variants
Creates a variation of an available product.
Important information:
Request Body
{"variant"=>{"price"=>"100", "sku"=>"IMAC002", "name"=>"Green", "weight"=>"1", "weightUnit"=>"kg", "inventoryQuantity"=>"5", "requireShipping"=>"true"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string | ||
Content-Type | string |
RESPONSES
status: OK
{"success":true,"variant":{"id":"sku_cl0k4tk0o0000hhpik6ab63hg","productId":"prd_cl0ipt4q40000v8oi860o07me","name":"Black","upc":null,"price":"100","sku":"sku_cl0k4tk0o0000hhpik6ab63hg","imageId":null,"fulfillmentService":null,"option1":null,"option2":null,"option3":null,"dimensions":{"width":null,"height":null,"length":null,"weight":"1"},"units":{"width":null,"height":null,"length":null,"weight":"kg"},"inventory":{"itemId":null,"quantity":null},"requireShipping":null,"bundled":null,"dates":{"createdAt":"1646864866","updatedAt":"1646864866"}}}