> Documentation index: https://developers.google.com/merchant/api/llms.txt

After you complete the account configuration and merchant linking steps in
[Set up Local Feeds Partnership](https://developers.google.com/merchant/api/guides/local-feeds-partnership/setup.md.txt),
use the Local Feeds Partnership (LFP) sub-API endpoints in the following
order to match store locations, submit local inventory and point-of-sale events,
and verify onboarding readiness.

## Store codes and store matching

A single product in a merchant's catalog can be sold in one or multiple physical
stores, with different availability and pricing at each location. When you
submit local inventory (`lfpInventories.insert`) or sales (`lfpSales.insert`),
the `storeCode` attribute links a product's price and availability to a specific
physical store. Google uses the combination of the linked Google
Business Profile and the `storeCode` to uniquely identify each store.

You can supply `storeCode` values in two ways:

- **Use store codes from the linked Business Profile** : By default, if you know the store codes already assigned to the stores in the merchant's linked Business Profile, pass those exact `storeCode` values when sending inventory or sales data. You don't need to submit store data separately.
- **Match stores by submitting store data (`lfpStores.insert`)** : If you don't know the store codes in the merchant's Business Profile, you can use this matching mechanism once a Business Profile is linked to the merchant's Merchant Center account. Call [`accounts.lfpStores.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpStores/insert.md.txt) with your own unique `storeCode` along with the store's business name (`storeName`), street address (`storeAddress`), and phone number (`phoneNumber`). Matching happens strictly within the stores linked through that Business Profile. Once `matchingState` returns `STORE_MATCHING_STATE_MATCHED`, use that `storeCode` when calling `lfpInventories.insert` or `lfpSales.insert`.

### Insert a store

Once a Google Business Profile is linked to the merchant's
Merchant Center account, if you don't know the store codes configured in
that Business Profile, use
[`accounts.lfpStores.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpStores/insert.md.txt)
to submit store data with your own `storeCode`, business name, street address,
and phone number. Submitting a store with an existing `storeCode` replaces the
previous store record. If Google can't match a store, it ignores inventory and
sales submitted with that `storeCode`.

To insert a store, send the following request:

```console
POST https://merchantapi.googleapis.com/lfp/v1/{PARENT}/lfpStores:insert

{
  "storeName": "Example Store Mountain View",
  "storeAddress": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
  "phoneNumber": "+18005550100",
  "storeCode": "{STORE_CODE}",
  "targetAccount": "{TARGET_MERCHANT_ID}"
}
```

Replace the following:

- <var class="readonly" translate="no">{PARENT}</var>: `accounts/`<var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var>, where <var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var> is the ID of your LFP-enabled provider account.
- <var class="readonly" translate="no">{STORE_CODE}</var>: A unique store identifier that you assign for the target merchant.
- <var class="readonly" translate="no">{TARGET_MERCHANT_ID}</var>: The Merchant Center account ID of the merchant to submit the store for.

A successful request returns the matched `LfpStore` resource. Check
`matchingState` (and `matchingStateHint` if matching fails) to confirm that
Google matched the location to a verified Business Profile store:

```json
{
  "name": "accounts/{LFP_ACCOUNT_ID}/lfpStores/{TARGET_MERCHANT_ID}~{STORE_CODE}",
  "targetAccount": "{TARGET_MERCHANT_ID}",
  "storeCode": "{STORE_CODE}",
  "storeName": "Example Store Mountain View",
  "storeAddress": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
  "phoneNumber": "+18005550100",
  "matchingState": "STORE_MATCHING_STATE_MATCHED"
}
```

You can also retrieve, list, or delete submitted store records using
`lfpStores.get`, `lfpStores.list`, and `lfpStores.delete`. For full field
definitions and method details, see the
[`accounts.lfpStores` reference](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpStores.md.txt).

## Insert local inventory

Use
[`accounts.lfpInventories.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpInventories/insert.md.txt)
to submit in-store availability, price, quantity, and pickup details for a
product at a specific store. Submitting an entry for an existing store and offer
replaces the previous entry, and inventory entries expire after 14 days unless
refreshed.

Google links each inventory entry to product details based on your setup:

- **Uploaded or existing product data** : If you upload product data with `productInputs.insert` or use existing product data in the merchant's Merchant Center account, the `offerId` in `lfpInventories.insert` must match the `offerId` in that product data (along with matching `contentLanguage` and `feedLabel` or `regionCode`). Use a product data source when enabling merchant-hosted local storefronts, other Merchant Center programs, or products without valid [Global Trade Item Numbers (GTINs)](https://support.google.com/merchants/answer/6324461).
- **Google catalog matching with GTINs** : For Google-hosted local storefronts, if the account has no product data source or the `offerId` values don't match existing products, include a valid `gtin` in `lfpInventories.insert`. Google matches the item to its catalog and automatically creates a product data source in the target Merchant Center account.

> [!IMPORTANT]
> **Important:** The `storeCode` value in `lfpInventories.insert` must match either a store code in the merchant's linked Business Profile or a matched store from `lfpStores.insert`.

To insert local inventory, send the following request:

```console
POST https://merchantapi.googleapis.com/lfp/v1/{PARENT}/lfpInventories:insert

{
  "availability": "in stock",
  "collectionTime": "2024-01-08T08:00:00Z",
  "contentLanguage": "en",
  "gtin": "0012345678905",
  "offerId": "{OFFER_ID}",
  "pickupMethod": "buy",
  "pickupSla": "same day",
  "price": {
    "amountMicros": "1000000",
    "currencyCode": "USD"
  },
  "regionCode": "US",
  "storeCode": "{STORE_CODE}",
  "targetAccount": "{TARGET_MERCHANT_ID}"
}
```

Replace the following:

- <var class="readonly" translate="no">{PARENT}</var>: `accounts/`<var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var>, where <var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var> is the ID of your LFP-enabled provider account.
- <var class="readonly" translate="no">{OFFER_ID}</var>: The unique identifier of the product. Must match the `offerId` in the merchant's product data when using uploaded or existing product data.
- <var class="readonly" translate="no">{STORE_CODE}</var>: The store identifier from the merchant's linked Business Profile or from `lfpStores.insert`.
- <var class="readonly" translate="no">{TARGET_MERCHANT_ID}</var>: The Merchant Center account ID of the merchant you are submitting inventory for.

A successful request returns the following response:

```json
{
  "name": "accounts/{LFP_ACCOUNT_ID}/lfpInventories/{TARGET_MERCHANT_ID}~{STORE_CODE}~{OFFER_ID}",
  "targetAccount": "{TARGET_MERCHANT_ID}",
  "storeCode": "{STORE_CODE}",
  "offerId": "{OFFER_ID}",
  "regionCode": "US",
  "contentLanguage": "en",
  "gtin": "0012345678905",
  "price": {
    "amountMicros": "1000000",
    "currencyCode": "USD"
  },
  "availability": "in stock",
  "collectionTime": "2024-01-08T08:00:00Z",
  "pickupMethod": "buy",
  "pickupSla": "same day",
  "feedLabel": "US"
}
```

For full field definitions and method details, see
[`accounts.lfpInventories.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpInventories/insert.md.txt).

## Insert a sale

Use
[`accounts.lfpSales.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpSales/insert.md.txt)
to submit point-of-sale transaction events for a merchant's store. Use the same
`storeCode` and `offerId` values across your inventory, sales, and any product
data submissions. For Google-hosted local storefronts without matching product
data, Google uses `gtin` to match the item to its catalog and automatically
create a product data source.

To insert a sale, send the following request:

```console
POST https://merchantapi.googleapis.com/lfp/v1/{PARENT}/lfpSales:insert

{
  "contentLanguage": "en",
  "gtin": "0012345678905",
  "offerId": "{OFFER_ID}",
  "price": {
    "amountMicros": "1000000",
    "currencyCode": "USD"
  },
  "quantity": "2",
  "regionCode": "US",
  "saleTime": "2024-01-08T08:00:00Z",
  "storeCode": "{STORE_CODE}",
  "targetAccount": "{TARGET_MERCHANT_ID}"
}
```

Replace the following:

- <var class="readonly" translate="no">{PARENT}</var>: `accounts/`<var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var>, where <var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var> is the ID of your LFP-enabled provider account.
- <var class="readonly" translate="no">{OFFER_ID}</var>: The unique identifier of the product.
- <var class="readonly" translate="no">{STORE_CODE}</var>: The identifier of the merchant's store.
- <var class="readonly" translate="no">{TARGET_MERCHANT_ID}</var>: The Merchant Center account ID of the merchant to submit the sale for.

A successful request returns the following response:

```json
{
  "name": "accounts/{LFP_ACCOUNT_ID}/lfpSales/{UUID}",
  "targetAccount": "{TARGET_MERCHANT_ID}",
  "storeCode": "{STORE_CODE}",
  "offerId": "{OFFER_ID}",
  "regionCode": "US",
  "contentLanguage": "en",
  "gtin": "0012345678905",
  "price": {
    "amountMicros": "1000000",
    "currencyCode": "USD"
  },
  "quantity": "2",
  "saleTime": "2024-01-08T08:00:00Z",
  "uid": "{UUID}",
  "feedLabel": "US"
}
```

For full field definitions and method details, see
[`accounts.lfpSales.insert`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpSales/insert.md.txt).

## Retrieve a merchant's onboarding status

Use
[`accounts.lfpMerchantStates.get`](https://developers.google.com/merchant/api/reference/rest/lfp_v1/accounts.lfpMerchantStates/get.md.txt)
to retrieve a merchant's Local Feeds Partnership state, including the
number of linked Business Profiles (`linkedGbps`), per-store matching
states (`storeStates`), submitted inventory counts (`inventoryStats`), and
per-country local inventory ads, free local listings, and verification states
(`countrySettings`). Use these properties to verify whether the integration is
working as expected or if further onboarding actions are needed.

> [!IMPORTANT]
> **Important:** Unlike `lfpStores`, `lfpInventories`, and `lfpSales`, `accounts.lfpMerchantStates.get` authenticates against `{TARGET_MERCHANT_ID}` rather than `{LFP_ACCOUNT_ID}` (in addition to requiring an LFP provider link between the two accounts). Authenticate with credentials that have `STANDARD` or `ADMIN` access to `{TARGET_MERCHANT_ID}`, such as your parent advanced account, per-merchant OAuth 2.0, or an approved `accountManagement` or `productsManagement` service provider relationship.

```console
GET https://merchantapi.googleapis.com/lfp/v1/accounts/{LFP_ACCOUNT_ID}/lfpMerchantStates/{TARGET_MERCHANT_ID}
```

Replace the following:

- <var class="readonly" translate="no">{LFP_ACCOUNT_ID}</var>: The ID of your LFP-enabled provider account.
- <var class="readonly" translate="no">{TARGET_MERCHANT_ID}</var>: The Merchant Center account ID of the merchant to inspect.

To view a complete code example, see
[Get LFP merchant state](https://developers.google.com/merchant/api/samples/get-lfp-merchant-state.md.txt).