Create a Catalog

You can create one catalog for different use cases or you can create multiple catalogs, including catalogs for different languages and countries. Use Catalog Manager to create and manage your catalogs.

If you manage multiple catalogs for different businesses or want an agency to access your catalogs, you may need to set up Business Manager.

To create a catalog for dynamic ads:

curl -X POST \ -F 'name="Test Catalog"' \ -F 'access_token=<ACCESS_TOKEN>' \{business-id}/owned_product_catalogs
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const Business = bizSdk.Business; const ProductCatalog = bizSdk.ProductCatalog; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'Test Catalog', }; const owned_product_catalogs = (new Business(id)).createOwnedProductCatalog( fields, params ); logApiCallResult('owned_product_catalogs api call complete.', owned_product_catalogs);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\Business; use FacebookAds\Object\ProductCatalog; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'Test Catalog', ); echo json_encode((new Business($id))->createOwnedProductCatalog( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from import Business from facebook_business.adobjects.productcatalog import ProductCatalog from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'Test Catalog', } print Business(id).create_owned_product_catalog( fields=fields, params=params, )
import*; import; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new Business(id, context).createOwnedProductCatalog() .setName(\"Test Catalog\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end business = FacebookAds::Business.get(id) owned_product_catalogs = business.owned_product_catalogs.create({ name: 'Test Catalog', })

To use the Catalog Batch API, you need the appropriate Marketing API Access Level and must accept the Terms of Service by creating your first catalog through Business Manager. See Catalog Reference.