1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.shopping.merchant.lfp.v1beta; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/protobuf/timestamp.proto"; 24import "google/shopping/type/types.proto"; 25 26option go_package = "cloud.google.com/go/shopping/merchant/lfp/apiv1beta/lfppb;lfppb"; 27option java_multiple_files = true; 28option java_outer_classname = "LfpInventoryProto"; 29option java_package = "com.google.shopping.merchant.lfp.v1beta"; 30option (google.api.resource_definition) = { 31 type: "merchantapi.googleapis.com/Account" 32 pattern: "accounts/{account}" 33}; 34 35// Service for a [LFP 36// partner](https://support.google.com/merchants/answer/7676652) to submit local 37// inventories for a merchant. 38service LfpInventoryService { 39 option (google.api.default_host) = "merchantapi.googleapis.com"; 40 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; 41 42 // Inserts a `LfpInventory` resource for the given target merchant account. If 43 // the resource already exists, it will be replaced. The inventory 44 // automatically expires after 30 days. 45 rpc InsertLfpInventory(InsertLfpInventoryRequest) returns (LfpInventory) { 46 option (google.api.http) = { 47 post: "/lfp/v1beta/{parent=accounts/*}/lfpInventories:insert" 48 body: "lfp_inventory" 49 }; 50 } 51} 52 53// Local Inventory for the merchant. 54message LfpInventory { 55 option (google.api.resource) = { 56 type: "merchantapi.googleapis.com/LfpInventory" 57 pattern: "accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}" 58 plural: "lfpInventories" 59 singular: "lfpInventory" 60 }; 61 62 // Output only. Identifier. The name for the `LfpInventory` resource. 63 // Format: 64 // `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` 65 string name = 1 [ 66 (google.api.field_behavior) = OUTPUT_ONLY, 67 (google.api.field_behavior) = IDENTIFIER 68 ]; 69 70 // Required. The Merchant Center ID of the merchant to submit the inventory 71 // for. 72 int64 target_account = 2 [(google.api.field_behavior) = REQUIRED]; 73 74 // Required. The identifier of the merchant's store. Either the store code 75 // inserted through `InsertLfpStore` or the store code in the Business 76 // Profile. 77 string store_code = 3 [(google.api.field_behavior) = REQUIRED]; 78 79 // Required. Immutable. A unique identifier for the product. If both 80 // inventories and sales are submitted for a merchant, this id should match 81 // for the same product. 82 // 83 // **Note**: if the merchant sells the same product new and used, they should 84 // have different IDs. 85 string offer_id = 4 [ 86 (google.api.field_behavior) = REQUIRED, 87 (google.api.field_behavior) = IMMUTABLE 88 ]; 89 90 // Required. The [CLDR territory 91 // code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) 92 // for the country where the product is sold. 93 string region_code = 5 [(google.api.field_behavior) = REQUIRED]; 94 95 // Required. The two-letter ISO 639-1 language code for the item. 96 string content_language = 6 [(google.api.field_behavior) = REQUIRED]; 97 98 // Optional. The Global Trade Item Number of the product. 99 optional string gtin = 7 [(google.api.field_behavior) = OPTIONAL]; 100 101 // Optional. The current price of the product. 102 google.shopping.type.Price price = 8 [(google.api.field_behavior) = OPTIONAL]; 103 104 // Required. Availability of the product at this store. 105 // For accepted attribute values, see the [local product inventory feed 106 // specification](https://support.google.com/merchants/answer/3061342) 107 string availability = 9 [(google.api.field_behavior) = REQUIRED]; 108 109 // Optional. Quantity of the product available at this store. Must be greater 110 // than or equal to zero. 111 optional int64 quantity = 10 [(google.api.field_behavior) = OPTIONAL]; 112 113 // Optional. The time when the inventory is collected. If not set, it will be 114 // set to the time when the inventory is submitted. 115 google.protobuf.Timestamp collection_time = 11 116 [(google.api.field_behavior) = OPTIONAL]; 117 118 // Optional. Supported pickup method for this offer. Unless the value is "not 119 // supported", this field must be submitted together with `pickupSla`. For 120 // accepted attribute values, see the [local product inventory feed 121 // specification](https://support.google.com/merchants/answer/3061342). 122 optional string pickup_method = 12 [(google.api.field_behavior) = OPTIONAL]; 123 124 // Optional. Expected date that an order will be ready for pickup relative to 125 // the order date. Must be submitted together with `pickupMethod`. For 126 // accepted attribute values, see the [local product inventory feed 127 // specification](https://support.google.com/merchants/answer/3061342). 128 optional string pickup_sla = 13 [(google.api.field_behavior) = OPTIONAL]; 129 130 // Optional. The [feed 131 // label](https://developers.google.com/shopping-content/guides/products/feed-labels) 132 // for the product. If this is not set, it will default to `regionCode`. 133 optional string feed_label = 14 [(google.api.field_behavior) = OPTIONAL]; 134} 135 136// Request message for the `InsertLfpInventory` method. 137message InsertLfpInventoryRequest { 138 // Required. The LFP provider account. 139 // Format: `accounts/{account}` 140 string parent = 1 [ 141 (google.api.field_behavior) = REQUIRED, 142 (google.api.resource_reference) = { 143 child_type: "merchantapi.googleapis.com/LfpInventory" 144 } 145 ]; 146 147 // Required. The inventory to insert. 148 LfpInventory lfp_inventory = 2 [(google.api.field_behavior) = REQUIRED]; 149} 150