OmnichannelSettings API is the entry point to configuring your Local Inventory Ads (LIA) and Free Local Listings (FLL) programs.
Use it to programmatically
- Manage (create and update) omnichannel settings
- Fetch (get and list) omnichannel settings
- Request inventory verification for eligible merchants
For more information, see Local inventory ads and free local listings overview.
Prerequisites
You should have
a Merchant Center account
a Business Profile. If you don't have one, you can create one. See Sign up for a Business Profile.
A link between your Business Profile and your Merchant Center account. To create the link, you can use the Merchant Center user interface or Merchant API (see Link a Google Business Profile).
Create an omnichannel setting
You can use the omnichannelSettings.create
method to create an omnichannel
setting. The create method takes an omnichannelSetting
resource as input and
returns the created omnichannel setting, if successful.
When creating, you must fill in both the regionCode
and the
LsfType
:
- OmnichannelSetting is on a per-country basis.
RegionCode
defines the targeted country. Once created, you cannot change it.RegionCode
should follow the naming rule defined by the Common Locale Data Repository (CLDR) project. LsfType
is based on your product page. For details, seeLsfType
.
For more detail, see Change the product page experience for your local inventory ads.
You don't have to fill in all the fields at the creation stage, but can
configure them later instead. To update an existing omnichannelSetting
, see
Update an omnichannel setting.
Here is a sample request if you were to choose MHLSF_BASIC
and enroll
inStock
:
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/omnichannelSettings
{
"regionCode": "{REGION_CODE}",
"lsfType: "MHLSF_BASIC",
"inStock": {
"uri": "{URI}"
}
}
Replace the following:
{ACCOUNT_ID}
: The unique identifier of your Merchant Center account{REGION_CODE}
: A region code as defined by CLDR{URI}
: A valid URI used for the given review. An ineligible URI may prevent approval.
After the request runs successfully, you should see the following response:
{
"name": "accounts/{ACCOUNT_ID}/omnichannelSettings/{omnichannel_setting}",
"regionCode": "{REGION_CODE}",
"lsfType: "MHLSF_BASIC",
"inStock": {
"uri": "{URI}",
"state": "RUNNING"
}
}
Enrolling different LIA/FLL features using omnichannelSetting
fields triggers
manual reviews that usually require a couple of hours to a couple of days. We
recommend double-checking your inputs to avoid unnecessary waiting time due to
an ineligible data.
To view your newly-created omnichannel setting or check the state of reviews,
use accounts.omnichannelSettings.get
or accounts.omnichannelSettings.list
,
specifying the country.
Local Store Front (LSF) Type
Based on the product page you plan to use, choose an LsfType
:
Product page type | LsfType | Enum value |
---|---|---|
Product pages with in-store availability | Merchant-Hosted Local Store Front Basic | MHLSF_BASIC |
Store-specific product pages with availability and price | Merchant-Hosted Local Store Front Full | MHLSF_FULL |
Product pages without in-store availability | Google-Hosted Local Store Front (GHLSF) | GHLSF |
If you choose Merchant-hosted local store front types, you also need to fill in
the URI field for at least one of inStock
or pickup
.
InStock
You can use InStock to provide more information about your product page.
If you choose Merchant-Hosted LSF types and specify the URI field in InStock, you're showing your intention to serve products with in-stock availability. We will start a review based on the provided URI.
If you choose the GHLSF
type, you need to supply an empty InStock
field in
the request. Unlike Merchant-hosted LSF types, to complete onboarding, you need
to complete the Inventory Verification process.
This code sample creates an omnichannelSetting
with GHLSF
:
package shopping.merchant.samples.accounts.v1beta;
// [START merchantapi_create_omnichannel_setting]
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.AccountName;
import com.google.shopping.merchant.accounts.v1beta.CreateOmnichannelSettingRequest;
import com.google.shopping.merchant.accounts.v1beta.InStock;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSetting.LsfType;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/**
* This class demonstrates how to create an omnichannel setting for a given Merchant Center account
* in a given country
*/
public class CreateOmnichannelSettingSample {
public static void createOmnichannelSetting(Config config, String regionCode) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the retrieved credentials.
OmnichannelSettingsServiceSettings omnichannelSettingsServiceSettings =
OmnichannelSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Calls the API and catches and prints any network failures/errors.
try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
String accountId = config.getAccountId().toString();
String parent = AccountName.newBuilder().setAccount(accountId).build().toString();
// Creates an omnichannel setting with GHLSF type in the given country.
CreateOmnichannelSettingRequest request =
CreateOmnichannelSettingRequest.newBuilder()
.setParent(parent)
.setOmnichannelSetting(
OmnichannelSetting.newBuilder()
.setRegionCode(regionCode)
.setLsfType(LsfType.GHLSF)
.setInStock(InStock.getDefaultInstance())
.build())
.build();
System.out.println("Sending create omnichannel setting request:");
OmnichannelSetting response =
omnichannelSettingsServiceClient.createOmnichannelSetting(request);
System.out.println("Inserted Omnichannel Setting below:");
System.out.println(response);
} catch (Exception e) {
System.out.println("An error has occurred: ");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
// The country which you're targeting at.
String regionCode = "{REGION_CODE}";
createOmnichannelSetting(config, regionCode);
}
}
// [END merchantapi_list_omnichannel_settings]
Pickup
Apart from in-store availability, you can also enhance your in-store products with the Pickup feature, which is only eligible for Merchant-hosted LSF types.
When a product is marked for Pickup, it means that a customer can buy it online
and pick it up at the store. By setting the Pickup
field, you are showing your
intention to serve products with a pickup SLA. We will start a review based on
the provided URI.
Here is a sample request that creates an omnichannel
setting with Pickup
:
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/omnichannelSettings
{
"regionCode": "{REGION_CODE}",
"lsfType: "MHLSF_BASIC",
"pickup": {
"uri: "{URI}"
}
}
On display to order
With the on display to order feature, you can show products that are displayed in your physical store, but not available for immediate purchase. For example, large furniture:
- Customers who are looking for similar products on Google will see these ads with the "in-store" annotation in their search results.
- Customers who are browsing the store on a Google Search result page will see these products marked as "Available to order".
They can choose your local inventory ad or free local listing to view the item. To buy the item, they can visit your physical store, view the item, and then order it to be shipped to them or shipped to your store for pick up.
About (Germany, Austria and Switzerland)
If you're serving in Austria and Germany and choose GHLSF
, you must submit an
About
page.
If you're serving in Switzerland, you must submit an "About" page regardless of
LsfType
.
Until the About page URL is verified, GHLSF
merchants cannot request manual
inventory verification from Google.
For all merchants in these three countries, the service does not enable the FLL/LIA features until your About page receives approval.
Inventory Verification
Inventory Verification is only required for GHLSF
merchants. It is not
supported for MHLSF
types.
Either before or after you add product data and inventory data (either using
accounts.products.localInventories.insert
or the Merchant Center user
interface), you must verify your contact. Provide an inventory verification
contact (name and email address) using the create
or update
method. The
contact will receive an email sent by Google and the ability to verify their
status by clicking a button in the message.
Once you have completed this, you can Request inventory verification. For more information see About inventory verification.
You can change your contact during the verification process or after
verification using omnichannelSetting.update
.
After this process is complete, Google validates the accuracy of the provided information.
Get an omnichannel setting
To retrieve the omnichannelSetting
configuration in a given country, or check
the current status of your reviews, use the omnichannelSettings.get
method.
Here's a sample request:
GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/omnichannelSettings/{OMNICHANNEL_SETTING}
Replace the following:
{ACCOUNT_ID}
: The unique identifier of your Merchant Center account{OMNICHANNEL_SETTING}
: The region code of your targeted country
The ACTIVE
status indicates that the review has received approval.
If the status is FAILED
, address the issues and trigger a new review by
calling omnichannelSetting.update
.
The read-only LFP
field shows your Local Feeds Partnership status. To link to
the partnership, use lfpProviders.linkLfpProvider
.
For more information on checking statuses and their meanings, see View the status of an omnichannel setting.
List omnichannel settings
To retrieve all omnichannelSetting
information for your account, use the
omnichannelSettings.list
method.
Here's a code sample:
package shopping.merchant.samples.accounts.v1beta;
// [START merchantapi_list_omnichannel_settings]
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.AccountName;
import com.google.shopping.merchant.accounts.v1beta.ListOmnichannelSettingsRequest;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceClient.ListOmnichannelSettingsPagedResponse;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/**
* This class demonstrates how to get the list of omnichannel settings for a given Merchant Center
* account
*/
public class ListOmnichannelSettingsSample {
public static void omnichannelSettings(Config config) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the retrieved credentials.
OmnichannelSettingsServiceSettings omnichannelSettingsServiceSettings =
OmnichannelSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
String accountId = config.getAccountId().toString();
String parent = AccountName.newBuilder().setAccount(accountId).build().toString();
// Calls the API and catches and prints any network failures/errors.
try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
ListOmnichannelSettingsRequest request =
ListOmnichannelSettingsRequest.newBuilder().setParent(parent).build();
System.out.println("Sending list omnichannel setting request:");
ListOmnichannelSettingsPagedResponse response =
omnichannelSettingsServiceClient.listOmnichannelSettings(request);
int count = 0;
// Iterates over all the entries in the response.
for (OmnichannelSetting omnichannelSetting : response.iterateAll()) {
System.out.println(omnichannelSetting);
count++;
}
System.out.println(String.format("The following count of elements were returned: %d", count));
} catch (Exception e) {
System.out.println("An error has occurred: ");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
omnichannelSettings(config);
}
}
// [END merchantapi_list_omnichannel_settings]
Update an omnichannel setting
To update the configuration of an existing omnichannel setting use the
omnichannelSettings.update
method.
To update, you must add the feature you want to the update mask, and fill in the
corresponding fields in the omnichannelSetting
field in the update request.
You can update any of
lsfType
inStock
pickup
odo
about
inventoryVerification
If an attribute is not included in the update mask, it won't be updated.
If an attribute is included in the update mask, but not set in the request, it will be cleared.
The following code sample demonstrates how to update the inventory verification field.
package shopping.merchant.samples.accounts.v1beta;
// [START merchantapi_update_omnichannel_setting]
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.protobuf.FieldMask;
import com.google.shopping.merchant.accounts.v1beta.InventoryVerification;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingName;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1beta.UpdateOmnichannelSettingRequest;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/**
* This class demonstrates how to update an omnichannel setting for a given Merchant Center account
* in a given country
*/
public class UpdateOmnichannelSettingSample {
public static void updateOmnichannelSettings(
Config config, String regionCode, String contact, String email) throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the retrieved credentials.
OmnichannelSettingsServiceSettings omnichannelSettingsServiceSettings =
OmnichannelSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Calls the API and catches and prints any network failures/errors.
try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
String accountId = config.getAccountId().toString();
String name =
OmnichannelSettingName.newBuilder()
.setAccount(accountId)
.setOmnichannelSetting(regionCode)
.build()
.toString();
OmnichannelSetting omnichannelSetting =
OmnichannelSetting.newBuilder()
.setName(name)
.setInventoryVerification(
InventoryVerification.newBuilder()
.setContact(contact)
.setContactEmail(email)
.build())
.build();
FieldMask fieldMask = FieldMask.newBuilder().addPaths("inventory_verification").build();
UpdateOmnichannelSettingRequest request =
UpdateOmnichannelSettingRequest.newBuilder()
.setOmnichannelSetting(omnichannelSetting)
.setUpdateMask(fieldMask)
.build();
System.out.println("Sending update omnichannel setting request:");
OmnichannelSetting response =
omnichannelSettingsServiceClient.updateOmnichannelSetting(request);
System.out.println("Updated Omnichannel Setting below:");
System.out.println(response);
} catch (Exception e) {
System.out.println("An error has occurred: ");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
// The country which you're targeting at.
String regionCode = "{REGION_CODE}";
// The name of the inventory verification contact you want to update.
String contact = "{NAME}";
// The address of the inventory verification email you want to update.
String email = "{EMAIL}";
updateOmnichannelSettings(config, regionCode, contact, email);
}
}
// [END merchantapi_update_omnichannel_setting]
Request inventory verification
omnichannelSettings.requestInventoryVerification
is only relevant to GHLSF
merchants.
Before you call this RPC, you need to have performed the following:
- Upload your product and inventory data.
- Verify an inventory verification contact.
- For merchants in Austria, Germany or Switzerland, complete an
About
page review.
To determine your eligibility, call omnichannelSettings.get
and check
omnichannelSetting.inventoryVerification.state
. If it shows INACTIVE
, you're
ready to call omnichannelSettings.requestInventoryVerification
.
package shopping.merchant.samples.accounts.v1beta;
// [START merchantapi_request_inventory_verification]
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingName;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.OmnichannelSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1beta.RequestInventoryVerificationRequest;
import com.google.shopping.merchant.accounts.v1beta.RequestInventoryVerificationResponse;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/**
* This class demonstrates how to request inventory verification for a given Merchant Center account
* in a given country
*/
public class RequestInventoryVerificationSample {
public static void requestInventoryVerification(Config config, String regionCode)
throws Exception {
// Obtains OAuth token based on the user's configuration.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the retrieved credentials.
OmnichannelSettingsServiceSettings omnichannelSettingsServiceSettings =
OmnichannelSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Calls the API and catches and prints any network failures/errors.
try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
String accountId = config.getAccountId().toString();
String name =
OmnichannelSettingName.newBuilder()
.setAccount(accountId)
.setOmnichannelSetting(regionCode)
.build()
.toString();
RequestInventoryVerificationRequest request =
RequestInventoryVerificationRequest.newBuilder().setName(name).build();
System.out.println("Sending request inventory verification request:");
RequestInventoryVerificationResponse response =
omnichannelSettingsServiceClient.requestInventoryVerification(request);
System.out.println("Omnichannel Setting after inventory verification request below:");
System.out.println(response);
} catch (Exception e) {
System.out.println("An error has occurred: ");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
// The country which you're targeting at.
String regionCode = "{REGION_CODE}";
requestInventoryVerification(config, regionCode);
}
}
// [END merchantapi_request_inventory_verification]
View the status of an omnichannel setting.
To check the review status of the LIA onboarding reviews, check ReviewState
for corresponding attributes of omnichannelSetting
returned by the
omnichannelSettings.get
or omnichannelSettings.list
methods.
The ReviewState
field applies to all the onboarding reviews except the
inventory verification process, and can have the following values:
ACTIVE
: It is approved.FAILED
: It is rejected.RUNNING
: It is still under review.ACTION_REQUIRED
: This only exists in theInStock.state
for GHLSF merchants. It means you need to request inventory verification to make LIA serve.
InventoryVerification.State
has the following values:
SUCCEEDED
: It is approved.INACTIVE
: You're ready to request inventory verification.RUNNING
: It is under reviewSUSPENDED
: You have failed inventory verification too many times (usually 5), and need to wait before being able to request it again.ACTION_REQUIRED
: You need to take additional actions before requesting inventory verification.
Troubleshoot issues related to OmnichannelSettings
API
This section describes how to troubleshoot common issues.
Create an omnichannel setting
- Make sure to set both
LsfType
andRegionCode
. - If you choose
GHLSF
, provide an emptyInStock
in the request. - If you choose Merchant-hosted LSF types, provide at least one URI in
InStock
orPickup
.
Update an omnichannel setting
The update method for this resource requires the following additional rules:
- You cannot modify the region code.
- You cannot make updates while the LIA/FLL feature is running or has been approved.
- When changing from Merchant-hosted LSF types to
GHLSF
, ifInStock
andPickup
were previously configured, you must include them in the update mask along with theLsfType
update.
For example, if you applied MHLSF_BASIC
and Pickup
before and they were
rejected, you are able to switch to GHLSF
by sending a request like this:
PATCH https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/omnichannelSettings/{REGION_CODE}?update_mask=lsf_type,in_stock,pickup
{
"lsfType: "GHLSF",
"inStock": {},
}
Replace the following:
{ACCOUNT_ID}
: The unique identifier of your Merchant Center account{REGION_CODE}
: A region code as defined CLDR
Request inventory verification
If, despite updating the product or inventory feeds and confirming the contact,
InventoryVerification.state
is other than INACTIVE
:
- For merchants in Austria, Germany, and Switzerland: Ensure that you have completed an About page review.
- There will be a delay of about 48 hours.
- In case of Repeated Inventory Check failures (more than five), the service enforces a thirty-day cooling-down period before allowing another request. Contact Google Support if you want to request it earlier.
Learn more
For more details, see Local inventory ads and free local listings Help Center.