product

product.variant.add

Add variant to product.

post/product.variant.add.json

Request

  • Base URL: https://api.api2cart.com/v1.1
  • URL: https://api.api2cart.com/v1.1/product.variant.add.json
  • Auth: API key in header x-api-key and API key in header x-store-key

Request body

product_idstring

Defines product's id where the variant has to be added

namestring

Defines variant's name that has to be added

modelstring required

Specifies variant's model that has to be added

descriptionstring

Specifies variant's description

short_descriptionstring

Defines short description

available_for_viewboolean

Specifies the set of visible/invisible product's variants for users

available_for_saleboolean

Specifies the set of visible/invisible product's variants for sale

statusstring

Defines status

is_virtualboolean

Defines whether the product is virtual

is_defaultboolean

Defines as a default variant

store_idstring

Add variants specified by store id

stores_idsstring

Assign variant to the stores that is specified by comma-separated stores' id

lang_idstring

Language id

pricenumber

Defines new product's variant price

old_pricenumber

Defines product's old price

cost_pricenumber

Defines new product's cost price

special_pricenumber

Specifies variant's model that has to be added

sprice_createstring

Defines the date of special price creation

sprice_modifiedstring

Defines the date of special price modification

sprice_expirestring

Defines the term of special price offer duration

measure_unitstring

Unit for the price per unit. Must be in allowed list

unit_pricenumber

Defines new product's unit price

prices_inc_taxboolean

Indicates whether prices include tax.

quantitynumber

Defines product variant's quantity that has to be added

warehouse_idstring

This parameter is used for selecting a warehouse where you need to set/modify a product quantity.

in_stockboolean

Set stock status

backorder_statusstring

Set backorder status

manage_stockboolean

Defines inventory tracking for product variant

low_stock_thresholdnumber

Specify the quantity threshold below which the product is considered low in stock

weightnumber

Weight

widthnumber

Defines product's width

heightnumber

Defines product's height

lengthnumber

Defines product's length

weight_unitstring

Weight Unit

skustring

Defines variant's sku that has to be added

barcodestring

A barcode is a unique code composed of numbers used as a product identifier.

gtinstring

Global Trade Item Number. An GTIN is an identifier for trade items.

upcstring

Universal Product Code. A UPC (UPC-A) is a commonly used identifer for many different products.

eanstring

European Article Number. An EAN is a unique 8 or 13-digit identifier that many industries (such as book publishers) use to identify products.

mpnstring

Manufacturer Part Number. A MPN is an identifier of a particular part design or material used.

isbnstring

International Standard Book Number. An ISBN is a unique identifier for books.

seo_urlstring

Defines unique URL for SEO

manufacturerstring

Specifies the product variant's manufacturer

created_atstring

Defines the date of entity creation

meta_titlestring

Defines unique meta title for each entity

meta_keywordsstring

Defines unique meta keywords for each entity

meta_descriptionstring

Defines unique meta description of a entity

urlstring

Defines unique product variant's URL

tax_class_idstring

Defines tax classes where entity has to be added

taxableboolean

Specifies whether a tax is charged

fixed_cost_shipping_pricenumber

Specifies fixed cost shipping price

is_free_shippingboolean

Specifies variant's free shipping flag that has to be added

country_of_originstring

The country where the inventory item was made

harmonized_system_codestring

Harmonized System Code. An HSC is a 6-digit identifier that allows participating countries to classify traded goods on a common basis for customs purposes

processing_profile_idinteger

The numeric ID of the processing profile (readiness state) for physical products in Etsy. You can find possible values in the "cart.info" API method response, in the field processing_profiles[]->readiness_state_id.

marketplace_item_propertiesstring

String containing the JSON representation of the supplied data

clear_cacheboolean

Is cache clear required

idempotency_keystring

A unique identifier associated with a specific request. Repeated requests with the same <strong>idempotency_key</strong> return a cached response without re-executing the business logic. <strong>Please note that the cache lifetime is 15 minutes.</strong>

Example request

{
  "name": "Bag Green XXL",
  "model": "bag_01",
  "description": "Product variant",
  "short_description": "Short description. This is very short description",
  "status": "disabled",
  "is_default": true,
  "store_id": "1",
  "stores_ids": "1,2",
  "price": 99.9,
  "old_price": 99.9,
  "cost_price": 65.9,
  "special_price": 56.9,
  "sprice_create": "2018-08-25 23:56:12",
  "sprice_modified": "2018-12-05 13:46:20",
  "sprice_expire": "2018-08-25 23:56:12",
  "measure_unit": "Piece",
  "unit_price": 10.5,
  "prices_inc_tax": true,
  "quantity": 6,
  "warehouse_id": "1",
  "in_stock": true,
  "backorder_status": "true",
  "low_stock_threshold": 1,
  "weight": 23.69,
  "width": 56.12,
  "height": 56.12,
  "length": 56.12,
  "weight_unit": "lb",
  "sku": "bag_01",
  "barcode": "9770317847001",
  "gtin": "12345678912345",
  "upc": "9770317847001",
  "ean": "5901234123457",
  "mpn": "9770317847001",
  "isbn": "9783161484100",
  "seo_url": "some seo url",
  "manufacturer": "Samsung",
  "created_at": "2014-08-09 13:13:13",
  "meta_title": "category,test",
  "meta_keywords": "category,test",
  "meta_description": "category,test",
  "url": "/product_variant_slug",
  "fixed_cost_shipping_price": 5.5,
  "is_free_shipping": true,
  "country_of_origin": "123456",
  "harmonized_system_code": "123456",
  "marketplace_item_properties": "{\"color\":[\"Silver\"],\"manufacturer\":\"Philips\",\"features\":[\"3 way\"],\"countPerPack\":1,\"watts\":{\"unit\":\"W\",\"measure\":40}}",
  "idempotency_key": "098f6bcd4621d373cade4e832627b4f6"
}

Response

successful operation

return_codeinteger
return_messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.