Logo
Ecartapi.com Public API Documentation

Create product variant

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

Creates a variation of an available product.

Important information:

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Authorization
string




RESPONSES

status OK

{ "success": true, "variant": { "id": "b02a2c63-7b3e-4a68-a49b-8a5958af81c6", "productId": null, "name": null, "price": "12.95", "sku": "SQ0557897", "imageId": null, "fulfillmentService": null, "option1": null, "option2": null, "option3": null, "dimensions": { "width": "5", "height": "5", "length": null, "weight": "2" }, "units": { "width": "INCH", "height": "INCH", "length": "INCH", "weight": "POUND" }, "inventory": { "itemId": null, "quantity": "10" }, "requireShipping": null, "dates": { "createdAt": null, "updatedAt": null } } }



Curl
curl -X POST 'https://api.ecartapi.com/api/v2/products/productId/variants' -H 'Authorization: access_token' -d '{"variant":{"sku":"SQ0557896","price":"12.95","currency":"USD","quantity":"10","option1":"Habanero","units":{"weight":"POUND","width":"INCH"},"options":[{"name":"flavor"}],"dimensions":{"weight":"2.0","length":"7.0","width":"5.0","height":"5.0"}}}'

ENDPOINTS