Variant

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

Request Body

{"variant"=>{"price"=>"100", "sku"=>"IMAC002", "name"=>"White", "option1"=>"S", "dimensions"=>{"weight"=>"1"}, "units"=>{"weight"=>"kg"}, "inventory"=>{"quantity"=>"5"}, "requireShipping"=>"true", "codes"=>{"countryCodeOrigin"=>"US", "provinceCodeOrigin"=>"TX", "harmonizedSystemCode"=>"1103.20", "countryHarmonizedSystemCode"=>[{"countryCode"=>"12e213", "harmonizedSystemCode"=>"1103.20"}]}}}

HEADERS

KeyDatatypeRequiredDescription
Authorizationstring

RESPONSES

status: OK

{"success":true,"variant":{"id":"41930314973439","productId":"7351872258303","name":"White","price":"100.00","sku":"IMAC002","imageId":null,"fulfillmentService":"manual","option1":"White","option2":null,"option3":null,"dimensions":{"width":null,"height":null,"length":null,"weight":"1"},"units":{"width":null,"height":null,"length":null,"weight":"kg"},"inventory":{"itemId":"44023999299839","quantity":"5"},"requireShipping":"true","bundled":"false","dates":{"createdAt":"2021-10-28T18:30:41-05:00","updatedAt":"2021-10-28T18:30:41-05:00"},"countryCodeOrigin":"US","harmonizedSystemCode":"110320"}}