Package google.shopping.merchant.datasources.v1beta

Index

DataSourcesService

Service to manage primary, supplemental, inventory and other data sources. See more in the Merchant Center help article.

CreateDataSource

rpc CreateDataSource(CreateDataSourceRequest) returns (DataSource)

Creates the new data source configuration for the given account.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

DeleteDataSource

rpc DeleteDataSource(DeleteDataSourceRequest) returns (Empty)

Deletes a data source from your Merchant Center account.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

FetchDataSource

rpc FetchDataSource(FetchDataSourceRequest) returns (Empty)

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

GetDataSource

rpc GetDataSource(GetDataSourceRequest) returns (DataSource)

Retrieves the data source configuration for the given account.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

ListDataSources

rpc ListDataSources(ListDataSourcesRequest) returns (ListDataSourcesResponse)

Lists the configurations for data sources for the given account.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

UpdateDataSource

rpc UpdateDataSource(UpdateDataSourceRequest) returns (DataSource)

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

FileUploadsService

Service to manage data source file uploads.

GetFileUpload

rpc GetFileUpload(GetFileUploadRequest) returns (FileUpload)

Gets the latest data source file upload. Only the latest alias is accepted for a file upload.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

CreateDataSourceRequest

Request message for the CreateDataSource method.

Fields
parent

string

Required. The account where this data source will be created. Format: accounts/{account}

data_source

DataSource

Required. The data source to create.

DataSource

The data source for the Merchant Center account.

Fields
name

string

Identifier. The name of the data source. Format: {datasource.name=accounts/{account}/dataSources/{datasource}}

data_source_id

int64

Output only. The data source id.

display_name

string

Required. The displayed data source name in the Merchant Center UI.

input

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.

file_input

FileInput

Optional. The field is used only when data is managed through a file.

Union field Type. The data source type. Type can be only one of the following:
primary_product_data_source

PrimaryProductDataSource

Required. The primary data source for local and online products.

supplemental_product_data_source

SupplementalProductDataSource

Required. The supplemental data source for local and online products.

local_inventory_data_source

LocalInventoryDataSource

Required. The local inventory data source.

regional_inventory_data_source

RegionalInventoryDataSource

Required. The regional inventory data source.

promotion_data_source

PromotionDataSource

Required. The promotion 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 used to automatically build your product data. This type of data source can be enabled or disabled through the Accounts bundle.

DataSourceReference

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

Fields

Union field data_source_id.

data_source_id can be only one of the following:

self

bool

Self should be used to reference the primary data source itself.

primary_data_source_name

string

Optional. The name of the primary data source. Format: accounts/{account}/dataSources/{datasource}

supplemental_data_source_name

string

Optional. The name of the supplemental data source. Format: accounts/{account}/dataSources/{datasource}

DeleteDataSourceRequest

Request message for the DeleteDataSource method.

Fields
name

string

Required. The name of the data source to delete. Format: accounts/{account}/dataSources/{datasource}

FetchDataSourceRequest

Request message for the FetchDataSource method.

Fields
name

string

Required. The name of the data source resource to fetch. Format: accounts/{account}/dataSources/{datasource}

FileInput

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

Fields
fetch_settings

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.

file_name

string

Optional. The file name of the data source. Required for UPLOAD file input type.

file_input_type

FileInputType

Output only. The type of file input.

FetchSettings

Fetch details to deliver the data source.

Fields
enabled

bool

Optional. Enables or pauses the fetch schedule.

day_of_month

int32

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.

time_of_day

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.

day_of_week

DayOfWeek

Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency.

time_zone

string

Optional. Time zone used for schedule. UTC by default. For example, "America/Los_Angeles".

frequency

Frequency

Required. The frequency describing fetch schedule.

fetch_uri

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 [fetch url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. Used for submitting data sources through SFTP.

password

string

Optional. An optional password for [fetch url][google.shopping.content.bundles.DataSources.FileInput.fetch_url]. Used for submitting data sources through SFTP.

Frequency

The required fields vary based on the frequency of fetching. For a monthly fetch schedule, [day of month][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.day_of_month] and [hour of day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day] are required. For a weekly fetch schedule, [day of week][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.day_of_week] and [hour of day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day] are required. For a daily fetch schedule, only an [hour of day][google.shopping.content.bundles.DataSources.FileInput.FetchSchedule.time_of_day] 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 [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].
GOOGLE_SHEETS The file is fetched from Google Sheets specified in the [fetch_uri][google.shopping.content.bundles.DataSources.FileInput.FetchSettings.fetch_uri].

FileUpload

The file upload of a specific data source, that is, the result of the retrieval of the data source at a certain timestamp computed asynchronously when the data source processing is finished. Only applicable to file data sources.

Fields
name

string

Identifier. The name of the data source file upload. Format: {datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}

data_source_id

int64

Output only. The data source id.

processing_state

ProcessingState

Output only. The processing state of the data source.

issues[]

Issue

Output only. The list of issues occurring in the data source.

items_total

int64

Output only. The number of items in the data source that were processed.

items_created

int64

Output only. The number of items in the data source that were created.

items_updated

int64

Output only. The number of items in the data source that were updated.

upload_time

Timestamp

Output only. The date at which the file of the data source was uploaded.

Issue

An error occurring in the data source, like "invalid price".

Fields
title

string

Output only. The title of the issue, for example, "Item too big".

description

string

Output only. The error description, for example, "Your data source contains items which have too many attributes, or are too big. These items will be dropped".

code

string

Output only. The code of the error, for example, "validation/invalid_value". Returns "?" if the code is unknown.

count

int64

Output only. The number of occurrences of the error in the file upload.

severity

Severity

Output only. The severity of the issue.

documentation_uri

string

Output only. Link to the documentation explaining the issue in more details, if available.

Severity

The severity of the issue.

Enums
SEVERITY_UNSPECIFIED Severity unspecified.
WARNING The issue is the warning.
ERROR The issue is an error.

ProcessingState

The processing state of the data source.

Enums
PROCESSING_STATE_UNSPECIFIED Processing state unspecified.
FAILED The data source could not be processed or all the items had errors.
IN_PROGRESS The data source is being processed.
SUCCEEDED The data source was processed successfully, though some items might have had errors.

GetDataSourceRequest

Request message for the GetDataSource method.

Fields
name

string

Required. The name of the data source to retrieve. Format: accounts/{account}/dataSources/{datasource}

GetFileUploadRequest

Request message for the GetFileUploadRequest method.

Fields
name

string

Required. The name of the data source file upload to retrieve. Format: accounts/{account}/dataSources/{datasource}/fileUploads/latest

ListDataSourcesRequest

Request message for the ListDataSources method.

Fields
parent

string

Required. The account to list data sources for. Format: accounts/{account}

page_size

int32

Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.

page_token

string

Optional. A page token, received from a previous ListDataSources call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListDataSources must match the call that provided the page token.

ListDataSourcesResponse

Response message for the ListDataSources method.

Fields
data_sources[]

DataSource

The data sources from the specified account.

next_page_token

string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

LocalInventoryDataSource

The local inventory data source.

Fields
feed_label

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 (-).

See also migration to feed labels.

content_language

string

Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided.

PrimaryProductDataSource

The primary data source for local and online products.

Fields
channel

Channel

Required. Immutable. Specifies the type of data source channel.

countries[]

string

Optional. The countries where the items may be displayed. Represented as a CLDR territory code.

default_rule

DefaultRule

Optional. Default rule management of the data source. If set, the linked data sources will be replaced.

feed_label

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 (-).

See also migration to feed labels.

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.

content_language

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.

Channel

Data Source Channel.

Channel is used to distinguish between data sources for different product verticals.

Enums
CHANNEL_UNSPECIFIED Not specified.
ONLINE_PRODUCTS Online product.
LOCAL_PRODUCTS Local product.
PRODUCTS Unified data source for both local and online products. Note: Products management through the API is not possible for this channel.

DefaultRule

Default rule management of the data source.

Fields
take_from_data_sources[]

DataSourceReference

Required. The list of data sources linked in the default rule. 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.

PromotionDataSource

The promotion data source.

Fields
target_country

string

Required. Immutable. The target country used as part of the unique identifier. Represented as a CLDR territory code.

Promotions are only available in selected countries.

content_language

string

Required. Immutable. The two-letter ISO 639-1 language of the items in the data source.

RegionalInventoryDataSource

The regional inventory data source.

Fields
feed_label

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 (-).

See also migration to feed labels.

content_language

string

Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided.

SupplementalProductDataSource

The supplemental data source for local and online products.

Fields
referencing_primary_data_sources[]

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.

feed_label

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 (-).

See also migration to feed labels.

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 produts without that restriction.

content_language

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.

UpdateDataSourceRequest

Request message for the UpdateDataSource method.

Fields
data_source

DataSource

Required. The data source resource to update.

update_mask

FieldMask

Required. The list of data source fields to be updated.

Fields specified in the update mask without a value specified in the body will be deleted from the data source.

Providing special "*" value for full data source replacement is not supported.