Graph API Version

Canvas Product Set

Reading

A product set inside the canvas

Example

Graph API Explorer
GET /v8.0/{canvas-product-set-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(
    '/{canvas-product-set-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(
    "/{canvas-product-set-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{canvas-product-set-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:@"/{canvas-product-set-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

The id of the element

bottom_padding
numeric string

The padding below the element

element_type
enum

The type of the element

image_overlay_spec

How to render overlays over a product item

item_description
string

A token to represent which field from the product to show in the product description

item_headline
string

A token to represent which field from the product to show in the product headline

max_products
unsigned int32

Maximum number of products to show

name
string

The name of the element

product_set_id
numeric string

The product set id which contains a subset of products within a product catalog

retailer_item_ids
list<string>

An array of items that should be shown first in the product set element. If this is not set then products will be dynamically chosen

show_in_feed
bool

A flag that products should be shown in feed unit

top_padding
numeric string

The padding above the element

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can't perform this operation on this endpoint.

Updating

You can update a CanvasProductSet by making a POST request to /{canvas_product_set_id}.

Parameters

ParameterDescription
bottom_padding
float

The padding below the product set

image_overlay_spec
Object

How to render overlays over a product item

overlay_template
enum {PILL_WITH_TEXT, CIRCLE_WITH_TEXT, TRIANGLE_WITH_TEXT}

Required
text_type
enum {PRICE, STRIKETHROUGH_PRICE, PERCENTAGE_OFF, CUSTOM, FROM_PRICE, DISCLAIMER, GUEST_RATING, STAR_RATING}

Required
text_font
enum {DROID_SERIF_REGULAR, LATO_REGULAR, NUNITO_SANS_BOLD, OPEN_SANS_BOLD, OPEN_SANS_CONDENSED_BOLD, PT_SERIF_BOLD, ROBOTO_MEDIUM, ROBOTO_CONDENSED_REGULAR, NOTO_SANS_REGULAR, DYNADS_HYBRID_BOLD}

Required
position
enum {TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT}

Required
theme_color
enum {BACKGROUND_E50900_TEXT_FFFFFF, BACKGROUND_F78400_TEXT_FFFFFF, BACKGROUND_00AF4C_TEXT_FFFFFF, BACKGROUND_0090FF_TEXT_FFFFFF, BACKGROUND_755DDE_TEXT_FFFFFF, BACKGROUND_F23474_TEXT_FFFFFF, BACKGROUND_595959_TEXT_FFFFFF, BACKGROUND_000000_TEXT_FFFFFF, BACKGROUND_FFFFFF_TEXT_C91B00, BACKGROUND_FFFFFF_TEXT_F78400, BACKGROUND_FFFFFF_TEXT_009C2A, BACKGROUND_FFFFFF_TEXT_007AD0, BACKGROUND_FFFFFF_TEXT_755DDE, BACKGROUND_FFFFFF_TEXT_F23474, BACKGROUND_FFFFFF_TEXT_646464, BACKGROUND_FFFFFF_TEXT_000000}

Required
float_with_margin
boolean

text_template_tags
array<string>

custom_text_type
enum {FREE_SHIPPING}

item_description
string

A token to represent which field from the product to show in the product description

item_headline
string

A token to represent which field from the product to show in the product headline

max_items
int64

Maximum number of products to show

name
string

Name of the product set element

product_set_id
product_set ID

The product set id which contains a subset of products within a product catalog

retailer_item_ids
array<string>

An array of items that should be shown first in the product set element. If this is not set then products will be dynamically chosen

show_in_feed
boolean

A flag that products should be shown in feed unit

top_padding
float

The padding above the product set

Return Type

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

Validation Rules

ErrorDescription
200Permissions error

Deleting

You can delete a CanvasProductSet by making a DELETE request to /{canvas_product_set_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter