After the user installs the Facebook Business Extension, and you have their user access token (which is used to make API calls for the user), you need to get the pixel ID, Instagram Business ID, Page ID, Business Manager ID, Ad Account ID, Catalog ID (optional) or access token from the user to configure the relevant features. These IDs will be used for API endpoints and business configurations.
With the OBO solution, the client can get the access token, using the partner Business Manager's admin system user's access token as well, instead of only the client Business Manager's admin's access token.
Here's how you get that information:
After a user installs FBE, the extension generates an employee system user on the client's Business Manager. Naming for this new system user follows the schema {App Name} System User (FBE)
.
System users represent servers or software that make API calls to assets owned or managed by a Business Manager.
This system user has permissions to all associated FBE assets with the following task permissions:
'MANAGE'
'MANAGE'
'MANAGE'
'EDIT'
If you receive a user access token through a Webhook or the Business Login after a FBE install, you can use that same token to get the Business Manager's system user access token. To do that, make the following API call:
curl -X POST \ -F 'app_id={app_id}' \ -F 'scope={permissions}' \ -F 'access_token={access_token}' \ -F 'fbe_external_business_id={fbe_external_business_id}' \ https://graph.facebook.com/<API_VERSION>/<client_business_manager_id>/access_token
For the scope
field, use the manage_business_extension
permission, but depending of your use case, also ads_management
or catalog_management
might be needed.
For the access_token
field, you can pass a user access token (user_access_token
) or a Partner Business Manager's Admin System User Access Token (partner_bm_admin_system_user_token
). Learn more about Business Access Token.
token_type
field from Webhook indicates whether the access_token
received is user access token or a system user access token.
If the user is installing FBE via Instagram, the Webhook will return the system user's token that was generated on the client Business Manager, so you don't need to call this API.
To receive prompt updates about installations, uninstallations, and reconfigurations of FBE, we fire Webhook events each time one of your businesses installs, modifies, or uninstalls FBE.
Each time a user installs or modifies FBE, your app should inspect the Webhook configuration to understand what assets the user has modified, added, or removed from their connection with your app. Your app's behavior should update based on the most current connected assets.
GET
) and Event Notifications (POST
).fbe_install
webhook will be automatically subscribed. The card also features a toggle switch which can be used to deactivate the subscription if the need arises.Each time an install webhook is received, your app needs to perform the following actions.
Perform the following steps at uninstall:
Response Fields
Field | Description |
---|---|
ad_account_id Type: string | Ad account ID selected by the user within FBE. You can use this ad account to manage ads if your app has |
business_manager_id Type: string | Business Manager ID used for FBE.
See the connected assets of the |
catalog_id Type: string | Catalog ID selected by a user with FBE. A user can use this ID to manage their product catalog.
See the connected assets of the |
fbe_event Type: string | FBE Event that indicates whether the event notification is an install or uninstall.
See the connected assets of the |
flow Type: string | Flow that indicates which flow a user onboarded with (for example |
commerce_merchant_settings_id Type: string | Commerce Merchant Settings ID used to enable partners to read information regarding the selected FBE Commerce Merchant Settings.
See the connected assets of the |
onsite_eligible Type: boolean | Commerce onsite eligibility. Indicates whether the selected assets are eligible for onsite commerce. The merchant must still have intent for onsite and select returns/shipping/payments on the partner site.
See the connected assets of the |
profiles Type: array | List of profiles (a Facebook Page ID and/or an Instagram Business Profile ID). Use these IDs to create separate Graph API requests for other Facebook integrations you may have. See the connected assets of the |
pages Type: array | List of Facebook Page IDs. Use these IDs to create separate Graph API requests for other Facebook Page integrations you may have.
See the connected assets of the |
instagram_profiles Type: array | List of Instagram Business profile IDs. Use these IDs to create separate Graph API requests for other Facebook/Instagram integrations you may have. If the field is not included, this means it's only Instagram-related scope. For example, |
pixel_id Type: string | Unique pixel ID for this business that you should store and use to fire pixel events.
See the connected assets of the |
token_type Type: string | Token type. Indicates whether the |
installed_features Type: array | List of features this business has integrated with/installed through the onboarding flows. See the current feature list. |
feature_instance_id Type: array | ID that uniquely represents each installed feature. Can be used in the future to modify or uninstall a particular instance. It is the same as the |
feature_type Type: string | Type of the feature installed. The feature list table has the entire set of features available. You only need to track the features you have enabled. |
connected_assets Type: array | List of assets that are specific and relevant to each feature. Asset descriptions correspond to the ones mentioned at the top of this table. |
additional_info Type: array | Additional information about the connected feature. |
When you receive a Webhook event for a new installation, you must: 1) maintain a mapping of business_id
to its pixel_id
since pixel ID is unique for that business and you should use to fire standard pixel events and 2) update the inventory for that business using one of the Catalog PUSH APIs, if enabled.
onsite_commerce_eligible
field{ "data": [{ "ad_account_id": "<ad_account_id>", "business_manager_id": "<business_manager_id>", "catalog_id": "<catalog_id>", "commerce_merchant_settings_id": "<commerce_merchant_settings_id>", "onsite_eligible": true, "profiles": [ "<page_id>", "<instagram_profile_id>" ], "pages": [ "<page_id>" ], "instagram_profiles": [ "<instagram_profile_id>" ], "pixel_id": "<pixel_id>", "token_type": "<token_type>", "installed_features": [ { "feature_instance_id": "<unique_id>", "feature_name" : string, "feature_type": enum, "connected_assets": { "ad_account_id": "<ad_account_id>", "business_manager_id": "<business_manager_id>", "catalog_id": "<catalog_id>", "commerce_merchant_settings_id": "<commerce_merchant_settings_id>", "ig_profile_id": "<instagram_profile_id>" "page_id": "<page_id>", "pixel_id": "<pixel_id>", }, "additional_info": { "onsite_commerce_eligible": bool }, { "shop_status": array }, { "shop_status_info": array } } ] }] }
For any business that has installed FBE, you can query for basic installation information (pixel_id
and a list of profiles with an IG Business ID and/or Page ID
) using the following endpoint:
CURL -X GET 'https://graph.facebook.com/<API_VERSION>/fbe_business/fbe_installs?fbe_external_business_id=<fbe_external_business_id>&access_token=<access_token>'
{ "data": [{ "token_type": "<token_type>" "installed_features": [ { "feature_instance_id": "<unique_id>", “feature_name” : string, "feature_type": enum, "connected_assets": { “ad_account_id”: "<ad_account_id>", “business_manager_id”: "<business_manager_id>", “catalog_id”: "<catalog_id>", “commerce_merchant_settings_id”: "<commerce_merchant_settings_id>", “ig_profile_id”: "<instagram_profile_id>" "page_id": "<page_id>", "pixel_id": "<pixel_id>", }, "additional_info": { "onsite_commerce_eligible": bool }, { "shop_status": array }, { "shop_status_info": array } } ] }] }
The response includes the following fields. These are now the source of truth in connected assets od “installed_features” list:
Field | Description |
---|---|
Type: string | Token type that indicates whether the |
Type: array | List of features this business has integrated with or installed through the onboarding flows. |
Type: string | Unique ID that represents each installed feature. Can be used in the future to modify or uninstall a particular instance. This is the same as the |
Type: string | Name of unique feature. |
Type: string | Type of feature installed. You only need to track the ones you’ve enabled. |
Type: array | List of assets specific to each feature. |
Type: string | Additional information about the connected feature, including "Active" means the shop is visible. "Inactive_offsite" means the shop is not visible because it is not using onsite checkout. "Inactive_other" means the shop is not visible due to some reason unrelated to checkout style. "No_longer_available" means that this shop is not in the US or a key market and is no longer available. |
The model includes the feature instance ID for each feature and fields that consist of an array of all features of that type installed by the business (example: multiple page CTAs).
For non-customizable features, only a feature instance ID and an enabled flag displays. You can update only the customizable features with a POST
request.
This model is different from the FBE Installation API because it provides additional feature information beyond the connected assets, including enabled status and specific feature customizations. After calling the FBE Installation API, use this API if more information is needed about the feature’s enabled status or configurations.
Read
You can read the current feature configuration status of any business with the following request:
CURL -X GET 'https://graph.facebook.com/<API_VERSION>/fbe_business/?fbe_external_business_id=<fbe_external_business_id>&access_token=<access_token>'
Update
To update all features, use the following POST
request:
CURL -i -X POST \ -F 'fbe_external_business_id=<fbe_external_business_id>' \ -F 'business_config={business_config object}' \ -F 'access_token=<access_token>' "https://graph.facebook.com/<API_VERSION>/fbe_business"
Response
{ "page_cta": { "feature_instance_id": id1, "enabled": true, "cta_button_text": "Book Now", "cta_button_url": "https://partner-site.com/foo-business1", "below_button_text": "Powered by FBE Partner" }, "page_ctas": [ { "feature_instance_id": id1, "enabled": true, "cta_button_text": "Book Now", "cta_button_url": "https://partner-site.com/foo-business1", "below_button_text": "Powered by FBE Partner" }, { "feature_instance_id": id2, "enabled": true, "cta_button_text": "Book Now", "cta_button_url": "https://partner-site.com/foo-business2", "below_button_text": "Powered by FBE Partner" } ], “ig_cta”: {...} "ig_ctas": [{...}, {...}], “ads”: [ { "feature_instance_id": id3, “enabled”: true, }, { "feature_instance_id": id4, “enabled”: true, }, ], ... }