Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry.
Scopes
You will need authorization for the https://www.googleapis.com/auth/content scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/content.
You can set the scope for this method like this: content2 --scope <scope> products insert ...
Required Scalar Argument
- <merchant-id> (string)
- The ID of the account that contains the product. This account cannot be a multi-client account.
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
Product:
additional-image-links: [string]
additional-product-types: [string]
adult: boolean
adwords-grouping: string
adwords-labels: [string]
adwords-redirect: string
age-group: string
availability: string
availability-date: string
brand: string
canonical-link: string
channel: string
color: string
condition: string
content-language: string
cost-of-goods-sold:
currency: string
value: string
custom-label0: string
custom-label1: string
custom-label2: string
custom-label3: string
custom-label4: string
description: string
display-ads-id: string
display-ads-link: string
display-ads-similar-ids: [string]
display-ads-title: string
display-ads-value: number
energy-efficiency-class: string
expiration-date: string
gender: string
google-product-category: string
gtin: string
id: string
identifier-exists: boolean
image-link: string
installment:
amount:
currency: string
value: string
months: string
is-bundle: boolean
item-group-id: string
kind: string
link: string
loyalty-points:
name: string
points-value: string
ratio: number
material: string
max-energy-efficiency-class: string
max-handling-time: string
min-energy-efficiency-class: string
min-handling-time: string
mobile-link: string
mpn: string
multipack: string
offer-id: string
online-only: boolean
pattern: string
price:
currency: string
value: string
product-type: string
promotion-ids: [string]
sale-price:
currency: string
value: string
sale-price-effective-date: string
sell-on-google-quantity: string
shipping-height:
unit: string
value: number
shipping-label: string
shipping-length:
unit: string
value: number
shipping-weight:
unit: string
value: number
shipping-width:
unit: string
value: number
size-system: string
size-type: string
sizes: [string]
source: string
target-country: int64
title: string
unit-pricing-base-measure:
unit: string
value: string
unit-pricing-measure:
unit: string
value: number
validated-destinations: [string]
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r . additional-image-links=erat
- Additional URLs of images of the item.
- Each invocation of this argument appends the given value to the array.
additional-product-types=justo
- Additional categories of the item (formatted as in products data specification).
- Each invocation of this argument appends the given value to the array.
adult=false
- Should be set to true if the item is targeted towards adults.
adwords-grouping=dolores
- Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise.
adwords-labels=consetetur
- Similar to adwords_grouping, but only works on CPC.
- Each invocation of this argument appends the given value to the array.
adwords-redirect=no
- Allows advertisers to override the item URL when the product is shown within the context of Product Ads.
age-group=justo
- Target age group of the item. Acceptable values are: - "
adult
" - "infant
" - "kids
" - "newborn
" - "toddler
" - "youngAdult
"
- Target age group of the item. Acceptable values are: - "
availability=sadipscing
- Availability status of the item. Acceptable values are: - "
in stock
" - "out of stock
" - "preorder
"
- Availability status of the item. Acceptable values are: - "
availability-date=diam
- The day a pre-ordered product becomes available for delivery, in ISO 8601 format.
brand=sea
- Brand of the item.
canonical-link=ipsum
- URL for the canonical version of your item's landing page.
channel=stet
- Required. The item's channel (online or local). Acceptable values are: - "
local
" - "online
"
- Required. The item's channel (online or local). Acceptable values are: - "
color=gubergren
- Color of the item.
condition=ipsum
- Condition or state of the item. Acceptable values are: - "
new
" - "refurbished
" - "used
"
- Condition or state of the item. Acceptable values are: - "
content-language=no
- Required. The two-letter ISO 639-1 language code for the item.
cost-of-goods-sold currency=sit
- The currency of the price.
-
value=kasd
- The price represented as a number.
-
.. custom-label0=amet
- Custom label 0 for custom grouping of items in a Shopping campaign.
custom-label1=lorem
- Custom label 1 for custom grouping of items in a Shopping campaign.
custom-label2=justo
- Custom label 2 for custom grouping of items in a Shopping campaign.
custom-label3=invidunt
- Custom label 3 for custom grouping of items in a Shopping campaign.
custom-label4=sed
- Custom label 4 for custom grouping of items in a Shopping campaign.
description=nonumy
- Description of the item.
display-ads-id=sea
- An identifier for an item for dynamic remarketing campaigns.
display-ads-link=ipsum
- URL directly to your item's landing page for dynamic remarketing campaigns.
display-ads-similar-ids=kasd
- Advertiser-specified recommendations.
- Each invocation of this argument appends the given value to the array.
display-ads-title=justo
- Title of an item for dynamic remarketing campaigns.
display-ads-value=0.6596318919873574
- Offer margin for dynamic remarketing campaigns.
energy-efficiency-class=at
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
A
" - "A+
" - "A++
" - "A+++
" - "B
" - "C
" - "D
" - "E
" - "F
" - "G
"
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
expiration-date=erat
- Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in
productstatuses
asgoogleExpirationDate
and might be earlier ifexpirationDate
is too far in the future.
- Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in
gender=clita
- Target gender of the item. Acceptable values are: - "
female
" - "male
" - "unisex
"
- Target gender of the item. Acceptable values are: - "
google-product-category=vero
- Google's category of the item (see Google product taxonomy). When querying products, this field will contain the user provided value. There is currently no way to get back the auto assigned google product categories through the API.
gtin=invidunt
- Global Trade Item Number (GTIN) of the item.
id=nonumy
- The REST ID of the product. Content API methods that operate on products take this as their
productId
parameter. The REST ID for a product is of the form channel:contentLanguage: targetCountry: offerId.
- The REST ID of the product. Content API methods that operate on products take this as their
identifier-exists=false
- False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the Unique Product Identifier Rules for all target countries except for Canada.
image-link=erat
- URL of an image of the item.
installment.amount currency=dolores
- The currency of the price.
-
value=ipsum
- The price represented as a number.
-
.. months=voluptua.
- The number of installments the buyer has to pay.
-
.. is-bundle=false
- Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price.
item-group-id=elitr
- Shared identifier for all variants of the same product.
kind=consetetur
- Identifies what kind of resource this is. Value: the fixed string "
content#product
"
- Identifies what kind of resource this is. Value: the fixed string "
link=et
- URL directly linking to your item's page on your website.
loyalty-points name=clita
- Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters.
points-value=sit
- The retailer's loyalty points in absolute value.
-
ratio=0.32829879113659266
- The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0.
-
.. material=erat
- The material of which the item is made.
max-energy-efficiency-class=diam
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
A
" - "A+
" - "A++
" - "A+++
" - "B
" - "C
" - "D
" - "E
" - "F
" - "G
"
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
max-handling-time=nonumy
- Maximal product handling time (in business days).
min-energy-efficiency-class=lorem
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
A
" - "A+
" - "A++
" - "A+++
" - "B
" - "C
" - "D
" - "E
" - "F
" - "G
"
- The energy efficiency class as defined in EU directive 2010/30/EU. Acceptable values are: - "
min-handling-time=at
- Minimal product handling time (in business days).
mobile-link=diam
- URL for the mobile-optimized version of your item's landing page.
mpn=diam
- Manufacturer Part Number (MPN) of the item.
multipack=sed
- The number of identical products in a merchant-defined multipack.
offer-id=et
- Required. A unique identifier for the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. Only valid unicode characters are accepted. See the products feed specification for details. Note: Content API methods that operate on products take the REST ID of the product, not this identifier.
online-only=false
- Deprecated.
pattern=ipsum
- The item's pattern (e.g. polka dots).
price currency=ea
- The currency of the price.
-
value=at
- The price represented as a number.
-
.. product-type=sit
- Your category of the item (formatted as in products data specification).
promotion-ids=sit
- The unique ID of a promotion.
- Each invocation of this argument appends the given value to the array.
sale-price currency=lorem
- The currency of the price.
-
value=stet
- The price represented as a number.
-
.. sale-price-effective-date=duo
- Date range during which the item is on sale (see products data specification ).
sell-on-google-quantity=elitr
- The quantity of the product that is available for selling on Google. Supported only for online products.
shipping-height unit=aliquyam
- The unit of value.
-
value=0.5502099166314959
- The dimension of the product used to calculate the shipping cost of the item.
-
.. shipping-label=ut
- The shipping label of the product, used to group product in account-level shipping rules.
shipping-length unit=et
- The unit of value.
-
value=0.9734580099452333
- The dimension of the product used to calculate the shipping cost of the item.
-
..shipping-weight unit=rebum.
- The unit of value.
-
value=0.5220589381617724
- The weight of the product used to calculate the shipping cost of the item.
-
..shipping-width unit=stet
- The unit of value.
-
value=0.15591803706823315
- The dimension of the product used to calculate the shipping cost of the item.
-
.. size-system=lorem
- System in which the size is specified. Recommended for apparel items. Acceptable values are: - "
AU
" - "BR
" - "CN
" - "DE
" - "EU
" - "FR
" - "IT
" - "JP
" - "MEX
" - "UK
" - "US
"
- System in which the size is specified. Recommended for apparel items. Acceptable values are: - "
size-type=sit
- The cut of the item. Recommended for apparel items. Acceptable values are: - "
big and tall
" - "maternity
" - "oversize
" - "petite
" - "plus
" - "regular
"
- The cut of the item. Recommended for apparel items. Acceptable values are: - "
sizes=kasd
- Size of the item. Only one value is allowed. For variants with different sizes, insert a separate product for each size with the same
itemGroupId
value (see size definition). - Each invocation of this argument appends the given value to the array.
- Size of the item. Only one value is allowed. For variants with different sizes, insert a separate product for each size with the same
source=tempor
- The source of the offer, i.e., how the offer was created. Acceptable values are: - "
api
" - "crawl
" - "feed
"
- The source of the offer, i.e., how the offer was created. Acceptable values are: - "
target-country=-54
- Required. The CLDR territory code for the item.
title=amet
- Title of the item.
unit-pricing-base-measure unit=sit
- The unit of the denominator.
-
value=rebum.
- The denominator of the unit price.
-
..unit-pricing-measure unit=sea
- The unit of the measure.
-
value=0.012890508443760607
- The measure of an item.
-
.. validated-destinations=et
- Deprecated. The read-only list of intended destinations which passed validation.
- Each invocation of this argument appends the given value to the array.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional Method Properties
You may set the following properties to further configure the call. Please note that -p
is followed by one
or more key-value-pairs, and is called like this -p k1=v1 k2=v2
even though the listing below repeats the
-p
for completeness.
- -p dry-run=boolean
- Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").