To provide local inventory to the Merchant Center, you must first specify which businesses the Merchant Center will be responsible for. You can get the list of possible business groups from the Business Profile via the Content API, but you'll need to request access to the Business Profile first.
Request access to a Business Profile
To request access to your Business Profile, use the
liasettings.requestgmbaccess
method:
POST https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/requestgmbaccess?gmbEmail=admin@example.com
As this example shows, the gmbEmail
query parameter specifies the email
address of the administrator for the Business Profile.
After you call this method, the specified administrator will receive an email asking them to accept or reject the access request. This request expires after 7 days if no action is taken by the administrator.
List the available business groups
Once access has been permitted, you can see which businesses are available by
calling the
liasettings.getaccessiblegmbaccounts
method:
GET https://shoppingcontent.googleapis.com/content/v2.1/12345/liasettings/67890/accessiblegmbaccounts
Response:
200 OK
{
"kind": "content#liasettingsGetAccessibleGmbAccountsResponse",
"accountId": 67890,
"gmbAccounts": [{
"type" : "user",
"email" : "admin@example.com",
"name" : "admin@example.com",
"listingCount": 82
},
{
"type" : "business",
"email" : "california@example.com",
"name" : "Golden-State",
"listingCount" : 20
},
{
"type" : "business",
"email" : "florida@example.com",
"name" : "Sunshine-State",
"listingCount" : 15
},
{
"type" : "business",
"email" : "newyork@example.com",
"name" : "Empire-State",
"listingCount" : 25
}]
}
Specify the business group for the Merchant Center account
Now that you have a list of possible business groups, you need to set the
googleMyBusinessLink
field in the
Accounts
resource associated
with the Merchant Center account to the desired one. For example, if Merchant
Center 67890 will contain products for California-based businesses, you can use
Accounts.update
to set that
information:
PUT https://shoppingcontent.googleapis.com/content/v2/12345/accounts/67890
{
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com"
}
}
Response:
200 OK
{
"kind": "content#account",
"id": 67890,
"googleMyBusinessLink" : {
"gmbEmail": "california@example.com",
"status" : "active"
}
}
Setting the googleMyBusinessLink
field does not require any manual
verification, so the status of the link will be reflected immediately.
Submit product and inventory data
Now that the Merchant Center is associated with a business group, you can
provide local product and local product inventory data for those businesses.
For this, you use the same methods, such as
products.insert
that you
use to upload online products and inventory data.
For products.insert
, you'll specify a channel of local
instead of online
.