[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe Merchant API utilizes OAuth 2.0 for user-specific access and service accounts for application-level access to Merchant Center accounts.\u003c/p\u003e\n"],["\u003cp\u003eProduct and inventory data can be submitted together using \u003ccode\u003eaccounts.lfpInventories.insert\u003c/code\u003e or separately using \u003ccode\u003eaccounts.productInputs.insert\u003c/code\u003e for products and \u003ccode\u003eaccounts.lfpInventories.insert\u003c/code\u003e or \u003ccode\u003eaccounts.lfpSales.insert\u003c/code\u003e for inventory.\u003c/p\u003e\n"],["\u003cp\u003eBefore submitting offers, enable the specific local program for target countries using \u003ccode\u003eliasettings.update\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eStore data can be sent via \u003ccode\u003eaccounts.lfpStores.insert\u003c/code\u003e using custom store codes when direct Google Business Profile access isn't available, but ensure accurate data for successful matching with Google Maps information.\u003c/p\u003e\n"],["\u003cp\u003eRegularly monitor \u003ccode\u003eaccounts.lfpStores.insert\u003c/code\u003e responses for matching issues indicated by \u003cem\u003ematchingState\u003c/em\u003e and \u003cem\u003ematchingStateHint\u003c/em\u003e to address potential problems promptly.\u003c/p\u003e\n"]]],[],null,["API\n---\n\n*** ** * ** ***\n\n### Authentication\n\nTo use the Merchant API for Shopping with a given Merchant Center account, you\nmust set up an [API Console](https://console.developers.google.com/) project. Google Cloud Console projects help\nyou manage API access and authentication for your Merchant API solution.\n\nDepending on the use case, there are two ways to access the Merchant API:\n\n- **OAuth 2.0** is recommended for getting access to a specific Merchant Center account through an application you developed for your users. The user will need to grant access to your account to submit data on their behalf.\n- **A service account** is a special kind of account, typically used by an application rather than a person. A service account is identified by its email address, which is unique to the account.\n\nRefer to how to authenticate [using OAuth 2.0 or a service\naccount](https://developers.google.com/merchant/api/guides/authorization/access-client-accounts).\n| **Tip:** When submitting data as a Local Feed Partnership Provider, the service account email needs to be added to the list of MCA account users as calls will be authenticated through that account for all the MCA sub-accounts.\n\n### Enable country settings\n\n| **Important:** Before submitting offers' data you need to enable the specific local program.\n\nCall [`liasettings.update`](https://developers.google.com/shopping-content/reference/rest/v2.1/liasettings/update) to specify the countries where you\nplan to serve local.\n\nMore information on the Country Settings Target [page](https://developers.google.com/shopping-content/guides/how-tos/lia/configure-targets)\n\n### Send offers data\n\nThere are two types of data: product and inventory data.\n\n#### Send product and inventory data at once\n\nProduct and inventory data can be submitted at once using\n[accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert)\n\nThe field \"GTIN\" in fact will work as a product identifier for Google's catalog\nand a product feed will be automatically created.\n\nThis automatically created feed will show in the target Merchant Center as\n\"Local Feed Provider\" feed with the relevant offers associated with.\n\nThis method works well if all the merchant's products have a GTIN and no further\nfeatures are going to be enabled (like Merchant Hosted Local Store Front basic).\nIf you plan to enable MHLSF for your merchants, sending a dedicated product feed\nis the recommended setup.\n\nThe same procedure can work using [accounts.lfpSales.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpSales/insert)\n\nIn this case the data refers to a Sale event for a particular product at a\nparticular time.\n\n##### Send product and inventory data separately\n\nIf GTINs are not widely available or you would rather take advantage of an\nexisting product feed in the Target Merchant Center account or you want to\nenable MHLSF for your merchants, you need to have a specific Local Product Feed.\n\nThis can be enabled by calling [accounts.productInputs.insert](https://developers.google.com/merchant/api/guides/products/overview)\nfirst and inserting all the static values of a product. Remember to set the\n`Channel` attribute to \"local\".\n\nLearn more about basic product data [in this article](https://support.google.com/merchants/answer/7052112?sjid=13508477020884939094-NA#basic_product_data) and [API\ngeneral guidance for inserting products](https://developers.google.com/merchant/api/guides/products/overview).\n\nThe data flow is the following:\n\n- Call [accounts.productInputs.insert](https://developers.google.com/merchant/api/guides/products/overview) first to start uploading products for your merchants\n- Then Call [accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert) to submit inventory data.\n\nAlternatively, inventory data can be sent through\n[accounts.lfpSales.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpSales/insert). A machine learning model will then\npredict price and quantity of the offers based on this data.\n\nExample overview for [accounts.lfpInventories.insert, accounts.lfpSales.insert\naccounts.lfpStores.insert](https://developers.google.com/merchant/api/guides/local-feeds-partnership/overview)\n| **Important:** The offerId sent in [accounts.productInputs.insert](https://developers.google.com/merchant/api/guides/products/overview) needs to match the offerId in [accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert) so that offers are mapped correctly.\n| **Important:** [accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert) has a **parent** parameter in the URL. This is your **LFP provider account** enabled by the Support team. Your retailer's merchant center account is in the request payload instead identified as **TargetMerchant**. This is the Merchant Center ID of the merchant to submit the inventory for.\n| **Key Point:** Product data expires in 30 days and inventory data expires in 14 days. This is effective in removing unwanted products. Product and inventory data can be sent at once using [accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert) if GTINs are known for all offers. Alternatively you can use [accounts.productInputs.insert](https://developers.google.com/merchant/api/guides/products/overview) for product data and [accounts.lfpInventories.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpInventories/insert) (or [accounts.lfpSales.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpSales/insert)) for inventory data\n\n### Send Business Profile data\n\nWhen it is not possible to access the Merchant's Google Business Profile account\nto retrieve the store codes, Store data can be sent through\n[accounts.lfpStores.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpStores/insert) with your own specific store codes.\n\nNote that when calling accounts.lfpinventories.insert or\naccounts.lfpSales.insert the store Code will need to match the store Code\nprovided in lfp Stores requests.\n| **Important:** If a matching store can't be found, the inventories or sales submitted with the store code won't be used. For higher matching rate success, the information provided should exactly match the details available in Google Maps for that particular store.\n\nThe response of [accounts.lfpStores.insert](https://developers.google.com/merchant/api/reference/rest/lfp_v1beta/accounts.lfpStores/insert) will also provide a\n*matchingState* and *matchingStateHint* if the matching has failed.\n| **Tip:** You should monitor those responses to log and address matching problems sooner rather than later and avoid building up unmatched stores, which won't be in a position to have offers served for."]]