Appearance
Catalog Integration Using Meta Business SDK
Updated: Apr 24, 2025
You can use the Meta Business SDK for Catalog API Integration. It provides an easy way, with boilerplate code, to call available catalog APIs. Meta SDKs are available for Java, Python, Node.js, PHP and Ruby languages.
Requirements
- Application ID -- A unique ID generated for an app during the app creation flow. Learn more.
- Access token -- A string that identifies a user, app, or Page and can be used by the app to make graph API calls. Learn more.
- Catalog ID – Your catalog identifier.
Step 1: Install the SDK
Follow these instructions to install the SDK for your preferred language.
Step 2: Make an API Call
You can make API calls using the objects and functions included in the SDK. Here are some sample API calls:
Upload Products
Select language
PHP SDKNode.js Business SDK
Api::init($app_id, $app_secret, $access_token);
// Create Product Items using Items Batch API
$catalog = new ProductCatalog($catalog_id);
$response = $catalog->createItemsBatch(
array(),
array(
"item_type" => "PRODUCT_ITEM",
"requests" => array(
// Item 1 - Create Item
array(
"method" => "create",
"data" => array(
"id" => "retailer_id_1",
"title" => "Product Title",
"description" => "Product Description",
"brand" => "BrandName",
"price" => "20.00 USD",
"image_link" => "image_url",
"availability" => "in stock",
"link" => "http://productlink.com/product/retailer_id",
)
),
// Item 2 - Update item with retailer_id_2
array(
"method" => "update",
"data" => array(
"id" => "retailer_id_2",
"title" => "Product Title 2",
)
),
// Item 3 - Delete item with retailer_id_3
array(
"method" => "delete",
"data" => array(
"id" => "retailer_id_3",
)
)
)
)
)Fetch Products
Select language
PHP SDKNode.js Business SDK
Api::init($app_id, $app_secret, $access_token);
// Get all products in a catalog
$catalog = new ProductCatalog($catalog_id);
$cursor = $catalog->getProducts();
//$cursor->setUseImplicitFetch(true); Set true for Auto Scroll
while ($cursor->valid()) {
echo $cursor->current()->{ProductItemFields::NAME}.PHP_EOL;
echo $cursor->current()->{ProductItemFields::ID}.PHP_EOL;
$cursor->next();
}
$cursor->end(); // Set cursor to the end of the lst
$cursor->fetchAfter(); // Fetch the next page
$cursor->next(); // Move the cursor to the next item
while ($cursor->valid()) {
echo $cursor->current()->{ProductItemFields::NAME}.PHP_EOL;
echo $cursor->current()->{ProductItemFields::ID}.PHP_EOL;
$cursor->next();
}Learn More
View the Meta Business SDK source code at Github.