Variants (Batch)
Get all variants
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/variantsRequest
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- id in query - integerFilter items by variant ID.
- sku in query - stringFilter items by variant SKU. To filter by product / base variant SKU, see Get all products.
- upc in query - string
Filter items by UPC.
- include_fields in query - arrayFields to include, in a comma-separated list. The ID and the specified fields will be returned.Type: array[string]
- exclude_fields in query - arrayFields to exclude, in a comma-separated list. The specified fields will be excluded from a response. The ID cannot be excluded.Type: array[string]
- page in query - integer
Specifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
- product_id:in in query - arrayA comma-separated list of IDs of products you want to request. For example,
?product_id:in=77,80,81
.Type: array[integer]
example
Response
Body
dataarray[object]
example
Update Variants (Batch)
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/variantsRequest
Updates a batch of variant
objects. Currently the limit is 50 variants however this is subject to change.
Required Fields
To update an existing variant:
- id (variant ID)
To create a new variant:
- product_id
- sku
- option_values
- id (option_value ID - Example: 146)
- option_id (Option ID - Example: 151)
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
cost_pricenumber
The cost price of the variant. It is not affected by Price List prices. This value displays as null in the control panel whencost_price
equals zero.Min: 0Example: 40pricenumber
This variant’s base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value isnull
, the product’s default price (set in the Product resource’sprice
field) will be used as the base price.Min: 0Example: 40sale_pricenumber
This variant’s sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product’s sale price (set in the Product resource’sprice
field) will be used as the sale price.Min: 0Example: 40retail_pricenumber
This variant’s retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product’s retail price (set in the Product resource’sprice
field) will be used as the retail price.Min: 0Example: 40weightnumber
This variant’s base weight on the storefront. If this value is null, the product’s default weight (set in the Product resource’s weight field) will be used as the base weight.Min: 0Example: 5widthnumber
Width of the variant, which can be used when calculating shipping costs. If this value is
null
, the productʼs default width (set in the Product resourceʼswidth
field) will be used as the base width.Min: 0Example: 5heightnumber
Height of the variant, which can be used when calculating shipping costs. If this value is
null
, the productʼs default height (set in the Product resourceʼsheight
field) will be used as the base height.Min: 0Example: 5depthnumber
Depth of the variant, which can be used when calculating shipping costs. If this value is
null
, the productʼs default depth (set in the Product resourceʼsdepth
field) will be used as the base depth.Min: 0Example: 5is_free_shippingboolean
Flag used to indicate whether the variant has free shipping. If
true
, the shipping cost for the variant will be zero.fixed_cost_shipping_pricenumber
A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation.
Min: 0purchasing_disabledboolean
Iftrue
, this variant will not be purchasable on the storefront.upcstring or null
The UPC code used in feeds for shopping comparison sites and external channel integrations.>= 0 characters<= 14 charactersExample: 1234inventory_levelinteger
Inventory level for the variant, which is used when the product’s inventory_tracking is set to
variant
. The Catalog API returns the inventory for only the default location.The inventory for a variant cannot exceed 2,147,483,647 in the catalog. The sum of the variant inventories, or the total inventory for a product, cannot exceed 2,147,483,647.
If you exceed the limit, the store sets the variant inventory to the limit if no other variant inventories are set. If other variant inventories are set, the store does not save the variant inventory rather than setting the variant inventory to the remaining limit.
The Catalog API handles limits in a different way than the Inventory API. For more information, see Limit handling.
Max: 2147483647Example: 21474inventory_warning_levelinteger
When the variant hits this inventory level, it is considered low stock.Max: 2147483647Example: 5474bin_picking_numberstring
Identifies where in a warehouse the variant is located.>= 0 characters<= 255 charactersidinteger
Example: 154
example
Response
Body
dataarray[object]