### Correct Product Variant Setup Example Source: https://developers.facebook.com/docs/commerce-platform/catalog/variants Demonstrates the correct approach for setting up product variants, ensuring all variant fields are populated and `item_group_id` is consistent, allowing variants to roll into a single virtual parent item. ```APIDOC ID | Name | Color | Price | item_group_id | | CoolShirt123_red | Cool Shirt | red | $9.99 | CoolShirt123 | | CoolShirt123_blue | Cool Shirt | blue | $9.99 | CoolShirt123 | ``` -------------------------------- ### Incorrect Product Variant Setup Example Source: https://developers.facebook.com/docs/commerce-platform/catalog/variants Illustrates an incorrect method for setting up product variants where the parent SKU is sent without populating all variant fields, leading to an invalid product structure. ```APIDOC ID | Name | Color | Price | item_group_id | | CoolShirt123 | Cool shirt (parent) | | $9.99 | CoolShirt123 | | CoolShirt123_red | Cool Shirt - Red | red | $9.99 | CoolShirt123 | | CoolShirt123_blue | Cool Shirt - Blue | blue | $9.99 | CoolShirt123 | ``` -------------------------------- ### Example Checkout URL with Subscription Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions Provides an example of a custom checkout URL for a product with a selected subscription, including product ID, an optional coupon code, and the 'products_json' parameter for subscription details. ```Plain Text https://your-website.com/any-url?products=&coupon=&products_json= ``` -------------------------------- ### Example JSON for Catalog Subscription Plans Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions Illustrates the structure of the 'subscription_plans' field with multiple selling plans, including examples for monthly plans, plans with percentage discounts, and plans with fixed amount discounts and annual billing frequencies. ```JSON { "requires_subscription_plan": true, "plans": [ { "id": "monthly plan", "delivery_frequency": { "interval": "month", "interval_count": 1 } }, { "id": "monthly plan with 10% off", "delivery_frequency": { "interval": "month", "interval_count": 1 }, "price_adjustment": { "adjustment_value_type": "percentage", "adjustment_percent_value": 10, "adjustment_fixed_value_amount": null } }, { "id": "monthly plan with $10 off and annual bill", "delivery_frequency": { "interval": "month", "interval_count": 1 }, "price_adjustment": { "adjustment_value_type": "fixed_amount", "adjustment_percent_value": 10, "adjustment_fixed_value_amount": null }, "billing_frequency": { "interval": "year", "interval_count": 1 } } ] } ``` -------------------------------- ### Validate Seller Shop Setup Status Source: https://developers.facebook.com/docs/commerce-platform/best-practices/platform This snippet describes how to use the Commerce Merchant Settings API to check the `shop_setup` field, ensuring it is set to `SETUP` to confirm the seller's shop setup is complete. ```APIDOC Commerce Merchant Settings API: Endpoint: / Fields: - shop_setup: Status of the shop setup. Expected value: 'SETUP'. ``` -------------------------------- ### Example JSON Response for Product Set Metadata Source: https://developers.facebook.com/docs/commerce-platform/catalog/collections Provides a sample JSON response structure for a successful GET request to retrieve product set metadata. It illustrates the format of 'id', 'name', 'latest_metadata', and 'live_metadata' fields, including their nested 'cover_image_url', 'description', and 'integrity_review_status' properties, showing a scenario where latest and live metadata differ. ```json { "id": 1234567890, "name": "Best sellers", "latest_metadata": { "cover_image_url": "https://foo.com/some_new_image.jpg" (https://foo.com/image.jpg%E2%80%9D), "description":"Our best selling products", "integrity_review_status": "REJECTED" }, "live_metadata": { "cover_image_url": "https://foo.com/some_good_image.jpg", "description":"Our best selling products", "integrity_review_status": "APPROVED" } } ``` -------------------------------- ### Example Checkout URL without Subscription Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions Provides an example of a custom checkout URL for a product without a selected subscription, including product ID and an optional coupon code. ```Plain Text https://your-website.com/any-url?products=&coupon= ``` -------------------------------- ### Example XML Product Feed for Facebook Commerce Platform Source: https://developers.facebook.com/docs/commerce-platform/catalog/fields This XML snippet demonstrates a sample Atom/RSS feed for submitting product data to Facebook's Commerce Platform. It illustrates the use of the Google Merchant Center namespace (`g:`) for standard product attributes and includes examples of two product variants (Red and Green WidgetThing) under the same item group. Key attributes like `g:id`, `g:title`, `g:description`, `g:link`, `g:image_link`, `g:price`, and `g:availability` are shown, along with `additional_image_link` and `additional_variant_attribute`. ```XML My Deal Shop Products Product Feed for Facebook https://www.mydealsshop.foo SKU-123123 12345678912345 Toys & Games > Toys > Executive Toys > Magnet Toys SKU-123123-RED WidgetThing This product is the product you need to do the thing https://www.mydealsshop.foo/products/widgetthing https://cdn.mycdn.foo/files/123123123.jpg https://cdn.mycdn.foo/files/123123123_image2.jpg https://cdn.mycdn.foo/files/123123123_image3.jpg Red Cool AcmeCo New in stock 19.99 USD 9.99 USD SKU-123123 12345678912346 Toys & Games > Toys > Executive Toys > Magnet Toys SKU-123123-GREEN WidgetThing This product is the product you need to do the thing https://www.mydealsshop.foo/products/widgetthing https://cdn.mycdn.foo/files/123123123.jpg https://cdn.mycdn.foo/files/123123123_image2.jpg https://cdn.mycdn.foo/files/123123123_image3.jpg Green Cool AcmeCo New in stock 19.99 USD 9.99 USD ``` -------------------------------- ### Example Checkout URL for Subscription Products Without SKUs Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions This example demonstrates a checkout URL for subscription products that lack unique SKUs. In this case, your checkout URL endpoint must be designed to parse the subscription information directly from the `product_id` field, which may include appended subscription details. ```APIDOC https://your-website.com/any-url?products=&coupon= ``` -------------------------------- ### Example Checkout URL for Subscription Products with SKUs Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions This example shows a checkout URL for subscription products that have unique SKUs. In this scenario, no additional changes are required to your custom checkout URL endpoint, as the product ID directly corresponds to a unique SKU. ```APIDOC https://your-website.com/any-url?products=&coupon= ``` -------------------------------- ### Retrieve FBE Installation Details for Merchant ID and Instagram Status Source: https://developers.facebook.com/docs/commerce-platform/best-practices/platform This snippet describes how to retrieve the `merchant_settings_id` from the FBE installation details API, which is crucial for subsequent API calls. It also indicates how to check if Instagram Shopping is `APPROVED` for a seller. ```APIDOC FBE Installation Details API: Endpoint: / Fields: - merchant_settings_id: The ID of the commerce account. - instagram_shopping_status: Check for 'APPROVED' to validate Instagram Shopping approval. ``` -------------------------------- ### Example Feed without Product Variants Source: https://developers.facebook.com/docs/commerce-platform/catalog/updating An example of a product feed structure where each record represents a unique product without distinguishing between different stock-keeping units (SKUs) like size or color. This format needs to be updated to include variants for Shops integration. ```APIDOC ID | Title | Item_Group_ID | Price | Quantity_to_Sell_on_Facebook 10024 | Winter Coat | ABC | $299 | 40 10025 | Winter Jacket | DEF | $159 | 10 ``` -------------------------------- ### Example Response for Commerce Eligibility Check Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Provides an example JSON response from the commerce merchant settings API call. It illustrates the structure of the returned data, including the commerce merchant ID, shop details (ID, sales channel status, connected Facebook page), the CTA type (OFFSITE_IAB_CHECKOUT), and a list of countries where offsite IAB checkout is enabled. ```JSON { "data": [ { "id": "CMS_ID", "shops": { "data": [ { "id": "SHOP_ID", "fb_sales_channel": { "status": "ENABLED", "fb_page": { "name": "PAGE_NAME", "id": "PAGE_ID" } } } ], "paging": { "cursors": { "before": "TOKEN", "after": "TOKEN" } } }, "cta": "OFFSITE_IAB_CHECKOUT", "offsite_iab_checkout_enabled_countries": [ "US" ] } ], "paging": { "cursors": { "before": "TOKEN", "after": "TOKEN" } } } ``` -------------------------------- ### Create Shops Ads Ad Set with PRODUCT_CATALOG_SALES Objective Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating an ad set for Shops ads, linked to a campaign with the `PRODUCT_CATALOG_SALES` objective. It specifies `WEBSITE` as destination type, optimizes for `PURCHASE`, and sets a bid strategy. ```curl curl \ -F 'name=Product Catalog Sales Adset' \ -F 'bid_amount=3000' \ -F 'billing_event=IMPRESSIONS' \ -F 'daily_budget=15000' \ -F 'bid_strategy=LOWEST_COST_WITHOUT_CAP' \ -F 'campaign_id=' \ -F 'targeting={"geo_locations": {"countries":["US"]} }' \ -F 'destination_type=WEBSITE \ -F 'promoted_object={"product_set_id":"","custom_event_type": "PURCHASE"}' \ -F 'status=PAUSED' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/adsets ``` -------------------------------- ### Create Advantage+ Creative for Catalog Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example curl command to create an Advantage+ creative for catalog. This snippet demonstrates setting product_set_id, destination_spec, asset_feed_spec with optimization_type and ad_formats, object_story_spec with template data, and degrees_of_freedom_spec. ```curl curl -i -X POST \ -F 'name=Sample Creative' \ -F 'product_set_id=""' \ -F 'destination_spec= {\ "desination_type": "WEBSITE_AND_SHOP"\ }'\ -F 'asset_feed_spec= {\ "optimization_type":"FORMAT_AUTOMATION",\ "ad_formats": ["CAROUSEL", "COLLECTION"],\ "images": [{"hash": ""}],\ "descriptions": [{"text": "{{product.description}}", "From {{product.current_price}}", ...}]\ }\ }'\ -F 'object_story_spec={\ "template_data": {\ "call_to_action": {\ "type": "SHOP_NOW"\ },\n "link": "",\ "multi_share_end_card": false,\ "name": "{{product.name}}"\ },\n "page_id": "",\ "instagram_user_id" : ""\ }' \ -F 'degrees_of_freedom_spec={\ "creative_features_spec": {\ "standard_enhancements": {\ "enroll_status": "OPT_OUT"\ }\ }\ }' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/adcreatives ``` -------------------------------- ### Sample Product Feed Formats for Specific Use Cases Source: https://developers.facebook.com/docs/commerce-platform/catalog/feed-api Provides examples of different feed formats (CSV, TSV) tailored for specific update scenarios, such as updating price and availability or resetting sale price and custom labels. ```APIDOC Feed Format per Use Case: - CSV: Use Case: Update `price` and `availability` for a subset of items. Sample Feed: https://lookaside.facebook.com/developers/resources/?id=dpa_product_catalog_sample_feed_update.csv - TSV: Use Case: Reset `sale_price` and update `custom_label_0` for a subset of items. Sample Feed: https://lookaside.facebook.com/developers/resources/?id=dpa_product_catalog_sample_feed_update.tsv ``` -------------------------------- ### Product Set Collection API: Create Product Set with cURL Source: https://developers.facebook.com/docs/commerce-platform/catalog/collections Demonstrates how to create a new product set using a cURL command. This example specifies the product set's name, a filter based on retailer IDs, and includes collection metadata such as a cover image URL, external URL, and description. ```shell curl \ -F "name=Best Sellers" \ -F "filter={'retailer_id': {'is_any': ['pid1', 'pid2']}}" -F "metadata={'cover_image_url':'https://foo.com/image.jpg', 'external_url':'https://foo.com/best-sellers', 'description':'Our best selling products'}" \ -F "access_token=" \ https://graph.facebook.com/API_VERSION/PRODUCT_CATALOG_ID/product_sets ``` -------------------------------- ### Example CSV Product Feed for Commerce Platform Source: https://developers.facebook.com/docs/commerce-platform/catalog/fields This CSV snippet provides a sample structure for product data, including multiple product variations (different sizes and colors) for a single item group. It demonstrates how to format fields like rich text descriptions, image links, pricing, and category information for a product catalog. ```CSV id,title,description,rich_text_description,availability,condition,price,link,image_link,brand,additional_image_link,age_group,color,gender,item_group_id,google_product_category,product_type,sale_price,sale_price_effective_date,size,status,inventory FB_product_1234,Facebook T-Shirt (Unisex),A vibrant crewneck for all shapes and sizes. Made from 100% cotton.,"

A vibrant crewneck for all shapes and sizes. Made from 100% cotton.

Made of 52% combed and ringspun cotton, 48% polyester.

",in stock,new,9.99 USD,https://www.facebookswagstore.com/American-Apparel-T-Shirt-P395.aspx,https://www.facebookswagstore.com/GetImage.ashx?Path=%7e%2fAssets%2fFB00-0967-Group_Full.jpg&maintainAspectRatio=true&maxHeight=400&maxWidth=400,Facebook,https://www.facebookswagstore.com/Assets/ProductImages/FB00-0475.jpg,adult,blue,unisex,FB1234_shirts,Apparel & Accessories > Clothing > Shirts & Tops,Apparel & Accessories > Clothing > Shirts,4.99 USD,2017-12-01T0:00-23:59/2017-12-31T0:00-23:59,small,2.99 USD,2018-11-01T12:00-0300/2018-12-01T00:00-0300,published,200 FB_product_1235,Facebook T-Shirt (Unisex),A vibrant crewneck for all shapes and sizes. Made from 100% cotton.,"

A vibrant crewneck for all shapes and sizes. Made from 100% cotton.

Made of 52% combed and ringspun cotton, 48% polyester.

",in stock,new,9.99 USD,https://www.facebookswagstore.com/American-Apparel-T-Shirt-P395.aspx,https://www.facebookswagstore.com/GetImage.ashx?Path=%7e%2fAssets%2fFB00-0967-Group_Full.jpg&maintainAspectRatio=true&maxHeight=400&maxWidth=400,Facebook,https://www.facebookswagstore.com/Assets/ProductImages/FB00-0475.jpg,adult,blue,unisex,FB1234_shirts,Apparel & Accessories > Clothing > Shirts & Tops,Apparel & Accessories > Clothing > Shirts,4.99 USD,2017-12-01T0:00-23:59/2017-12-31T0:00-23:59,medium,2.99 USD,2018-11-01T12:00-0300/2018-12-01T00:00-0300,published,200 FB_product_1236,Facebook T-Shirt (Unisex),A vibrant crewneck for all shapes and sizes. Made from 100% cotton.,"

A vibrant crewneck for all shapes and sizes. Made from 100% cotton.

Made of 52% combed and ringspun cotton, 48% polyester.

",in stock,new,9.99 USD,https://www.facebookswagstore.com/American-Apparel-T-Shirt-P395.aspx,https://www.facebookswagstore.com/GetImage.ashx?Path=%7e%2fAssets%2fFB00-0967-Group_Full.jpg&maintainAspectRatio=true&maxHeight=400&maxWidth=400,Facebook,https://www.facebookswagstore.com/Assets/ProductImages/FB00-0475.jpg,adult,blue,unisex,FB1234_shirts,Apparel & Accessories > Clothing > Shirts & Tops,Apparel & Accessories > Clothing > Shirts,4.99 USD,2017-12-01T0:00-23:59/2017-12-31T0:00-23:59,large,2.99 USD,2018-11-01T12:00-0300/2018-12-01T00:00-0300,published,200 FB_product_1237,Facebook T-Shirt (Unisex),A vibrant crewneck for all shapes and sizes. Made from 100% cotton.,"

A vibrant crewneck for all shapes and sizes. Made from 100% cotton.

Made of 52% combed and ringspun cotton, 48% polyester.

",in stock,new,9.99 USD,https://www.facebookswagstore.com/American-Apparel-T-Shirt-P395.aspx,https://www.facebookswagstore.com/GetImage.ashx?Path=%7e%2fAssets%2fFB00-0967-Group_Full.jpg&maintainAspectRatio=true&maxHeight=400&maxWidth=400,Facebook,https://www.facebookswagstore.com/Assets/ProductImages/FB00-0475.jpg,adult,black,unisex,FB1234_shirts,Apparel & Accessories > Clothing > Shirts & Tops,Apparel & Accessories > Clothing > Shirts,4.99 USD,2017-12-01T0:00-23:59/2017-12-31T0:00 ``` -------------------------------- ### Example Claim Email Format Source: https://developers.facebook.com/docs/commerce-platform/communication An example of the email format sent by Instagram when a customer opens a claim for an order. This email is sent to the customer service contact email address, indicating a new claim has been opened. ```text From: Instagram To: {customer service contact email address} Subject: A claim has been opened for order #{order number} ``` -------------------------------- ### Example Catalog Feed for Subscription Product Variants Source: https://developers.facebook.com/docs/commerce-platform/enable-subscriptions This table illustrates how to structure a catalog feed to represent subscription options as product variants. It shows the use of `id`, `title`, `item_group_id`, `price`, `sale_price`, and `additional_variant_attribute` fields, specifically for 'subscription' key-value pairs to define different subscription frequencies. ```APIDOC id | title | item_group_id | price | sale_price | additional_variant_attribute razor_refill_cartridge | 4-blade razor refill (one time) | razor_refill | 6.99 | | subscription:One-time purchase razor_refill_cartridge_every_month | 4-blade razor refill (every month) | razor_refill | 6.99 | 5.99 | subscription:Deliver every month ``` -------------------------------- ### API Documentation for product_type Attribute Source: https://developers.facebook.com/docs/commerce-platform/catalog/fields Documents the 'product_type' attribute, used to categorize items according to a business's internal system or Google product categories. It specifies the maximum character limit and provides an example of a typical product category path. ```APIDOC Attribute: product_type Type: string Description: Category the item belongs to, according to your business's product categorization system, or a Google product category. For commerce, represents the product category in your internal system. Constraints/Details: - Max character limit: 750. Example: - Home & Garden > Kitchen & Dining > Appliances > Refrigerators ``` -------------------------------- ### Projector Product Attributes Reference Source: https://developers.facebook.com/docs/commerce-platform/catalog/categories/electronics Detailed reference for all supported attributes for projector products, including data types, descriptions, and examples for populating product feeds on a commerce platform. ```APIDOC Projector Attributes: bluetooth_technology: Type: string Description: Describes the version type of the compatible bluetooth. Sample values: Bluetooth 4.0 aspect_ratio: Type: string Description: Relationship between the product's width and its height. Sample values: 4:3, 16:9 audio_features: Type: list of strings Description: Describes whether the product has certain special audio features. To provide multiple values using a single feed audio_features field, the acceptable input format is 'Surround Sound', 'Noise Cancelling', 'High Fidelity'. To provide multiple values with one value per feed field, use feed field names, such as audio_features[0],audio_features[1]. For example, the acceptable attribute value input format for fields such as this is Surround Sound. Sample values: Surround Sound, Noise Cancelling, High Fidelity audio_power_output: Type: number/float Description: Power of the audio output of the device's speakers, measured in watts. Sample values: 5, 7.5 backlight_technology: Type: string Description: Power of the audio output of the device's speakers, measured in watts. Sample values: 5, 7.5 brightness: Type: number/float Description: Brightness per bulb measured in lumens. Sample values: 2000, 5000 connector_type: Type: list of strings Description: Type(s) of connections supported for the item. To provide multiple values using a single feed connector_type field, the acceptable input format is 'HDMI', 'RCA. To provide multiple values with one value per feed field, use feed field names, such as connector_type[0], connector_type[1]. For example, the acceptable attribute value input format for fields such as this is HDMI. Sample values: HDMI, RCA is_assembly_required: Type: boolean Description: Indicates if the product arrives unassembled and must be put together before use. Sample values: Yes, No lamp_life: Type: number/float Description: Expected life of the projection lamp in hours. Sample values: 6500, 10000 maximum_contrast_ratio: Type: string Description: Ratio between the luminance of the brightest color to that of the darkest color capable of being displayed. Sample values: 20,000:1, 30,000,000:1 product_weight: Type: string Description: Weight of the fully assembled product. The first part is the number. The second part is one of the accepted units: mg, g, kg, oz, lb. Sample values: 5 lb, 3 kg refresh_rate: Type: float Description: Refresh rate of the display. This measures the number of times the picture is updated per second, measured in Hz. The first part is the number. The second part is one of the accepted units: Hz, KHz, MHz, GHz. Sample values: 60 Hz, 120 Hz response_time: Type: float Description: Amount of time it takes for the pixels in a display to change, measured in milliseconds (ms). Sample values: 5, 2 screen_size: Type: string Description: Measurement of the device's screen, typically measured diagonally in inches. The first part is the number. The second part is one of the accepted units: mm, cm, m, in, ft. Sample values: 42 in, 5.5 in standard_features: Type: list of strings Description: Standard features related to the item. To provide multiple values using a single feed standard_features field, the acceptable input format is '35mm Jack', 'Bluetooth', 'Integrated Speakers', 'Touchscreen', 'USB Connectivity', 'WLAN', '3D', 'Energy Star Certified', 'Portable', 'Smart'. To provide multiple values with one value per feed field, use feed field names, such as standard_features[0], standard_features[1]. For example, the acceptable attribute value input format for fields, such as 35mm Jack. Sample values: 35mm Jack, Bluetooth, Integrated Speakers, Touchscreen, USB Connectivity, WLAN, 3D, Energy Star Certified, Portable, Smart throw_ratio: Type: string Description: Number of times your monitor updates with new images each second. Sample values: 1.8:1, 2.0:1 usb_technology: Type: string Description: Describes the version of USB technology designated for the product. Sample values: USB 2.0, USB 3.0 usb_type: Type: string Description: Describes the type of USB connector designated for the product. Sample values: USB-C, Micro USB video_resolution: Type: float Description: Describes the resolution of the video recordings of the product. Measured in megapixels (MP). 1080p is 2 MP, UHD and 4K is 8 MP. Sample values: 24 ``` -------------------------------- ### Example Product Catalog Attributes Source: https://developers.facebook.com/docs/commerce-platform/catalog/overview A tabular representation of required and optional product attributes for items within a Facebook catalog, including unique identifiers, descriptive fields, inventory, and pricing information. Each row represents a unique product variant. ```text id | title | gender | size | color | inventory | price | item\_group\_id | 0475-S | T-Shirt | Unisex | S | Black | 35 | 7.43 | 0475 | 0475-M | T-Shirt | Unisex | M | Black | 125 | 7.43 | 0475 | 0475-L | T-Shirt | Unisex | L | Black | 12 | 7.43 | 0475 | 0883 | Shorts | Unisex | | | 3 | 26.55 | 0883 ``` -------------------------------- ### Create Shops Ads Ad Set with CONVERSIONS Objective Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating an ad set for Shops ads, linked to a campaign with the `CONVERSIONS` objective. It specifies `WEBSITE` as destination type, optimizes for `PURCHASE` via Meta Pixel, and sets a bid strategy. ```curl curl \ -F 'name=Conversion Adset' \ -F 'bid_amount=3000' \ -F 'billing_event=IMPRESSIONS' \ -F 'daily_budget=15000' \ -F 'bid_strategy=LOWEST_COST_WITHOUT_CAP' \ -F 'campaign_id=' \ -F 'targeting={"geo_locations": {"countries":["US"]}}' \ -F 'destination_type=WEBSITE' \ -F 'promoted_object={"pixel_id": , "custom_event_type": "PURCHASE"} -F 'status=PAUSED' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/adsets ``` -------------------------------- ### Create Ad Creative with WEBSITE_AND_SHOP Destination Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating an ad creative for Facebook Ads, setting the `destination_spec` to `WEBSITE_AND_SHOP`. This creative includes a 'SHOP_NOW' call to action and a link. ```curl curl -i -X POST \\ "https://graph.56617.od.facebook.com/v23.0/act_id/adcreatives?access_token=%7Baccess_token%7D&destination_spec=%7B%22destination_type%22%3A%22WEBSITE_AND_SHOP%22%7D&name=My%20creative%20title&object_story_spec=%7B%22link_data%22%3A%7B%22call_to_action%22%3A%7B%22type%22%3A%22SHOP_NOW%22%7D%2C%22link%22%3A%22example.org%22%7D%2C%22page_id%22%3A%22PAGE_ID%22%7D" ``` -------------------------------- ### Create Campaign with PRODUCT_CATALOG_SALES Objective (Non-ODAX) Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating a Facebook Ads campaign using the `PRODUCT_CATALOG_SALES` objective. This campaign type is suitable for promoting products from a catalog and is not part of ODAX objectives. ```curl curl \ -F 'name=Product Catalog Sales Campaign' \ -F 'objective=PRODUCT_CATALOG_SALES' \ -F 'promoted_object={"product_catalog_id":""}' \ -F 'status=PAUSED' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/campaigns ``` -------------------------------- ### Example JSON Response for Commerce Platform Orders Source: https://developers.facebook.com/docs/commerce-platform/order-management/acknowledgement-api This JSON object illustrates a sample response for a list of orders, showing an order in 'IN_PROGRESS' state and another with an 'Invalid Order ID' error. ```JSON { "orders": [ { "id": "64000841790004", "state": "IN_PROGRESS" }, { "id": "10100677592885259", "error": { "error_code": 2361003, "error_message": "Invalid Order ID" } } ] } ``` -------------------------------- ### Product Set Collection API: Example Payload for POST Request Source: https://developers.facebook.com/docs/commerce-platform/catalog/collections Illustrates a JSON payload for creating or updating a product set, including its name, filter criteria for products, metadata (cover image URL, external URL, description), and an array of shop IDs to publish the product set to. ```json { "name": "Best sellers", "filter": { "retailer_id": { "is_any": [ "pid1", "pid2" ] } }, "metadata": { "cover_image_url": "https://foo.com/image.jpg", "external_url": "https://foo.com/best-sellers", "description":"Our best selling products" }, "publish_to_shops": [{"shop_id": "shop_id1"}, {"shop_id": "shop_id2"}] } ``` -------------------------------- ### Create PRODUCT_CATALOG_SALES Campaign with OUTCOME_SALES Objective (ODAX) Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating a Facebook Ads campaign for `PRODUCT_CATALOG_SALES` with the `OUTCOME_SALES` objective, which is part of ODAX objectives. This includes specifying `special_ad_categories`. ```curl curl \ -F 'name=Conversion Campaign' \ -F 'objective=OUTCOME_SALES' \ -F 'promoted_object={"product_catalog_id":""}' \ -F 'status=PAUSED' \ -F 'special_ad_categories=[]' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/campaigns ``` -------------------------------- ### Create Campaign with CONVERSIONS Objective (Non-ODAX) Source: https://developers.facebook.com/docs/commerce-platform/migrate-to-simplified-shops-ads-api Example of creating a Facebook Ads campaign using the `CONVERSIONS` objective. This campaign type is designed to drive specific actions on your website or app and is not part of ODAX objectives. ```curl curl \ -F 'name=Conversion Campaign' \ -F 'objective=CONVERSIONS' \ -F 'status=PAUSED' \ -F 'access_token=' \ https://graph.facebook.com/v22.0/act_/campaigns ``` -------------------------------- ### Sample JSON Response for Product Feed Upload Sessions Source: https://developers.facebook.com/docs/commerce-platform/catalog/feed This JSON snippet shows the expected structure of the response when querying for recent product feed upload sessions. It includes the upload session ID, start time, and end time. ```JSON { "data": [ { "id": "{UPLOAD_SESSION_ID}}", "start_time": "2019-07-15T12:38:36+0000", "end_time": "2019-07-15T12:38:47+0000" } ] } ``` -------------------------------- ### API Documentation for Camera Product Attributes Source: https://developers.facebook.com/docs/commerce-platform/catalog/categories/electronics Detailed reference for the attributes used to define camera products in a commerce platform feed. Each attribute includes its data type, a description of its purpose, and examples of valid input values. Special instructions for handling multiple values are also provided. ```APIDOC Cameras Product Attributes: battery_life: Type: integer Description: Maximum run time or life of the item's battery, measured in hours. Sample Values: 8, 12, 24 compatible_devices: Type: list of strings Description: Devices compatible with the item. Sample Values: iPad, Tablet Computers, Windows Desktop Computers, Apple Computers Input Format for Multiple Values: Single Feed Field: 'iPad', 'Tablet Computers', 'Windows Desktop Computers', 'Apple Computers' Multiple Feed Fields: compatible_devices[0], compatible_devices[1] (e.g., compatible_devices[0] = 'iPad') connector_type: Type: list of strings Description: Type(s) of connections supported for the item. Sample Values: HDMI, RCA Input Format for Multiple Values: Single Feed Field: 'HDMI', 'RCA' Multiple Feed Fields: connector_type[0], connector_type[1] (e.g., connector_type[0] = 'HDMI') display_technology: Type: string Description: Type of technology that powers the display, such as LED or LCD. Sample Values: OLED, LED, LCD flash_type: Type: string Description: Type of flash the camera has or can accommodate. Sample Values: Built-in Camera, Hammerhead Flash, Macro Ring Light Flash, Pop-up Flash focal_length: Type: number/float Description: On a camera or lens, the distance between the image sensor and the lens when the subject is in focus, usually stated as a range in millimeters. Sample Values: 18 focal_ratio: Type: string Description: Ratio of the lens's focal length, to the diameter of the entrance pupil. Also known as the "f-number" or "f-stop", this number indicates lens speed. Sample Values: f/5, f/6 lens_coating: Type: list of strings Description: Type of thin layer of material applied to the surface of lenses or other optical elements that provide specific effects. Multiple values accepted. Sample Values: Scratch-Resistant, Mirrored, Dielectric Input Format for Multiple Values: Single Feed Field: 'Scratch-Resistant', 'Mirrored', 'Dielectric' Multiple Feed Fields: lens_coating[0], lens_coating[1] (e.g., lens_coating[0] = 'Scratch-Resistant') lens_diameter: Type: number/float Description: Measurement of the diameter of the front portion of the lens, measured in "mm". Sample Values: 49, 52 lens_filter: Type: string Description: Kind of filter attached to a lens. Sample Values: Cooling, Graduated Neutral Density, Polarizing, UV maximum_aperture: Type: string Description: Size of the largest aperture this item accommodates; typically expressed in f-numbers. Sample Values: f/1.4, f/6 maximum_shutter_speed: Type: number/float Description: Maximum shutter speed of the item. Measured in 1/seconds. For 1/4000, specify 4000. Sample Values: 4000 minimum_aperture: Type: string Description: Smallest aperture this item accommodates; typically expressed in f-numbers. Sample Values: f/16 minimum_shutter_speed: Type: float Description: Minimum shutter speed of the item, measured in seconds. Sample Values: 250 product_height: Type: string Description: Height of the fully assembled product. This may be separate from the seat_height and seat_back_height attributes. The first part is the number. The second part is one of the accepted units: mm, cm, m, in, ft. Sample Values: 5 in, 2 ft, 60 cm product_length: Type: string Description: Length of the fully assembled product. The first part is the number. The second part is one of the accepted units: mm, cm, m, in, ft. Sample Values: 5 in, 2 ft, 60 cm product_width: Type: string Description: Width of the fully assembled product. The first part is the number. The second part is one of the accepted units: mm, cm, m, in, ft. Sample Values: 5 in, 2 ft, 60 cm screen size: Type: integer Description: Measurement of the device's screen, typically measured diagonally in inches. The first part is the number. The second part is one of the accepted units: mm, cm, m, in, ft. Sample Values: 42 in, 5.5 in, 100 cm self-timer_delay: Type: number/float Description: Length of time the self-timer allows before it takes a photo, measured in seconds. Sample Values: 2, 10 ``` -------------------------------- ### Retrieve Sample Product Feed Upload Errors and Warnings Source: https://developers.facebook.com/docs/commerce-platform/catalog/feed-api This snippet shows how to fetch a sampling of errors and warnings for a specific product feed upload session using its ID. It provides examples in cURL, HTTP, PHP SDK, and JavaScript SDK. The response details error summaries, descriptions, severities (fatal/warning), and sample affected items. ```cURL curl -X GET -G \ -d 'access_token=' \ https://graph.facebook.com/{UPLOAD_SESSION_ID}/errors ``` ```HTTP GET /{UPLOAD_SESSION_ID}/errors HTTP/1.1 Host: graph.facebook.com ``` ```PHP /* PHP SDK v5.0.0 */ /* make the API call */ try { // Returns a `Facebook\FacebookResponse` object $response = $fb->get( '/{UPLOAD_SESSION_ID}/errors', '{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 */ ``` ```JavaScript /* make the API call */ FB.api( "/{UPLOAD_SESSION_ID}/errors", function (response) { if (response && !response.error) { /* handle the result */ } } ); ``` ```JSON { "data": [ { "id": 1510567479166488, "summary": "A required field is missing: price.", "description": "Products need to have prices to run in ads. Include a price for each product in your data feed file and upload it again. Prices must include cost and an ISO currency code (for example: 10 USD instead of $10 for American dollars).", "severity": "fatal", "samples": { "data": [ { "row_number": 2, "retailer_id": "yj9bpbpub5t8t22kgbq6", "id": "1677559492523068" }, { "row_number": 5, "retailer_id": "ujn33tvbyv2vmdpo7ecb", "id": "1529743440653137" } ] } }, { "id": 275241589314958, "summary": "GTIN is incorrectly formatted", "description": "Check that the GTIN (Global Trade Identification Number) for each of your products is in the correct format. Accepted types include UPC, EAN, JAN, and ISBN.", "severity": "warning", "samples": { "data": [ { "row_number": 4, "retailer_id": "bxwb1pho9o43uxjxikcg", "id": "538700559625644" } ] } } ] } ``` -------------------------------- ### Upload Products to Product Feed API Source: https://developers.facebook.com/docs/commerce-platform/catalog/feed Demonstrates how to programmatically upload products to a Facebook product catalog using the Product Feed API. Examples are provided for cURL, HTTP, PHP SDK, and JavaScript SDK, showing how to initiate the POST request to the /{PRODUCT_CATALOG_ID}/product_feeds endpoint. ```curl curl -X POST \ -F 'access_token=' \ https://graph.facebook.com/{PRODUCT_CATALOG_ID}/product_feeds ``` ```http POST /{PRODUCT_CATALOG_ID}/product_feeds HTTP/1.1 Host: graph.facebook.com ``` ```php /* PHP SDK v5.0.0 */ /* make the API call */ try { // Returns a `Facebook\FacebookResponse` object $response = $fb->post( '/{PRODUCT_CATALOG_ID}/product_feeds', array (), '{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 */ ``` ```javascript /* make the API call */ FB.api( "/{PRODUCT_CATALOG_ID}/product_feeds", "POST", function (response) { if (response && !response.error) { /* handle the result */ } } ); ``` -------------------------------- ### Appliance Product Attributes Reference Source: https://developers.facebook.com/docs/commerce-platform/catalog/categories/home Details the various attributes available for describing appliance products within the Facebook Commerce Platform. Each attribute includes its data type, a detailed description of its purpose, and examples of acceptable values or formats for submission. ```APIDOC Attribute: additional_features Type: list of strings Description: Special features related to your item that might be important for buyers. To provide multiple values using a single feed additional_features field, the acceptable input format is 'LED Lighting', 'Built-in Lock', 'WiFi Connect', 'Customizable Shelving'. Sample Values: 'LED Lighting', 'Built-in Lock', 'WiFi Connect', 'Customizable Shelving' Attribute: btu Type: number/float Description: Number of British Thermal Units (BTUs) for heating and cooling appliances. Sample Value: 10,200 Attribute: fuel_type Type: string Description: Type of fuel used to power certain appliances. Sample Values: Electric, Gas, Dual Attribute: is_set Type: boolean Description: Indicates if the product contains 2 or more different items that are sold as part of a set. Sample Values: Yes, No Attribute: load_position Type: string Description: Type of load position for washers and dryers. Sample Values: Top Load, Front Load Attribute: number_of_burners Type: integer Description: Number of burners included in the product. Sample Values: 2, 3, 4 Attribute: number_of_doors Type: integer Description: Number of doors included in the product. Sample Values: 1, 2, 4 Attribute: number_of_shelves Type: integer Description: Number of shelves included in the product. Sample Values: 2, 4, 8 Attribute: power_type Type: string Description: Indicates the type of power source used by the item (power cord or batteries). Sample Values: Battery, Hardwired, Plug-In Attribute: product_weight Type: string Description: Weight of the fully assembled product. The first part is the number. The second part is one of the accepted units: mg, g, kg, oz, lb. Sample Values: 45 lb, 120 lb, 54 kg, 80 kg Attribute: smart_home_compatibility Type: string Description: Type of Smart Home devices that the product is compatible with. Sample Values: Amazon Alexa, Google Assistant, Nest, Samsung SmartThings, WeMo, Philips Hue, Apple HomeKit, Logitech Harmony Attribute: sound_rating Type: integer Description: Sound decibel rating for the noise level of the appliance. Sample Values: 44, 46, 48, 50 Attribute: standard_features Type: list of strings Description: Standard features related to the item. To provide multiple values using a single feed standard_features field, the acceptable input format is 'Automatic Shut Off', 'Energy Star-Certified', 'Bluetooth Compatible', 'Industrial', 'Remote Control Included', 'Wi-Fi Compatible'. Note: The value inputs listed for standard_features are not sample values. They are the only inputs that are accepted. Sample Values: Automatic Shut Off, Energy Star-Certified, Bluetooth Compatible, Industrial, Remote Control Included, Wi-Fi Compatible Attribute: volts Type: string Description: Number of volts the product produces or requires. Also known as "Voltage". The first part is the number. The second part is one of the accepted units: V, KV. Sample Values: 220 V, Input 100 VAC, Output 12VDC Attribute: watts Type: number/float Description: Number of watts the product process or requires. Also known as "Wattage". The first part is the number. The second part is one of the accepted units: W, KW, MW, GW. Sample Values: 400 W, 1500 W ```