Insert or replace a product
insert_product_inputUpsert a product into an API data source in Google Merchant Center by specifying data source, offer ID, content language, and feed label. Existing products with the same key are replaced.
Instructions
Uploads (upserts) a product into an API data source: an existing input with the same contentLanguagefeedLabelofferId in that data source is fully replaced. Requires data_source (an API-type source — create one with create_data_source or in Merchant Center; file feeds cannot be written). Inserting with a different data source MOVES the product to it. Returns the ProductInput (name, product = the future processed name, base64EncodedProduct). Processing is async: the processed product shows up in get_product/list_products after several minutes, and data-quality problems surface later in productStatus.itemLevelIssues, not as API errors. Prices go in product_attributes as {"price": {"amountMicros": "9990000", "currencyCode": "USD"}} (1 unit = 1,000,000 micros).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Merchant Center account ID (digits, e.g. "123456"). Omit to use the GOOGLE_MERCHANTS_ACCOUNT_ID default. | |
| offer_id | Yes | The merchant's unique offer ID (SKU). | |
| feed_label | Yes | Feed label, usually the target country CLDR code, e.g. "US" (≤20 chars, no spaces). | |
| data_source | Yes | Data source: numeric ID (e.g. "104628") or full name "accounts/{account}/dataSources/{id}". Product/promotion writes require an API-type data source (input: API), not a file feed. | |
| version_number | No | Optional int64 freshness guard (as a string): an insert with a lower version than the stored one is rejected. | |
| content_language | Yes | Two-letter ISO 639-1 language of the listing, e.g. "en". | |
| custom_attributes | No | Custom (non-standard) attributes as {name, value} pairs. | |
| product_attributes | No | Product attributes object: title, description, link, imageLink, price {amountMicros, currencyCode}, availability (in_stock/out_of_stock/preorder/backorder), condition (new/refurbished/used), gtin (array), brand, color, sizes, etc. Attribute names are camelCase. |