- Resource: Product
- Methods
Resource: Product
Product captures all metadata information of items to be recommended or searched.
JSON representation |
---|
{ "name": string, "id": string, "type": enum ( |
Fields | |
---|---|
name |
Immutable. Full resource name of the product, such as |
id |
Immutable. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property id. Schema.org property Product.sku. |
type |
Immutable. The type of the product. Default to |
primary |
Variant group identifier. Must be an For For VARIANT Corresponding properties: Google Merchant Center property item_group_id. Schema.org property Product.inProductGroupWithID. |
collection |
The Non-existent product ids are allowed. The |
gtin |
The Global Trade Item Number (GTIN) of the product. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property gtin. Schema.org property Product.isbn, Product.gtin8, Product.gtin12, Product.gtin13, or Product.gtin14. If the value is not a valid GTIN, an INVALID_ARGUMENT error is returned. |
categories[] |
Product categories. This field is repeated for supporting one product belonging to several parallel categories. Strongly recommended using the full path for better search / recommendation quality. To represent full path of category, use '>' sign to separate different hierarchies. If '>' is part of the category name, replace it with other character(s). For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:
Must be set for At most 250 values are allowed per Corresponding properties: Google Merchant Center property google_product_category. Schema.org property Product.category. |
title |
Required. Product title. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property title. Schema.org property Product.name. |
brands[] |
The brands of the product. A maximum of 30 brands are allowed unless overridden through the Google Cloud console. Each brand must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property brand. Schema.org property Product.brand. |
description |
Product description. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property description. Schema.org property Product.description. |
language |
Language of the title/description and other string attributes. Use language tags defined by BCP 47. For product prediction, this field is ignored and the model automatically detects the text language. The For product search this field is in use. It defaults to "en-US" if unset. |
attributes |
Highly encouraged. Extra product attributes to be included. For example, for products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the attributes here. Features that can take on one of a limited number of possible values. Two types of features can be set are: Textual features. some examples would be the brand/maker of a product, or country of a customer. Numerical features. Some examples would be the height/weight of a product, or age of a customer. For example: This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
|
attributes. |
The textual values of this custom attribute. For example, Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of |
attributes. |
The numerical values of this custom attribute. For example, Exactly one of |
attributes.searchable |
This field is normally ignored unless This field is ignored in a Only set if type |
attributes.indexable |
This field is normally ignored unless This field is ignored in a See |
tags[] |
Custom tags associated with the product. At most 250 values are allowed per This tag can be used for filtering recommendation results by passing the tag as part of the Corresponding properties: Google Merchant Center property custom_label_0–4. |
price |
Product price and cost information. Corresponding properties: Google Merchant Center property price. |
rating |
The rating of this product. |
available |
The timestamp when this A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
availability |
The online availability of the For primary products with variants set the availability of the primary as For primary products with no variants set the true availability at the primary level. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability. |
available |
The available quantity of the item. |
fulfillment |
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods. All the elements must have distinct |
uri |
Canonical URL directly linking to the product detail page. It is strongly recommended to provide a valid uri for the product, otherwise the service performance could be significantly degraded. This field must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property link. Schema.org property Offer.url. |
images[] |
Product images for the product. We highly recommend putting the main image first. A maximum of 300 images are allowed. Corresponding properties: Google Merchant Center property image_link. Schema.org property Product.image. |
audience |
The target group associated with a given audience (e.g. male, veterans, car owners, musicians, etc.) of the product. |
color |
The color of the product. Corresponding properties: Google Merchant Center property color. Schema.org property Product.color. |
sizes[] |
The size of the product. To represent different size systems or size types, consider using this format: [[[size_system:]size_type:]size_value]. For example, in "US:MENS:M", "US" represents size system; "MENS" represents size type; "M" represents size value. In "GIRLS:27", size system is empty; "GIRLS" represents size type; "27" represents size value. In "32 inches", both size system and size type are empty, while size value is "32 inches". A maximum of 20 values are allowed per Corresponding properties: Google Merchant Center property size, size_type, and size_system. Schema.org property Product.size. |
materials[] |
The material of the product. For example, "leather", "wooden". A maximum of 20 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error is returned. Corresponding properties: Google Merchant Center property material. Schema.org property Product.material. |
patterns[] |
The pattern or graphic print of the product. For example, "striped", "polka dot", "paisley". A maximum of 20 values are allowed per Corresponding properties: Google Merchant Center property pattern. Schema.org property Product.pattern. |
conditions[] |
The condition of the product. Strongly encouraged to use the standard values: "new", "refurbished", "used". A maximum of 1 value is allowed per Corresponding properties: Google Merchant Center property condition. Schema.org property Offer.itemCondition. |
promotions[] |
The promotions applied to the product. A maximum of 10 values are allowed per |
publish |
The timestamp when the product is published by the retailer for the first time, which indicates the freshness of the products. Note that this field is different from A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
retrievableFields |
Indicates which fields in the Supported fields for all
Supported fields only for Supported fields only for
To mark For For Note: Returning more fields in This field is deprecated. Use the retrievable site-wide control instead. This is a comma-separated list of fully qualified names of fields. Example: |
variants[] |
Output only. Product variants grouped together on primary product which share similar product attributes. It's automatically grouped by Note: This field is OUTPUT_ONLY for |
local |
Output only. A list of local inventories specific to different places. This field can be managed by |
Union field
|
|
expire |
Note that this field is applied in the following ways:
In general, we suggest the users to delete the stale products explicitly, instead of using this field to determine staleness.
Corresponding properties: Google Merchant Center property expiration_date. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
ttl |
Input only. The TTL (time to live) of the product. Note that this is only applicable to If it is set, it must be a non-negative value, and If it is set, the product is not available for A duration in seconds with up to nine fractional digits, ending with ' |
Type
The type of this product.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value. Default to Catalog.product_level_config.ingestion_product_type if unset. |
PRIMARY |
The primary type. As the primary unit for predicting, indexing and search serving, a |
VARIANT |
The variant type.
|
COLLECTION |
The collection type. Collection products are bundled Type.PRIMARY Product s or Type.VARIANT Product s that are sold together, such as a jewelry set with necklaces, earrings and rings, etc. |
PriceInfo
The price information of a Product
.
JSON representation |
---|
{
"currencyCode": string,
"price": number,
"originalPrice": number,
"cost": number,
"priceEffectiveTime": string,
"priceExpireTime": string,
"priceRange": {
object ( |
Fields | |
---|---|
currency |
The 3-letter currency code defined in ISO 4217. If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned. The |
price |
Price of the product. Google Merchant Center property price. Schema.org property Offer.price. |
original |
Price of the product without any discount. If zero, by default set to be the |
cost |
The costs associated with the sale of a particular product. Used for gross profit reporting. Google Merchant Center property cost_of_goods_sold. |
price |
The timestamp when the Do not set if A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
price |
The timestamp when the Do not set if A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
price |
Output only. The price range of all the child Note: This field is OUTPUT_ONLY for |
PriceRange
The price range of all variant
Product
having the same Product.primary_product_id
.
JSON representation |
---|
{ "price": { object ( |
Fields | |
---|---|
price |
The inclusive |
original |
The inclusive |
Rating
The rating of a Product
.
JSON representation |
---|
{ "ratingCount": integer, "averageRating": number, "ratingHistogram": [ integer ] } |
Fields | |
---|---|
rating |
The total number of ratings. This value is independent of the value of This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. |
average |
The average rating of the The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is returned. |
rating |
List of rating counts per rating value (index = rating - 1). The list is empty if there is no rating. If the list is non-empty, its size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For example, [41, 14, 13, 47, 303]. It means that the |
Availability
Product availability. If this field is unspecified, the product is assumed to be in stock.
Enums | |
---|---|
AVAILABILITY_UNSPECIFIED |
Default product availability. Default to Availability.IN_STOCK if unset. |
IN_STOCK |
Product in stock. |
OUT_OF_STOCK |
Product out of stock. |
PREORDER |
Product that is in pre-order state. |
BACKORDER |
Product that is back-ordered (i.e. temporarily out of stock). |
FulfillmentInfo
Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.
JSON representation |
---|
{ "type": string, "placeIds": [ string ] } |
Fields | |
---|---|
type |
The fulfillment type, including commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:
If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. |
place |
The IDs for this A maximum of 3000 values are allowed. Each value must be a string with a length limit of 30 characters, matching the pattern |
Image
Product
image. Recommendations AI and Retail Search use product images to improve prediction and search results. Product images can be returned in results, and are shown in prediction or search previews in the console. Please try to provide correct product images and avoid using images with size too small.
JSON representation |
---|
{ "uri": string, "height": integer, "width": integer } |
Fields | |
---|---|
uri |
Required. URI of the image. This field must be a valid UTF-8 encoded URI with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property image_link. Schema.org property Product.image. |
height |
Height of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. |
width |
Width of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. |
Audience
An intended audience of the Product
for whom it's sold.
JSON representation |
---|
{ "genders": [ string ], "ageGroups": [ string ] } |
Fields | |
---|---|
genders[] |
The genders of the audience. Strongly encouraged to use the standard values: "male", "female", "unisex". At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property gender. Schema.org property Product.audience.suggestedGender. |
age |
The age groups of the audience. Strongly encouraged to use the standard values: "newborn" (up to 3 months old), "infant" (3–12 months old), "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically teens or older). At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property age_group. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge. |
ColorInfo
The color information of a Product
.
JSON representation |
---|
{ "colorFamilies": [ string ], "colors": [ string ] } |
Fields | |
---|---|
color |
The standard color families. Strongly recommended to use the following standard color groups: "Red", "Pink", "Orange", "Yellow", "Purple", "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and "Mixed". Normally it is expected to have only 1 color family. May consider using single "Mixed" instead of multiple values. A maximum of 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property color. Schema.org property Product.color. The colorFamilies field as a system attribute is not a required field but strongly recommended to be specified. Google Search models treat this field as more important than a custom product attribute when specified. |
colors[] |
The color display names, which may be different from standard color family names, such as the color aliases used in the website frontend. Normally it is expected to have only 1 color. May consider using single "Mixed" instead of multiple values. A maximum of 75 colors are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property color. Schema.org property Product.color. |
Promotion
Promotion specification.
JSON representation |
---|
{ "promotionId": string } |
Fields | |
---|---|
promotion |
The value must be a UTF-8 encoded string with a length limit of 128 characters, and match the pattern: Corresponds to Google Merchant Center property promotionId. |
LocalInventory
The inventory information at a place (e.g. a store) identified by a place ID.
JSON representation |
---|
{ "placeId": string, "priceInfo": { object ( |
Fields | |
---|---|
place |
Required. The place ID for the current set of inventory information. |
price |
Optional. Product price and cost information. Google Merchant Center property price. |
availability |
Optional. The availability of the For primary products with variants set the availability of the primary as [Availability.OUT_OF_STOCK][] and set the true availability at the variant level. This way the primary product will be considered "in stock" as long as it has at least one variant in stock. For primary products with no variants set the true availability at the primary level. Corresponding properties: Google Merchant Center property availability. Schema.org property Offer.availability. |
attributes |
Optional. Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
|
attributes. |
The textual values of this custom attribute. For example, Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is returned. Exactly one of |
attributes. |
The numerical values of this custom attribute. For example, Exactly one of |
attributes.searchable |
This field is normally ignored unless This field is ignored in a Only set if type |
attributes.indexable |
This field is normally ignored unless This field is ignored in a See |
fulfillment |
Optional. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:
If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned. |
Methods |
|
---|---|
|
We recommend that you use the ProductService.AddLocalInventories method instead of the ProductService.AddFulfillmentPlaces method. |
|
Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. |
|
Creates a Product . |
|
Deletes a Product . |
|
Exports multiple Product s. |
|
Gets a Product . |
|
Bulk import of multiple Product s. |
|
Gets a list of Product s. |
|
Updates a Product . |
|
Permanently deletes all selected Product s under a branch. |
|
We recommend that you use the ProductService.RemoveLocalInventories method instead of the ProductService.RemoveFulfillmentPlaces method. |
|
Remove local inventory information for a Product at a list of places at a removal timestamp. |
|
Updates inventory information for a Product while respecting the last update timestamps of each inventory field. |