The Commerce API is in a closed, invite-only Beta program. Please work with your Facebook representative to get access if you have been invited to the program.
Go to Facebook for developers and lick My Apps > Create App. You can also use an existing app.
We recommend using access tokens backed by a system user to access the Commerce API. An access token obtained from a typical user can be invalidated after a period of time, or if that user changes their Facebook password.
Assign your system user admin access to the following assets in your Business Manager:
You can only use the system user's access token can to access assets assigned to the system user. Once you set up your production commerce account, make sure that you also assign the system user to the relevant assets.
On the Business Manager > System User page, click Add Assets and assign the system user as an admin of your app.
Click Generate Token to generate an access token.
Request the following permissions when you generate the access token:
pages_read_engagementneeded for generating a Page Access Token later
catalog_managementif you plan to use API to manage catalogs
business_managementif you plan to use API to manage business assets
Use the Access Token Debugger tool to verify that your access token has the required permissions.
If you were granted access to the Commerce API after Oct 20, 2020, you need to also request these permissions:
commerce_account_read_reportsto access the Finance Reporting API
Before your app is approved by App Review, your app can only access a test commerce account, so make sure you generate a Page access token for the Facebook Page backing your test commerce account.
Every commerce account is backed by a Facebook Page. To access a commerce account via the API, you need a Page access token tied to that page. A Page access token is obtained from a User access token who is an admin of the Page.
Learn how to obtain a Page access token using the System User access token. This access token never expires, unless you invalidate it in Business Manager. Store this token securely and consider rotating it on a regular basis.
If you are a platform building an integration for your clients or sellers, you need to build a Facebook Login flow so that you can generate this access token on behalf of their pages. For a complete list of topics for platform integrations, see Platform Integration.
Make a one-time API call to connect your app to your test commerce account. You must first make this call to connect your app to any new Commerce account you want to manage with the app.
Begin managing your orders placed in your test commerce account using the Order Management API.
Once you demonstrate your integration on a test account, submit your app for App Review to manage a real commerce account.
If you are a platform that builds integration for your sellers, you need to build an onboarding flow that automates steps 2 to 5 so that you can make API calls on the seller's behalf. Learn more about Platform Integration and Seller Onboarding.