To understand the commerce setup for a seller, consider confirming what assets are used:
CMS-ID is a Commerce Merchant Settings ID for commerce integration.
If you are using a Commerce Manager redirect, this ID should be returned in the redirection parameters. Alternatively, you can ask a seller to provide your ID or pull CMS-ID from the business object.
A seller can find the CMS-ID by logging into Facebook Commerce Manager and then selecting the commerce account. The seller will be redirected to www.facebook.com/ commerce_manager/{CMS-ID}.
Pulling CMS-ID from the business object:
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{business-id}/fields=commerce_merchant_settings
GET /{business-id}/fields=commerce_merchant_settings HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{business-id}/fields=commerce_merchant_settings',
'{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 */
/* make the API call */
FB.api(
"/{business-id}/fields=commerce_merchant_settings",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
{ "id": "123456789" }
If your seller has more than one commerce merchant settings you can query Instagram channel or page name to verify where orders are coming from.
You can read a seller's settings by ID. The onsite_commerce_merchant field is only returned for Shops configured for onsite Checkout.
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{CMS-ID}?fields=merchant_page,product_catalogs
GET /{CMS-ID}?fields=merchant_page,product_catalogs HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{CMS-ID}?fields=merchant_page,product_catalogs',
'{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 */
/* make the API call */
FB.api(
"/{CMS-ID}?fields=merchant_page,product_catalogs",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
Shop configured for onsite Checkout:
{ "merchant_page": { "id": "4040", "name": "Checkout Page" }, "product_catalogs": { "data": [ { "id": "33799", "name": "Products for Checkout" } ] }, "id": "1234567890" }
Shop not configured for onsite Checkout (old Shops API):
{ "id": "1234567890" }
Otherwise a relevant error message will be returned.
To get a seller business ID, you need to know either the page or catalog IDs from them (you can get these IDs from CMS-ID). Both catalog and page objects have business edge that can provide you information about the business.
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{Page-ID}?fields=business
GET /{Page-ID}?fields=business HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{Page-ID}?fields=business',
'{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 */
/* make the API call */
FB.api(
"/{Page-ID}?fields=business",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
{ "business": { "id": "1234567890123", "name": "A merchant business name" }, "id": "1234567890" }
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{CMS-ID}?fields=facebook_channel
GET /{CMS-ID}?fields=facebook_channel HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{CMS-ID}?fields=facebook_channel',
'{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 */
/* make the API call */
FB.api(
"/{CMS-ID}?fields=facebook_channel",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
{ "facebook_channel": { "pages": { "data": [ { "name": "Checkout Page", "id": "4040" } ] } }, "id": "123456789890" }
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{CMS-ID}?fields=instagram_channel
GET /{CMS-ID}?fields=instagram_channel HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{CMS-ID}?fields=instagram_channel',
'{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 */
/* make the API call */
FB.api(
"/{CMS-ID}?fields=instagram_channel",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
{ "instagram_channel": { "instagram_users": { "data": [ { "id": "1234" } ] } }, "id": "123456789890" }
In order to check if a commerce account setup as offsite or onsite use the commerce merchant settings parameter cta
.
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{merchant-settings-id}/?fields=cta,setup_status
GET /{merchant-settings-id}/?fields=cta,setup_status HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{merchant-settings-id}/?fields=cta,setup_status',
'{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 */
/* make the API call */
FB.api(
"/{merchant-settings-id}/?fields=cta,setup_status",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Sample Response
{ "cta": "ONSITE_CHECKOUT" }
There are few statuses that are required to see if the seller is correctly set up.
First check that shop_setup
field must be in SETUP
state.
Lack of payment setup is indicated in the payment_setup
field.
Shops will not be visible to public unless review_status
is in APPROVED
state. See review_status_code
for details.
We recommend checking facebook_channel
and instagram_channel
to see that Facebook Shops and Instagram Shopping channels are enabled. For more details see Facebook channel and Instagram channel.
Separately to commerce setup seller Instagram account must be approved for the Shopping functionality, otherwise there will be no distribution of the seller products on Instagram and no commerce orders. Instagram Shopping approval status is no part of commerce API.
Sample Request
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{merchant-settings-id}/?fields=setup_status
GET /{merchant-settings-id}/?fields=setup_status HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{merchant-settings-id}/?fields=setup_status',
'{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 */
/* make the API call */
FB.api(
"/{merchant-settings-id}/?fields=setup_status",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Response
Attribute | Type | Description |
---|---|---|
| Status of the Commerce account. | |
| Status of the seller payment details. | |
| Status of Facebook's seller integrity review. |
shop_setup_status
Value | Description |
---|---|
| |
| |
| |
| |
| |
|
payment_setup_status
Value | Description |
---|---|
| |
| |
| |
|
review_status
Attribute | Type | Description |
---|---|---|
| Enum representing review status. | |
| Array of | If the review status is |
review_status_code
Value | Description |
---|---|
| |
| Sellers need to wait for the review to complete for their Shops to be visible to public. The process can take up to 28 days. |
| Rejected sellers have to delete the CMS and set up with different credentials such as bank account. |
| Integrity review was waived |
review_status_reason
Attribute | Type | Description |
---|---|---|
| String | Enum representing rejection reason. Possible values are |
| String | Description of rejection reason. |
| String | A link to view more details about the review and rejection. |
Sample Response
{ "data": [ { "shop_setup": "SETUP", "payment_setup": "SETUP", "review_status": { "status": "REJECTED", "reasons": [ { "code": "UNKNOWN", "message": "Your account is not eligible for Facebook Shops at this time.", "help_url": "https://www.facebook.com/help/contact/481136396104354" } ] } } ] }