# REST Resource: accounts.productInputs

- [Resource: ProductInput](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs#ProductInput)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs#ProductInput.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs#METHODS_SUMMARY)

## Resource: 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 processed `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products#Product`. For more information, see [Manage products](https://developers.google.com/merchant/api/guides/products/overview).

Required product input attributes to pass data validation checks are primarily defined in the [Products Data Specification](https://support.google.com/merchants/answer/188494).

The following attributes are required: `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products#Product.FIELDS.feed_label`, `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products#Product.FIELDS.content_language` and `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products#Product.FIELDS.offer_id`.

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 the [Products Data Specification](https://support.google.com/merchants/answer/188494) with [some exceptions](https://support.google.com/merchants/answer/7052112). The following reference documentation lists the field names in the **camelCase** casing style while the Products Data Specification lists the names in the **snake_case** casing style.

| JSON representation |
|---|
| ``` { "name": string, "base64EncodedName": string, "product": string, "base64EncodedProduct": string, "legacyLocal": boolean, "offerId": string, "contentLanguage": string, "feedLabel": string, "productAttributes": { object (`https://developers.google.com/merchant/api/reference/rest/products_v1/ProductAttributes`) }, "customAttributes": [ { object (`https://developers.google.com/merchant/api/reference/rest/Shared.Types/CustomAttribute`) } ], "versionNumber": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The name of the product. Format: `accounts/{account}/productInputs/{productinput}` The {productinput} segment is a unique identifier for the product. This identifier must be unique within a merchant account and generally follows the structure: `contentLanguage~feedLabel~offerId`. Example: `en~US~sku123` For legacy local products, the structure is: `local~contentLanguage~feedLabel~offerId`. Example: `local~en~US~sku123` The format of the {productinput} segment in the URL is automatically detected by the server, supporting two options: 1. **Encoded Format** : The `{productinput}` segment is an unpadded base64url encoded string (RFC 4648 Section 5). The decoded string must result in the `contentLanguage~feedLabel~offerId` structure. This encoding MUST be used if any part of the product identifier (like `offerId`) contains characters such as `/`, `%`, or `~`. - Example: To represent the product ID `en~US~sku/123`, the `{productinput}` segment must be the unpadded base64url encoding of this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name for the product would be `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw`. 2. **Plain Format** : The `{productinput}` segment is the tilde-separated string `contentLanguage~feedLabel~offerId`. This format is suitable only when `contentLanguage`, `feedLabel`, and `offerId` do not contain URL-problematic characters like `/`, `%`, or `~`. We recommend using the **Encoded Format** for all product IDs to ensure correct parsing, especially those containing special characters. The presence of tilde (`~`) characters in the `{productinput}` segment is used to differentiate between the two formats. |
| `base64EncodedName` | `string` Output only. The **unpadded base64url encoded name** of the product input. Format: `accounts/{account}/productInputs/{productinput}` where the last section `productinput` is the unpadded base64url encoding of the `contentLanguage~feedLabel~offerId` name. Example: `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw` for the decoded product input name `accounts/123/productInputs/en~US~sku/123`. This field can be used directly as input to the API methods that require the product input name to be encoded if it contains special characters, for example [`GetProductInput`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/get). |
| `product` | `string` Output only. The name of the processed product. Format: `accounts/{account}/products/{product}` |
| `base64EncodedProduct` | `string` Output only. The **unpadded base64url encoded name** of the processed product. Format: `accounts/{account}/products/{product}` where the last section `product` is the unpadded base64url encoding of the `contentLanguage~feedLabel~offerId` name. Example: `accounts/123/products/ZW5-VVN-c2t1LzEyMw` for the decoded product name `accounts/123/products/en~US~sku/123`. This field can be used directly as input to the API methods that require the product name to be encoded if it contains special characters, for example [`GetProduct`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products/get). |
| `legacyLocal` | `boolean` Immutable. Determines whether the product is **only** targeting local destinations and whether the product name should be distinguished with a `local~` prefix. For example, `accounts/123/productInputs/local~en~US~sku123`. If a product that is not `legacyLocal` is already targeting local destinations, creating a `legacyLocal` product with an otherwise matching name will fail. |
| `offerId` | `string` 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 the [products data specification](https://support.google.com/merchants/answer/188494#id) for details. |
| `contentLanguage` | `string` Required. Immutable. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the product. |
| `feedLabel` | `string` Required. Immutable. The feed label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must not include any spaces. For more information, see [Using feed labels](https://support.google.com/merchants/answer/14994087). |
| `productAttributes` | ``object (`https://developers.google.com/merchant/api/reference/rest/products_v1/ProductAttributes`)`` Optional. A list of strongly-typed product attributes. |
| `customAttributes[]` | ``object (`https://developers.google.com/merchant/api/reference/rest/Shared.Types/CustomAttribute`)`` 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. |
| `versionNumber` | `string (https://developers.google.com/discovery/v1/type-format format)` 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 current `versionNumber`. 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. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/delete` | Deletes a product input from your Merchant Center account. |
| ### `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/insert` | [Uploads a product input to your Merchant Center account](https://developers.google.com/merchant/api/guides/products/add-manage#add_a_product). |
| ### `https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/patch` | Updates the existing product input in your Merchant Center account. |