Marketing API Version

Product Catalog Product Sets

Reading

Product sets belonging to a catalog.

Example

Graph API Explorer
GET /v2.11/{product-catalog-id}/product_sets 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-catalog-id}/product_sets',
    '{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-catalog-id}/product_sets",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{product-catalog-id}/product_sets",
    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-catalog-id}/product_sets"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

NameDescription
ancestor_id
numeric string or integer

Filters out only product sets which are descendant of the specified product set

has_children
boolean

Filters out based on if the product set has any child

parent_id
numeric string or integer

Filters out only Product Sets which are direct children of the specified parent in the hierarchy (0 means "root Product Sets")

retailer_id
UTF-8 encoded string

Filters out based on the product set's retailer id

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {}, "summary": {} }

data

A list of ProductSet nodes.

paging

For more details about pagination, see the Graph API guide.

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

FieldDescription

total_count

int32

Total number of objects on this edge

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

Creating

Example

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

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
  • manage_pages
  • pages_show_list
Page management Apps
No data
Other Apps
No data

Parameters

NameDescription
filter
A JSON-encoded rule

Filter rules to define a product set (max length: 500 KB). The pair (filter, parent_id) must be unique inside a catalog

name
UTF-8 encoded string

Name of the product set

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
10803Product set with the same filters already exists
200Permissions error
100Invalid parameter
275Cannot determine the target object for this request. Currently supported objects include ad account, business account and associated objects.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.