Reference documentation and code samples for the Google Shopping Merchant Products V1beta Client class ProductInput.
This resource represents input data you submit for a product, not the
processed product that you see in Merchant Center, in Shopping ads, or
across Google surfaces. Product inputs, rules and supplemental data source
data are combined to create the processedProduct. For more
information, seeManage products.
Required product input attributes to pass data validation checks are
primarily defined in theProducts Data
Specification.
The following attributes are required:feedLabel,contentLanguageandofferId.
After inserting, updating, or deleting a product input, it may take several
minutes before the processed product can be retrieved.
All fields in the product input and its sub-messages match the English name
of their corresponding attribute in theProducts Data
Specificationwithsome exceptions.
The following reference documentation lists the field names in thecamelCasecasing style while the Products Data Specification lists the
names in thesnake_casecasing style.
Generated from protobuf messagegoogle.shopping.merchant.products.v1beta.ProductInput
Namespace
Google \ Shopping \ Merchant \ Products \ V1beta
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. The name of the product input. Format:accounts/{account}/productInputs/{productinput}where the last sectionproductinputconsists of 4 parts:channel~content_language~feed_label~offer_idexample for product input name isaccounts/123/productInputs/online~en~US~sku123
↳ product
string
Output only. The name of the processed product. Format:accounts/{account}/products/{product}
Required. Immutable. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See theproducts data specificationfor details.
↳ content_language
string
Required. Immutable. The two-letterISO 639-1language code for the product.
↳ feed_label
string
Required. Immutable. The label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters areA-Z,0-9, hyphen, and underscore. The feed label must not include any spaces. For more information, seeUsing feed labels.
↳ version_number
int|string
Optional. Immutable. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the currentversion_number. Only supported for insertions into primary data sources. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown.
Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the data specification in its generic form (for example,{ "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion.
getName
Identifier. The name of the product input.
Format:accounts/{account}/productInputs/{productinput}where the last sectionproductinputconsists of 4 parts:channel~content_language~feed_label~offer_idexample for product input name isaccounts/123/productInputs/online~en~US~sku123
Returns
Type
Description
string
setName
Identifier. The name of the product input.
Format:accounts/{account}/productInputs/{productinput}where the last sectionproductinputconsists of 4 parts:channel~content_language~feed_label~offer_idexample for product input name isaccounts/123/productInputs/online~en~US~sku123
Required. Immutable. Your unique identifier for the product. This is the
same for the product input and processed product. Leading and trailing
whitespaces are stripped and multiple whitespaces are replaced by a single
whitespace upon submission. See theproducts data
specificationfor
details.
Returns
Type
Description
string
setOfferId
Required. Immutable. Your unique identifier for the product. This is the
same for the product input and processed product. Leading and trailing
whitespaces are stripped and multiple whitespaces are replaced by a single
whitespace upon submission. See theproducts data
specificationfor
details.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getContentLanguage
Required. Immutable. The two-letterISO
639-1language code for the
product.
Returns
Type
Description
string
setContentLanguage
Required. Immutable. The two-letterISO
639-1language code for the
product.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getFeedLabel
Required. Immutable. The label that lets you categorize and identify your
products. The maximum allowed characters are 20, and the supported
characters areA-Z,0-9, hyphen, and underscore. The feed label must
not include any spaces. For more information, seeUsing feed
labels.
Returns
Type
Description
string
setFeedLabel
Required. Immutable. The label that lets you categorize and identify your
products. The maximum allowed characters are 20, and the supported
characters areA-Z,0-9, hyphen, and underscore. The feed label must
not include any spaces. For more information, seeUsing feed
labels.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersionNumber
Optional. Immutable. Represents the existing version (freshness) of the
product, which can be used to preserve the right order when multiple
updates are done at the same time.
If set, the insertion is prevented when version number is lower than
the current version number of the existing product. Re-insertion (for
example, product refresh after 30 days) can be performed with the currentversion_number.
Only supported for insertions into primary data sources.
Do not set this field for updates.
Do not set this field for insertions into supplemental data sources.
If the operation is prevented, the aborted exception will be
thrown.
Returns
Type
Description
int|string
hasVersionNumber
clearVersionNumber
setVersionNumber
Optional. Immutable. Represents the existing version (freshness) of the
product, which can be used to preserve the right order when multiple
updates are done at the same time.
If set, the insertion is prevented when version number is lower than
the current version number of the existing product. Re-insertion (for
example, product refresh after 30 days) can be performed with the currentversion_number.
Only supported for insertions into primary data sources.
Do not set this field for updates.
Do not set this field for insertions into supplemental data sources.
If the operation is prevented, the aborted exception will be
thrown.
Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting any attribute of the data specification in its generic
form (for example,{ "name": "size type", "value": "regular" }).
This is useful for submitting attributes not explicitly exposed by the
API.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.
Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting any attribute of the data specification in its generic
form (for example,{ "name": "size type", "value": "regular" }).
This is useful for submitting attributes not explicitly exposed by the
API.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Shopping Merchant Products V1beta Client - Class ProductInput (1.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0 (latest)](/php/docs/reference/shopping-merchant-products/latest/V1beta.ProductInput)\n- [0.7.0](/php/docs/reference/shopping-merchant-products/0.7.0/V1beta.ProductInput)\n- [0.6.1](/php/docs/reference/shopping-merchant-products/0.6.1/V1beta.ProductInput)\n- [0.5.0](/php/docs/reference/shopping-merchant-products/0.5.0/V1beta.ProductInput)\n- [0.4.0](/php/docs/reference/shopping-merchant-products/0.4.0/V1beta.ProductInput)\n- [0.3.0](/php/docs/reference/shopping-merchant-products/0.3.0/V1beta.ProductInput)\n- [0.2.1](/php/docs/reference/shopping-merchant-products/0.2.1/V1beta.ProductInput)\n- [0.1.1](/php/docs/reference/shopping-merchant-products/0.1.1/V1beta.ProductInput) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Google Shopping Merchant Products V1beta Client class ProductInput.\n\nThis resource represents input data you submit for a product, not the\nprocessed product that you see in Merchant Center, in Shopping ads, or\nacross Google surfaces. Product inputs, rules and supplemental data source\ndata are combined to create the processed\n[Product](/php/docs/reference/shopping-merchant-products/latest/V1beta.Product). For more\ninformation, see [Manage products](/merchant/api/guides/products/overview).\n\nRequired product input attributes to pass data validation checks are\nprimarily defined in the [Products Data\nSpecification](https://support.google.com/merchants/answer/188494).\nThe following attributes are required:\n[feedLabel](/php/docs/reference/shopping-merchant-products/latest/V1beta.Product#_Google_Shopping_Merchant_Products_V1beta_Product__getFeedLabel__),\n[contentLanguage](/php/docs/reference/shopping-merchant-products/latest/V1beta.Product#_Google_Shopping_Merchant_Products_V1beta_Product__getContentLanguage__)\nand [offerId](/php/docs/reference/shopping-merchant-products/latest/V1beta.Product#_Google_Shopping_Merchant_Products_V1beta_Product__getOfferId__).\nAfter inserting, updating, or deleting a product input, it may take several\nminutes before the processed product can be retrieved.\nAll fields in the product input and its sub-messages match the English name\nof their corresponding attribute in the [Products Data\nSpecification](https://support.google.com/merchants/answer/188494) with\n[some exceptions](https://support.google.com/merchants/answer/7052112).\nThe following reference documentation lists the field names in the\n**camelCase** casing style while the Products Data Specification lists the\nnames in the **snake_case** casing style.\n\nGenerated from protobuf message `google.shopping.merchant.products.v1beta.ProductInput`\n\nNamespace\n---------\n\nGoogle \\\\ Shopping \\\\ Merchant \\\\ Products \\\\ V1beta\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nIdentifier. The name of the product input.\n\nFormat: `accounts/{account}/productInputs/{productinput}`\nwhere the last section `productinput` consists of 4 parts:\n`channel~content_language~feed_label~offer_id`\nexample for product input name is\n`accounts/123/productInputs/online~en~US~sku123`\n\n### setName\n\nIdentifier. The name of the product input.\n\nFormat: `accounts/{account}/productInputs/{productinput}`\nwhere the last section `productinput` consists of 4 parts:\n`channel~content_language~feed_label~offer_id`\nexample for product input name is\n`accounts/123/productInputs/online~en~US~sku123`\n\n### getProduct\n\nOutput only. The name of the processed product.\n\nFormat: `accounts/{account}/products/{product}`\n\n### setProduct\n\nOutput only. The name of the processed product.\n\nFormat: `accounts/{account}/products/{product}`\n\n### getChannel\n\nImmutable. The\n[channel](https://support.google.com/merchants/answer/7361332) of the\nproduct.\n\n### setChannel\n\nImmutable. The\n[channel](https://support.google.com/merchants/answer/7361332) of the\nproduct.\n\n### getOfferId\n\nRequired. Immutable. Your unique identifier for the product. This is the\nsame for the product input and processed product. Leading and trailing\nwhitespaces are stripped and multiple whitespaces are replaced by a single\nwhitespace upon submission. See the [products data\nspecification](https://support.google.com/merchants/answer/188494#id) for\ndetails.\n\n### setOfferId\n\nRequired. Immutable. Your unique identifier for the product. This is the\nsame for the product input and processed product. Leading and trailing\nwhitespaces are stripped and multiple whitespaces are replaced by a single\nwhitespace upon submission. See the [products data\nspecification](https://support.google.com/merchants/answer/188494#id) for\ndetails.\n\n### getContentLanguage\n\nRequired. Immutable. The two-letter [ISO\n639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the\nproduct.\n\n### setContentLanguage\n\nRequired. Immutable. The two-letter [ISO\n639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the\nproduct.\n\n### getFeedLabel\n\nRequired. Immutable. The label that lets you categorize and identify your\nproducts. The maximum allowed characters are 20, and the supported\ncharacters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must\nnot include any spaces. For more information, see [Using feed\nlabels](//support.google.com/merchants/answer/14994087).\n\n### setFeedLabel\n\nRequired. Immutable. The label that lets you categorize and identify your\nproducts. The maximum allowed characters are 20, and the supported\ncharacters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must\nnot include any spaces. For more information, see [Using feed\nlabels](//support.google.com/merchants/answer/14994087).\n\n### getVersionNumber\n\nOptional. Immutable. Represents the existing version (freshness) of the\nproduct, which can be used to preserve the right order when multiple\nupdates are done at the same time.\n\nIf set, the insertion is prevented when version number is lower than\nthe current version number of the existing product. Re-insertion (for\nexample, product refresh after 30 days) can be performed with the current\n`version_number`.\nOnly supported for insertions into primary data sources.\nDo not set this field for updates.\nDo not set this field for insertions into supplemental data sources.\nIf the operation is prevented, the aborted exception will be\nthrown.\n\n### hasVersionNumber\n\n### clearVersionNumber\n\n### setVersionNumber\n\nOptional. Immutable. Represents the existing version (freshness) of the\nproduct, which can be used to preserve the right order when multiple\nupdates are done at the same time.\n\nIf set, the insertion is prevented when version number is lower than\nthe current version number of the existing product. Re-insertion (for\nexample, product refresh after 30 days) can be performed with the current\n`version_number`.\nOnly supported for insertions into primary data sources.\nDo not set this field for updates.\nDo not set this field for insertions into supplemental data sources.\nIf the operation is prevented, the aborted exception will be\nthrown.\n\n### getAttributes\n\nOptional. A list of product attributes.\n\n### hasAttributes\n\n### clearAttributes\n\n### setAttributes\n\nOptional. A list of product attributes.\n\n### getCustomAttributes\n\nOptional. A list of custom (merchant-provided) attributes. It can also be\nused for submitting any attribute of the data specification in its generic\nform (for example,\n`{ \"name\": \"size type\", \"value\": \"regular\" }`).\n\nThis is useful for submitting attributes not explicitly exposed by the\nAPI.\nMaximum allowed number of characters for each\ncustom attribute is 10240 (represents sum of characters for name and\nvalue). Maximum 2500 custom attributes can be set per product, with total\nsize of 102.4kB. Underscores in custom attribute names are replaced by\nspaces upon insertion.\n\n### setCustomAttributes\n\nOptional. A list of custom (merchant-provided) attributes. It can also be\nused for submitting any attribute of the data specification in its generic\nform (for example,\n`{ \"name\": \"size type\", \"value\": \"regular\" }`).\n\nThis is useful for submitting attributes not explicitly exposed by the\nAPI.\nMaximum allowed number of characters for each\ncustom attribute is 10240 (represents sum of characters for name and\nvalue). Maximum 2500 custom attributes can be set per product, with total\nsize of 102.4kB. Underscores in custom attribute names are replaced by\nspaces upon insertion."]]