1- // Copyright 2025 Google LLC
1+ // Copyright 2026 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -99,8 +99,51 @@ message LocalInventory {
9999 // Output only. The name of the `LocalInventory` resource.
100100 // Format:
101101 // `accounts/{account}/products/{product}/localInventories/{store_code}`
102+ //
103+ // The `{product}` segment is a unique identifier for the product.
104+ // This identifier must be unique within a merchant account and generally
105+ // follows the structure: `content_language~feed_label~offer_id`. Example:
106+ // `en~US~sku123` For legacy local products, the structure is:
107+ // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`
108+ //
109+ // The format of the `{product}` segment in the URL is automatically detected
110+ // by the server, supporting two options:
111+ //
112+ // 1. **Encoded Format**: The `{product}` segment is an unpadded base64url
113+ // encoded string (RFC 4648 Section 5). The decoded string must result
114+ // in the `content_language~feed_label~offer_id` structure. This encoding
115+ // MUST be used if any part of the product identifier (like `offer_id`)
116+ // contains characters such as `/`, `%`, or `~`.
117+ // * Example: To represent the product ID `en~US~sku/123` for
118+ // `store_code` "store123", the `{product}` segment must be the
119+ // base64url encoding of this string, which is `ZW5-VVN-c2t1LzEyMw`.
120+ // The full resource name for the local inventory would be
121+ // `accounts/123/products/ZW5-VVN-c2t1LzEyMw/localInventories/store123`.
122+ //
123+ // 2. **Plain Format**: The `{product}` segment is the tilde-separated string
124+ // `content_language~feed_label~offer_id`. This format is suitable only
125+ // when `content_language`, `feed_label`, and `offer_id` do not contain
126+ // URL-problematic characters like `/`, `%`, or `~`.
127+ //
128+ // We recommend using the **Encoded Format** for all product IDs to ensure
129+ // correct parsing, especially those containing special characters. The
130+ // presence of tilde (`~`) characters in the `{product}` segment is used to
131+ // differentiate between the two formats.
102132 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
103133
134+ // Output only. The unpadded base64url encoded name of the `LocalInventory`
135+ // resource. Format:
136+ // `accounts/{account}/products/{product}/localInventories/{store_code}`
137+ // where the `{product}` segment is the unpadded base64url encoded value of
138+ // the identifier of the form `content_language~feed_label~offer_id`. Example:
139+ // `accounts/123/products/ZW5-VVN-c2t1LzEyMw/localInventories/store123` for
140+ // the decoded product ID `en~US~sku/123` and `store_code` "store123".
141+ // Can be used directly as input to the API methods that require the local
142+ // product identifier within the local inventory name to be encoded if it
143+ // contains special characters, for example
144+ // [`GetLocalInventory`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.localInventories/get).
145+ string base64_encoded_name = 15 [(google.api.field_behavior ) = OUTPUT_ONLY ];
146+
104147 // Output only. The account that owns the product. This field will be ignored
105148 // if set by the client.
106149 int64 account = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
@@ -125,6 +168,36 @@ message ListLocalInventoriesRequest {
125168 // Required. The `name` of the parent product to list local inventories for.
126169 // Format:
127170 // `accounts/{account}/products/{product}`
171+ //
172+ // The `{product}` segment is a unique identifier for the product.
173+ // This identifier must be unique within a merchant account and generally
174+ // follows the structure: `content_language~feed_label~offer_id`. Example:
175+ // `en~US~sku123` For legacy local products, the structure is:
176+ // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`
177+ //
178+ // The format of the `{product}` segment in the URL is automatically detected
179+ // by the server, supporting two options:
180+ //
181+ // 1. **Encoded Format**: The `{product}` segment is an unpadded base64url
182+ // encoded string (RFC 4648 Section 5). The decoded string must result
183+ // in the `content_language~feed_label~offer_id` structure. This encoding
184+ // MUST be used if any part of the product identifier (like `offer_id`)
185+ // contains characters such as `/`, `%`, or `~`.
186+ // * Example: To represent the product ID `en~US~sku/123`, the
187+ // `{product}` segment must be the unpadded base64url encoding of this
188+ // string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
189+ // for the product would be
190+ // `accounts/123/products/ZW5-VVN-c2t1LzEyMw`.
191+ //
192+ // 2. **Plain Format**: The `{product}` segment is the tilde-separated string
193+ // `content_language~feed_label~offer_id`. This format is suitable only
194+ // when `content_language`, `feed_label`, and `offer_id` do not contain
195+ // URL-problematic characters like `/`, `%`, or `~`.
196+ //
197+ // We recommend using the **Encoded Format** for all product IDs to ensure
198+ // correct parsing, especially those containing special characters. The
199+ // presence of tilde (`~`) characters in the `{product}` segment is used to
200+ // differentiate between the two formats.
128201 string parent = 1 [
129202 (google.api.field_behavior ) = REQUIRED ,
130203 (google.api.resource_reference ) = {
@@ -164,6 +237,36 @@ message ListLocalInventoriesResponse {
164237message InsertLocalInventoryRequest {
165238 // Required. The account and product where this inventory will be inserted.
166239 // Format: `accounts/{account}/products/{product}`
240+ //
241+ // The `{product}` segment is a unique identifier for the product.
242+ // This identifier must be unique within a merchant account and generally
243+ // follows the structure: `content_language~feed_label~offer_id`. Example:
244+ // `en~US~sku123` For legacy local products, the structure is:
245+ // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`
246+ //
247+ // The format of the `{product}` segment in the URL is automatically detected
248+ // by the server, supporting two options:
249+ //
250+ // 1. **Encoded Format**: The `{product}` segment is an unpadded base64url
251+ // encoded string (RFC 4648 Section 5). The decoded string must result
252+ // in the `content_language~feed_label~offer_id` structure. This encoding
253+ // MUST be used if any part of the product identifier (like `offer_id`)
254+ // contains characters such as `/`, `%`, or `~`.
255+ // * Example: To represent the product ID `en~US~sku/123`, the
256+ // `{product}` segment must be the unpadded base64url encoding of this
257+ // string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
258+ // for the product would be
259+ // `accounts/123/products/ZW5-VVN-c2t1LzEyMw`.
260+ //
261+ // 2. **Plain Format**: The `{product}` segment is the tilde-separated string
262+ // `content_language~feed_label~offer_id`. This format is suitable only
263+ // when `content_language`, `feed_label`, and `offer_id` do not contain
264+ // URL-problematic characters like `/`, `%`, or `~`.
265+ //
266+ // We recommend using the **Encoded Format** for all product IDs to ensure
267+ // correct parsing, especially those containing special characters. The
268+ // presence of tilde (`~`) characters in the `{product}` segment is used to
269+ // differentiate between the two formats.
167270 string parent = 1 [
168271 (google.api.field_behavior ) = REQUIRED ,
169272 (google.api.resource_reference ) = {
@@ -182,6 +285,37 @@ message DeleteLocalInventoryRequest {
182285 // Required. The name of the local inventory for the given product to delete.
183286 // Format:
184287 // `accounts/{account}/products/{product}/localInventories/{store_code}`
288+ //
289+ // The `{product}` segment is a unique identifier for the product.
290+ // This identifier must be unique within a merchant account and generally
291+ // follows the structure: `content_language~feed_label~offer_id`. Example:
292+ // `en~US~sku123` For legacy local products, the structure is:
293+ // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`
294+ //
295+ // The format of the `{product}` segment in the URL is automatically detected
296+ // by the server, supporting two options:
297+ //
298+ // 1. **Encoded Format**: The `{product}` segment is an unpadded base64url
299+ // encoded string (RFC 4648 Section 5). The decoded string must result
300+ // in the `content_language~feed_label~offer_id` structure. This encoding
301+ // MUST be used if any part of the product identifier (like `offer_id`)
302+ // contains characters such as `/`, `%`, or `~`.
303+ // * Example: To represent the product ID `en~US~sku/123` for
304+ // `store_code` "store123", the `{product}` segment must be the
305+ // unpadded base64url encoding of this string, which is
306+ // `ZW5-VVN-c2t1LzEyMw`. The full resource name for the local
307+ // inventory would be
308+ // `accounts/123/products/ZW5-VVN-c2t1LzEyMw/localInventories/store123`.
309+ //
310+ // 2. **Plain Format**: The `{product}` segment is the tilde-separated string
311+ // `content_language~feed_label~offer_id`. This format is suitable only
312+ // when `content_language`, `feed_label`, and `offer_id` do not contain
313+ // URL-problematic characters like `/`, `%`, or `~`.
314+ //
315+ // We recommend using the **Encoded Format** for all product IDs to ensure
316+ // correct parsing, especially those containing special characters. The
317+ // presence of tilde (`~`) characters in the `{product}` segment is used to
318+ // differentiate between the two formats.
185319 string name = 1 [
186320 (google.api.field_behavior ) = REQUIRED ,
187321 (google.api.resource_reference ) = {
0 commit comments