Graph API Version

Canvas Product Set

Reading

A product set inside the canvas

Starting September 14, 2021, the following fields will throw an error for version 12.0+ calls made by apps that lack the endpoint's required permissions. This change will apply to all versions on December 13, 2021.

  • storefront_settings

Example

use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;

$params = array(
  'fields' => array(
    'id',
    'name',
    'product_set_id',
  ),
);

$data = Api::instance()->call(
  '/' . <CANVAS_PRODUCT_SET_ID>,
  RequestInterface::METHOD_GET,
  $params)->getContent();
curl -G \
  --data-urlencode 'fields=[ 
    "id", 
    "name", 
    "product_set_id" 
  ]' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<CANVAS_PRODUCT_SET_ID>

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_group_key
string

The element group key to bundle multiple elements in editing

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

storefront_setting
RichMediaBentoSetting

A config for storefront dynamic features

top_padding
numeric string

The padding above the element

Error Codes

ErrorDescription
80001There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.

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, AUTOMATED_PERSONALIZE}

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,
}

Error Codes

ErrorDescription
100Invalid parameter
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,
}

Error Codes

ErrorDescription
100Invalid parameter

Create a Collection Ads Product Set

To create a product set used in Collection ads from a set of products in Dynamic Ads:

curl -F 'canvas_product_set={ "bottom_padding": 8, "max_items": 50, "name": "Collection Product Set Name", "product_set_id": "PRODUCT_SET_ID", "show_in_feed": true, "item_headline": "See more at {{product.brand | titleize}}", "item_description": "{{product.price}}", "retailer_item_ids": [ "RETAILER_ID_1", "RETAILER_ID_2", "RETAILER_ID_3", "RETAILER_ID_4", ], "top_padding": 24 }' \ -F 'access_token=ACCESS_TOKEN' \ https://graph.facebook.com/VERSION/PAGE_ID/canvas_elements