Skip to content

Product Variants

Updated: May 5, 2023

Product variants are created by adding multiple products grouped by the same item_group_id field. This field typically corresponds to the parent SKU, although you can use any other ID to group variants together.

All variants for a given product item_group_id must have populated every variant field (for example, size, color, gender, and pattern). For custom variants, you can use the additional_variant_attribute field.

Make sure the item_group_id has the same value across all sizes and colors, and that images and external links match the color of the item.

Facebook Shop product page for 'Facebook T-Shirt (Unisex)' showing blue and small variant dropdowns and a Checkout button

Incorrect — "CoolShirt123" is sent as a parent SKU and the color field is not populated. Because each line item in the field spec needs to be its own product, this is an incorrect way of setting up products.

IDNameColorPriceitem_group_id
CoolShirt123Cool shirt (parent)$9.99CoolShirt123
CoolShirt123_redCool Shirt - Redred$9.99CoolShirt123
CoolShirt123_blueCool Shirt - Blueblue$9.99CoolShirt123

Correct — This example shows the correct way to set up products. The name of the product and the item_group_id fields match (so that the name does not change when variants are selected, but images do). Both of the items below would roll into one "virtual" parent item.

IDNameColorPriceitem_group_id
CoolShirt123_redCool Shirtred$9.99CoolShirt123
CoolShirt123_blueCool Shirtblue$9.99CoolShirt123

For details about the fields, see Reference.

Product Group Variants Example

You can specify variants for a product in the form of a product group. An example of variants is a tee-shirt with 3 sizes (S, M, L) and 4 colors (Red, Yellow, Blue, Green). In this case, we can create a product group (with retailer id as tee-shirt and 12 individual products consisting of the variant options (S+Red, M+Red, L+Red, S+Yellow, M+Yellow, L+Yellow, S+Blue, M+Blue, L+Blue, S+Green, M+Green, L+Green).

Include these columns for the product_group in the product feed. The other required columns are excluded from this example for simplicity's sake, but you need to specify them in the actual feed file.

IDitem_group_idSizeColor
tee-shirt-S-Redtee-shirtSRed
tee-shirt-M-Redtee-shirtMRed
tee-shirt-L-Redtee-shirtLRed
tee-shirt-S-Yellowtee-shirtSYellow
tee-shirt-M-Yellowtee-shirtMYellow
tee-shirt-L-Yellowtee-shirtLYellow
tee-shirt-S-Bluetee-shirtSBlue
tee-shirt-M-Bluetee-shirtMBlue
tee-shirt-L-Bluetee-shirtLBlue
tee-shirt-S-Greentee-shirtSGreen
tee-shirt-M-Greentee-shirtMGreen
tee-shirt-L-Greentee-shirtLGreen

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About