Graph API Version

Product Group

You use product groups to distinguish products that are identical but have variations such as color, material, size or pattern.

They make it easier for customers to find additional colors, styles, or patterns of a particular product. Product Groups are the way you group all product variants.

Submit Variant Data

  • Ensure you have a separate product for each variant, each with their own unique ID.
  • Each variant must have have the same item_group_id defined in the product feed
  • You must supply a unique image for items that differ by color, material, or pattern.
  • The link attribute should lead to a landing page where that particular variant is preselected.

Reading

A Product Group object

Example

Graph API Explorer
GET /v4.0/{product-group-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{product-group-id}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{product-group-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{product-group-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{product-group-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription
id
numeric string

ID of the product group

product_catalog

Product catalog this product group belongs to

retailer_id
string

Retailer ID of the product group

variants

The list of product variants and their options in the order theyneed to be displayed on the UI

Edges

EdgeDescription

Products that belong to this product group

Validation Rules

ErrorDescription
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
100Invalid parameter
200Permissions error

Creating

You can make a POST request to product_groups edge from the following paths:
When posting to this edge, a ProductGroup will be created.

Parameters

ParameterDescription
retailer_id
string

Retailer defined unique identifier for this item

variants
list<Object>

The list of product variants and their options in the order they need to be displayed on the UI

product_field
string

Product field

Required
label
string

Label

Required
options
list<string>

Options

Required

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
10800Duplicate retailer_id when attempting to create a store collection
100Invalid parameter
200Permissions error

Updating

You can update a ProductGroup by making a POST request to /{product_group_id}.

Parameters

ParameterDescription
default_product_id
numeric string or integer

The default product to show from the group of products

variants
list<Object>

The list of product variants and their options in the order they need to be displayed on the UI

product_field
string

Product field

Required
label
string

Label

Required
options
list<string>

Options

Required

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

Deleting

You can delete a ProductGroup by making a DELETE request to /{product_group_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error