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/empty.proto"; 24 25option go_package = "cloud.google.com/go/shopping/merchant/lfp/apiv1beta/lfppb;lfppb"; 26option java_multiple_files = true; 27option java_outer_classname = "LfpStoreProto"; 28option java_package = "com.google.shopping.merchant.lfp.v1beta"; 29 30// Service for a [LFP 31// partner](https://support.google.com/merchants/answer/7676652) to submit local 32// stores for a merchant. 33service LfpStoreService { 34 option (google.api.default_host) = "merchantapi.googleapis.com"; 35 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; 36 37 // Retrieves information about a store. 38 rpc GetLfpStore(GetLfpStoreRequest) returns (LfpStore) { 39 option (google.api.http) = { 40 get: "/lfp/v1beta/{name=accounts/*/lfpStores/*}" 41 }; 42 option (google.api.method_signature) = "name"; 43 } 44 45 // Inserts a store for the target merchant. If the store with the same store 46 // code already exists, it will be replaced. 47 rpc InsertLfpStore(InsertLfpStoreRequest) returns (LfpStore) { 48 option (google.api.http) = { 49 post: "/lfp/v1beta/{parent=accounts/*}/lfpStores:insert" 50 body: "lfp_store" 51 }; 52 option (google.api.method_signature) = "parent,lfp_store"; 53 } 54 55 // Deletes a store for a target merchant. 56 rpc DeleteLfpStore(DeleteLfpStoreRequest) returns (google.protobuf.Empty) { 57 option (google.api.http) = { 58 delete: "/lfp/v1beta/{name=accounts/*/lfpStores/*}" 59 }; 60 option (google.api.method_signature) = "name"; 61 } 62 63 // Lists the stores of the target merchant, specified by the filter in 64 // `ListLfpStoresRequest`. 65 rpc ListLfpStores(ListLfpStoresRequest) returns (ListLfpStoresResponse) { 66 option (google.api.http) = { 67 get: "/lfp/v1beta/{parent=accounts/*}/lfpStores" 68 }; 69 option (google.api.method_signature) = "parent"; 70 } 71} 72 73// A store for the merchant. This will be used to match to a Google Business 74// Profile listing for the target merchant. If a matching listing can't be 75// found, the inventories or sales submitted with the store code will not be 76// used. 77message LfpStore { 78 option (google.api.resource) = { 79 type: "merchantapi.googleapis.com/LfpStore" 80 pattern: "accounts/{account}/lfpStores/{target_merchant}~{store_code}" 81 plural: "lfpStores" 82 singular: "lfpStore" 83 }; 84 85 // The state of matching `LfpStore` to a Google Business Profile listing. 86 enum StoreMatchingState { 87 // Store matching state unspecified. 88 STORE_MATCHING_STATE_UNSPECIFIED = 0; 89 90 // The `LfpStore` is successfully matched with a Google Business Profile 91 // store. 92 STORE_MATCHING_STATE_MATCHED = 1; 93 94 // The `LfpStore` is not matched with a Google Business Profile store. 95 STORE_MATCHING_STATE_FAILED = 2; 96 } 97 98 // Output only. Identifier. The name of the `LfpStore` resource. 99 // Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` 100 string name = 1 [ 101 (google.api.field_behavior) = OUTPUT_ONLY, 102 (google.api.field_behavior) = IDENTIFIER 103 ]; 104 105 // Required. The Merchant Center id of the merchant to submit the store for. 106 int64 target_account = 2 [(google.api.field_behavior) = REQUIRED]; 107 108 // Required. Immutable. A store identifier that is unique for the target 109 // merchant. 110 string store_code = 3 [ 111 (google.api.field_behavior) = REQUIRED, 112 (google.api.field_behavior) = IMMUTABLE 113 ]; 114 115 // Required. The street address of the store. 116 // Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA. 117 string store_address = 4 [(google.api.field_behavior) = REQUIRED]; 118 119 // Optional. The merchant or store name. 120 optional string store_name = 5 [(google.api.field_behavior) = OPTIONAL]; 121 122 // Optional. The store phone number in 123 // [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: 124 // `+15556767888` 125 optional string phone_number = 6 [(google.api.field_behavior) = OPTIONAL]; 126 127 // Optional. The website URL for the store or merchant. 128 optional string website_uri = 7 [(google.api.field_behavior) = OPTIONAL]; 129 130 // Optional. [Google My Business category 131 // id](https://gcid-explorer.corp.google.com/static/gcid.html). 132 repeated string gcid_category = 8 [(google.api.field_behavior) = OPTIONAL]; 133 134 // Optional. The [Google Place 135 // Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) 136 // of the store location. 137 optional string place_id = 9 [(google.api.field_behavior) = OPTIONAL]; 138 139 // Optional. Output only. The state of matching to a Google Business Profile 140 // listing. See 141 // [matchingStateHint][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint] 142 // for further details if no match is found. 143 StoreMatchingState matching_state = 10 [ 144 (google.api.field_behavior) = OPTIONAL, 145 (google.api.field_behavior) = OUTPUT_ONLY 146 ]; 147 148 // Optional. Output only. The hint of why the matching has failed. This is 149 // only set when 150 // [matchingState][google.shopping.merchant.lfp.v1beta.LfpStore.matching_state]=`STORE_MATCHING_STATE_FAILED`. 151 // 152 // Possible values are: 153 // 154 // - "`linked-store-not-found`": There aren't any Google Business 155 // Profile stores available for matching. 156 // - "`store-match-not-found`": The provided `LfpStore` couldn't be matched to 157 // any of the connected Google Business Profile stores. Merchant Center 158 // account is connected correctly and stores are available on Google Business 159 // Profile, but the `LfpStore` location address does not match with Google 160 // Business Profile stores' addresses. Update the `LfpStore` address or Google 161 // Business Profile store address to match correctly. 162 // - "`store-match-unverified`": The provided `LfpStore` couldn't be matched 163 // to any of the connected Google Business Profile stores, as the matched 164 // Google Business Profile store is unverified. Go through the Google Business 165 // Profile verification process to match correctly. 166 optional string matching_state_hint = 11 [ 167 (google.api.field_behavior) = OPTIONAL, 168 (google.api.field_behavior) = OUTPUT_ONLY 169 ]; 170} 171 172// Request message for the `GetLfpStore` method. 173message GetLfpStoreRequest { 174 // Required. The name of the store to retrieve. 175 // Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` 176 string name = 1 [ 177 (google.api.field_behavior) = REQUIRED, 178 (google.api.resource_reference) = { 179 type: "merchantapi.googleapis.com/LfpStore" 180 } 181 ]; 182} 183 184// Request message for the InsertLfpStore method. 185message InsertLfpStoreRequest { 186 // Required. The LFP provider account 187 // Format: `accounts/{account}` 188 string parent = 1 [ 189 (google.api.field_behavior) = REQUIRED, 190 (google.api.resource_reference) = { 191 child_type: "merchantapi.googleapis.com/LfpStore" 192 } 193 ]; 194 195 // Required. The store to insert. 196 LfpStore lfp_store = 2 [(google.api.field_behavior) = REQUIRED]; 197} 198 199// Request message for the DeleteLfpStore method. 200message DeleteLfpStoreRequest { 201 // Required. The name of the store to delete for the target merchant account. 202 // Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}` 203 string name = 1 [ 204 (google.api.field_behavior) = REQUIRED, 205 (google.api.resource_reference) = { 206 type: "merchantapi.googleapis.com/LfpStore" 207 } 208 ]; 209} 210 211// Request message for the ListLfpStores method. 212message ListLfpStoresRequest { 213 // Required. The LFP partner. 214 // Format: `accounts/{account}` 215 string parent = 1 [ 216 (google.api.field_behavior) = REQUIRED, 217 (google.api.resource_reference) = { 218 child_type: "merchantapi.googleapis.com/LfpStore" 219 } 220 ]; 221 222 // Required. The Merchant Center id of the merchant to list stores for. 223 int64 target_account = 2 [(google.api.field_behavior) = REQUIRED]; 224 225 // Optional. The maximum number of `LfpStore` resources for the given account 226 // to return. The service returns fewer than this value if the number of 227 // stores for the given account is less than the `pageSize`. The default value 228 // is 250. The maximum value is 1000; If a value higher than the maximum is 229 // specified, then the `pageSize` will default to the maximum. 230 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 231 232 // Optional. A page token, received from a previous `ListLfpStoresRequest` 233 // call. Provide the page token to retrieve the subsequent page. When 234 // paginating, all other parameters provided to `ListLfpStoresRequest` must 235 // match the call that provided the page token. The token returned as 236 // [nextPageToken][google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token] 237 // in the response to the previous request. 238 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 239} 240 241// Response message for the ListLfpStores method. 242message ListLfpStoresResponse { 243 // The stores from the specified merchant. 244 repeated LfpStore lfp_stores = 1; 245 246 // A token, which can be sent as `pageToken` to retrieve the next page. 247 // If this field is omitted, there are no subsequent pages. 248 string next_page_token = 2; 249} 250