- [Resource: DataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DataSource.SCHEMA_REPRESENTATION)
- [PrimaryProductDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#PrimaryProductDataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#PrimaryProductDataSource.SCHEMA_REPRESENTATION)
- [DefaultRule](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DefaultRule)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DefaultRule.SCHEMA_REPRESENTATION)
- [DataSourceReference](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DataSourceReference)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DataSourceReference.SCHEMA_REPRESENTATION)
- [Destination](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#Destination)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#Destination.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#State)
- [SupplementalProductDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#SupplementalProductDataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#SupplementalProductDataSource.SCHEMA_REPRESENTATION)
- [LocalInventoryDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#LocalInventoryDataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#LocalInventoryDataSource.SCHEMA_REPRESENTATION)
- [RegionalInventoryDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#RegionalInventoryDataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#RegionalInventoryDataSource.SCHEMA_REPRESENTATION)
- [PromotionDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#PromotionDataSource)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#PromotionDataSource.SCHEMA_REPRESENTATION)
- [ProductReviewDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#ProductReviewDataSource)
- [MerchantReviewDataSource](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#MerchantReviewDataSource)
- [Input](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#Input)
- [FileInput](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#FileInput)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#FileInput.SCHEMA_REPRESENTATION)
- [FetchSettings](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#FetchSettings)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#FetchSettings.SCHEMA_REPRESENTATION)
- [TimeOfDay](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#TimeOfDay)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#TimeOfDay.SCHEMA_REPRESENTATION)
- [DayOfWeek](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#DayOfWeek)
- [Frequency](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#Frequency)
- [FileInputType](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#FileInputType)
- [Methods](https://developers.google.com/merchant/api/reference/rest/datasources_v1/accounts.dataSources.md.txt#METHODS_SUMMARY)

## Resource: DataSource

The [data source](https://developers.google.com/merchant/api/guides/data-sources/overview.md.txt) for the Merchant Center account.

| JSON representation |
|---|
| ``` { "name": string, "dataSourceId": string, "displayName": string, "input": enum (`Input`), "fileInput": { object (`FileInput`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "primaryProductDataSource": { object (`PrimaryProductDataSource`) }, "supplementalProductDataSource": { object (`SupplementalProductDataSource`) }, "localInventoryDataSource": { object (`LocalInventoryDataSource`) }, "regionalInventoryDataSource": { object (`RegionalInventoryDataSource`) }, "promotionDataSource": { object (`PromotionDataSource`) }, "productReviewDataSource": { object (`ProductReviewDataSource`) }, "merchantReviewDataSource": { object (`MerchantReviewDataSource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Identifier. The name of the data source. Format: `accounts/{account}/dataSources/{datasource}` |
| `dataSourceId` | `string (int64 format)` Output only. The data source id. |
| `displayName` | `string` Required. The displayed data source name in the Merchant Center UI. |
| `input` | ``enum (`Input`)`` Output only. Determines the type of input to the data source. Based on the input some settings might not work. Only generic data sources can be created through the API. |
| `fileInput` | ``object (`FileInput`)`` Optional. The field is used only when data is managed through a file. |
| Required. The data source type. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `primaryProductDataSource` | ``object (`PrimaryProductDataSource`)`` The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products. |
| `supplementalProductDataSource` | ``object (`SupplementalProductDataSource`)`` The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products. |
| `localInventoryDataSource` | ``object (`LocalInventoryDataSource`)`` The [local inventory](https://support.google.com/merchants/answer/7023001) data source. |
| `regionalInventoryDataSource` | ``object (`RegionalInventoryDataSource`)`` The [regional inventory](https://support.google.com/merchants/answer/7439058) data source. |
| `promotionDataSource` | ``object (`PromotionDataSource`)`` The [promotion](https://support.google.com/merchants/answer/2906014) data source. |
| `productReviewDataSource` | ``object (`ProductReviewDataSource`)`` The [product review](https://support.google.com/merchants/answer/7045996) data source. |
| `merchantReviewDataSource` | ``object (`MerchantReviewDataSource`)`` The [merchant review](https://support.google.com/merchants/answer/7045996) data source. |
| End of mutually exclusive fields. ||

## PrimaryProductDataSource

The primary data source for local and online products.

| JSON representation |
|---|
| ``` { "legacyLocal": boolean, "countries": [ string ], "defaultRule": { object (`DefaultRule`) }, "destinations": [ { object (`Destination`) } ], "feedLabel": string, "contentLanguage": string } ``` |

| Fields ||
|---|---|
| `legacyLocal` | `boolean` Optional. Immutable. Determines whether the products of this data source are **only** targeting local destinations. Legacy local products are prefixed with `local~` in the product resource ID. For example, `accounts/123/products/local~en~US~sku123`. |
| `countries[]` | `string` Optional. The countries where the items may be displayed. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). |
| `defaultRule` | ``object (`DefaultRule`)`` Optional. Default rule management of the data source. If set, the linked data sources will be replaced. Warning: The update (patch) and create call replaces the entire default rule setup. It doesn't work as an addition or append. If `self` is missing from the list of `takeFromDataSources`, the API will ignore attributes from the primary data source itself. |
| `destinations[]` | ``object (`Destination`)`` Optional. A list of destinations describing where products of the data source can be shown. When retrieving the data source, the list contains all the destinations that can be used for the data source, including the ones that are disabled for the data source but enabled for the account. Only destinations that are enabled on the account, for example through program participation, can be enabled on the data source. If unset, during creation, the destinations will be inherited based on the account level program participation. If set, during creation or update, the data source will be set only for the specified destinations. Updating this field requires at least one destination. |
| `feedLabel` | `string` Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). For more information about feed label, see [Create a primary data source for products](https://developers.google.com/merchant/api/guides/data-sources/api-sources.md.txt#create-primary-data-source). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction. |
| `contentLanguage` | `string` Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction. |

## DefaultRule

Default rule management of the data source.

| JSON representation |
|---|
| ``` { "takeFromDataSources": [ { object (`DataSourceReference`) } ] } ``` |

| Fields ||
|---|---|
| `takeFromDataSources[]` | ``object (`DataSourceReference`)`` Required. The list of data sources linked in the [default rule](https://support.google.com/merchants/answer/7450276). This list is ordered by the default rule priority of joining the data. It might include none or multiple references to `self` and supplemental data sources. The list must not be empty. To link the data source to the default rule, you need to add a new reference to this list (in sequential order). To unlink the data source from the default rule, you need to remove the given reference from this list. Changing the order of this list will result in changing the priority of data sources in the default rule. For example, providing the following list: \[`1001`, `self`\] will take attribute values from supplemental data source `1001`, and fallback to `self` if the attribute is not set in `1001`. Warning: The update (patch) and create call replaces the entire default rule setup. It doesn't work as an addition or append. If `self` is missing from the list of `takeFromDataSources`, the API will ignore attributes from the primary data source itself. |

## DataSourceReference

Data source reference can be used to manage related data sources within the data source service.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "self": boolean, "primaryDataSourceName": string, "supplementalDataSourceName": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `self` | `boolean` Self should be used to reference the primary data source itself. |
| `primaryDataSourceName (deprecated)` | `string` > [!WARNING] > This item is deprecated! Optional. Deprecated: Use `self` instead to reference the primary data source. The name of the primary data source. Format: `accounts/{account}/dataSources/{datasource}` |
| `supplementalDataSourceName` | `string` Optional. The name of the supplemental data source. Format: `accounts/{account}/dataSources/{datasource}` |
| End of mutually exclusive fields. ||

## Destination

Destinations also known as [Marketing methods](https://support.google.com/merchants/answer/15130232) selections.

| JSON representation |
|---|
| ``` { "destination": enum (`DestinationEnum`), "state": enum (`State`) } ``` |

| Fields ||
|---|---|
| `destination` | ``enum (`DestinationEnum`)`` [Marketing methods](https://support.google.com/merchants/answer/15130232) (also known as destination) selections. |
| `state` | ``enum (`State`)`` The state of the destination. |

## State

The state of the destination.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Not specified. |
| `ENABLED` | Indicates that the destination is enabled. |
| `DISABLED` | Indicates that the destination is disabled. |

## SupplementalProductDataSource

The [supplemental data source](https://developers.google.com/merchant/api/guides/data-sources/api-sources.md.txt#link-supplemental-data-source) for local and online products. After creation,you should make sure to link the supplemental product data source into one or more primary product data sources.

| JSON representation |
|---|
| ``` { "referencingPrimaryDataSources": [ { object (`DataSourceReference`) } ], "feedLabel": string, "contentLanguage": string } ``` |

| Fields ||
|---|---|
| `referencingPrimaryDataSources[]` | ``object (`DataSourceReference`)`` Output only. The (unordered and deduplicated) list of all primary data sources linked to this data source in either default or custom rules. Supplemental data source cannot be deleted before all links are removed. |
| `feedLabel` | `string` Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a `file input`. The fields must be unset for data sources without `file input`. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction. |
| `contentLanguage` | `string` Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction. |

## LocalInventoryDataSource

The local inventory data source type is only available for file inputs and can't be used to create API local inventory data sources.

| JSON representation |
|---|
| ``` { "feedLabel": string, "contentLanguage": string } ``` |

| Fields ||
|---|---|
| `feedLabel` | `string` Required. Immutable. The feed label of the offers to which the local inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). |
| `contentLanguage` | `string` Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided. |

## RegionalInventoryDataSource

| JSON representation |
|---|
| ``` { "feedLabel": string, "contentLanguage": string } ``` |

| Fields ||
|---|---|
| `feedLabel` | `string` Required. Immutable. The feed label of the offers to which the regional inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). |
| `contentLanguage` | `string` Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided. |

## PromotionDataSource

The promotion data source.

| JSON representation |
|---|
| ``` { "targetCountry": string, "contentLanguage": string } ``` |

| Fields ||
|---|---|
| `targetCountry` | `string` Required. Immutable. The target country used as part of the unique identifier. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). Promotions are only available in selected [countries](https://support.google.com/merchants/answer/4588460). |
| `contentLanguage` | `string` Required. Immutable. The two-letter ISO 639-1 language of the items in the data source. |

## ProductReviewDataSource

This type has no fields.
The product review data source.

## MerchantReviewDataSource

This type has no fields.
The merchant review data source.

## Input

Determines the type of input to the data source. Based on the input some settings might not be supported.

| Enums ||
|---|---|
| `INPUT_UNSPECIFIED` | Input unspecified. |
| `API` | Represents data sources for which the data is primarily provided through the API. |
| `FILE` | Represents data sources for which the data is primarily provided through file input. Data can still be provided through the API. |
| `UI` | The data source for products added directly in Merchant Center. This type of data source can not be created or updated through this API, only by Merchant Center UI. This type of data source is read only. |
| `AUTOFEED` | This is also known as [Automated feeds](https://support.google.com/merchants/answer/12158480) used to automatically build your product data. This type of data source can be enabled or disabled through the Accounts sub-API. |

## FileInput

The data specific for file data sources. This field is empty for other data source inputs.

| JSON representation |
|---|
| ``` { "fetchSettings": { object (`FetchSettings`) }, "fileName": string, "fileInputType": enum (`FileInputType`) } ``` |

| Fields ||
|---|---|
| `fetchSettings` | ``object (`FetchSettings`)`` Optional. Fetch details to deliver the data source. It contains settings for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary based on the frequency of fetching. |
| `fileName` | `string` Optional. The file name of the data source. Required for `UPLOAD` file input type. |
| `fileInputType` | ``enum (`FileInputType`)`` Output only. The type of file input. |

## FetchSettings

Fetch details to deliver the data source.

| JSON representation |
|---|
| ``` { "enabled": boolean, "dayOfMonth": integer, "timeOfDay": { object (`TimeOfDay`) }, "dayOfWeek": enum (`DayOfWeek`), "timeZone": string, "frequency": enum (`Frequency`), "fetchUri": string, "username": string, "password": string } ``` |

| Fields ||
|---|---|
| `enabled` | `boolean` Optional. Enables or pauses the fetch schedule. |
| `dayOfMonth` | `integer` Optional. The day of the month when the data source file should be fetched (1-31). This field can only be set for monthly frequency. |
| `timeOfDay` | ``object (`TimeOfDay`)`` Optional. The hour of the day when the data source file should be fetched. Minutes and seconds are not supported and will be ignored. |
| `dayOfWeek` | ``enum (`DayOfWeek`)`` Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency. |
| `timeZone` | `string` Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by default. For example, "America/Los_Angeles". |
| `frequency` | ``enum (`Frequency`)`` Required. The frequency describing fetch schedule. |
| `fetchUri` | `string` Optional. The URL where the data source file can be fetched. Google Merchant Center supports automatic scheduled uploads using the HTTP, HTTPS or SFTP protocols, so the value will need to be a valid link using one of those three protocols. Immutable for Google Sheets files. |
| `username` | `string` Optional. An optional user name for `fetchUri`. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117). |
| `password` | `string` Optional. An optional password for `fetchUri`. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117). |

## TimeOfDay

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are `google.type.Date` and `google.protobuf.Timestamp`.

| JSON representation |
|---|
| ``` { "hours": integer, "minutes": integer, "seconds": integer, "nanos": integer } ``` |

| Fields ||
|---|---|
| `hours` | `integer` Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. |
| `minutes` | `integer` Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59. |
| `seconds` | `integer` Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds. |
| `nanos` | `integer` Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999. |

## DayOfWeek

Represents a day of the week.

| Enums ||
|---|---|
| `DAY_OF_WEEK_UNSPECIFIED` | The day of the week is unspecified. |
| `MONDAY` | Monday |
| `TUESDAY` | Tuesday |
| `WEDNESDAY` | Wednesday |
| `THURSDAY` | Thursday |
| `FRIDAY` | Friday |
| `SATURDAY` | Saturday |
| `SUNDAY` | Sunday |

## Frequency

The required fields vary based on the frequency of fetching. For a monthly fetch schedule, [`dayOfMonth`](https://developers.google.com/merchant/api/reference/rest/datasources_v1/google.type.DayOfMonth) and [`timeOfDay`](https://developers.google.com/merchant/api/reference/rest/datasources_v1/google.type.TimeOfDay) are required. For a weekly fetch schedule, `dayOfWeek` and `timeOfDay` are required. For a daily fetch schedule, only `timeOfDay` is required.

| Enums ||
|---|---|
| `FREQUENCY_UNSPECIFIED` | Frequency unspecified. |
| `FREQUENCY_DAILY` | The fetch happens every day. |
| `FREQUENCY_WEEKLY` | The fetch happens every week. |
| `FREQUENCY_MONTHLY` | The fetch happens every month. |

## FileInputType

The method of file delivery.

| Enums ||
|---|---|
| `FILE_INPUT_TYPE_UNSPECIFIED` | File input type unspecified. |
| `UPLOAD` | The file is uploaded through SFTP, Google Cloud Storage or manually in the Merchant Center. |
| `FETCH` | The file is fetched from the configured `fetchUri`. |
| `GOOGLE_SHEETS` | The file is fetched from Google Sheets specified in the `fetchUri`. However, you can't set up `GOOGLE_SHEETS` as a data source through the API. To add `GOOGLE_SHEETS` as a data source through the Merchant Center, see [Add products to Merchant Center](https://support.google.com/merchants/answer/12158053). |

| ## Methods ||
|---|---|
| ### `create` | Creates the new data source configuration for the given account. |
| ### `delete` | Deletes a data source from your Merchant Center account. |
| ### `fetch` | Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. |
| ### `get` | Retrieves the data source configuration for the given account. |
| ### `list` | Lists the configurations for data sources for the given account. |
| ### `patch` | Updates the existing data source configuration. |