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/field_info.proto"; 23import "google/api/resource.proto"; 24import "google/protobuf/timestamp.proto"; 25import "google/shopping/type/types.proto"; 26 27option go_package = "cloud.google.com/go/shopping/merchant/lfp/apiv1beta/lfppb;lfppb"; 28option java_multiple_files = true; 29option java_outer_classname = "LfpSaleProto"; 30option java_package = "com.google.shopping.merchant.lfp.v1beta"; 31 32// Service for a [LFP 33// partner](https://support.google.com/merchants/answer/7676652) to submit sales 34// data for a merchant. 35service LfpSaleService { 36 option (google.api.default_host) = "merchantapi.googleapis.com"; 37 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; 38 39 // Inserts a `LfpSale` for the given merchant. 40 rpc InsertLfpSale(InsertLfpSaleRequest) returns (LfpSale) { 41 option (google.api.http) = { 42 post: "/lfp/v1beta/{parent=accounts/*}/lfpSales:insert" 43 body: "lfp_sale" 44 }; 45 } 46} 47 48// A sale for the merchant. 49message LfpSale { 50 option (google.api.resource) = { 51 type: "merchantapi.googleapis.com/LfpSale" 52 pattern: "accounts/{account}/lfpSales/{sale}" 53 plural: "lfpSales" 54 singular: "lfpSale" 55 }; 56 57 // Output only. Identifier. The name of the `LfpSale` resource. 58 // Format: 59 // `accounts/{account}/lfpSales/{sale}` 60 string name = 1 [ 61 (google.api.field_behavior) = OUTPUT_ONLY, 62 (google.api.field_behavior) = IDENTIFIER 63 ]; 64 65 // Required. The Merchant Center ID of the merchant to submit the sale for. 66 int64 target_account = 2 [(google.api.field_behavior) = REQUIRED]; 67 68 // Required. The identifier of the merchant's store. Either a `storeCode` 69 // inserted through the API or the code of the store in the Business Profile. 70 string store_code = 3 [(google.api.field_behavior) = REQUIRED]; 71 72 // Required. A unique identifier for the product. If both inventories and 73 // sales are submitted for a merchant, this id should match for the same 74 // product. 75 // 76 // **Note**: if the merchant sells the same product new and used, they should 77 // have different IDs. 78 string offer_id = 4 [(google.api.field_behavior) = REQUIRED]; 79 80 // Required. The [CLDR territory 81 // code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) 82 // for the country where the product is sold. 83 string region_code = 5 [(google.api.field_behavior) = REQUIRED]; 84 85 // Required. The two-letter ISO 639-1 language code for the item. 86 string content_language = 6 [(google.api.field_behavior) = REQUIRED]; 87 88 // Required. The Global Trade Item Number of the sold product. 89 string gtin = 7 [(google.api.field_behavior) = REQUIRED]; 90 91 // Required. The unit price of the product. 92 google.shopping.type.Price price = 8 [(google.api.field_behavior) = REQUIRED]; 93 94 // Required. The relative change of the available quantity. Negative for items 95 // returned. 96 int64 quantity = 9 [(google.api.field_behavior) = REQUIRED]; 97 98 // Required. The timestamp for the sale. 99 google.protobuf.Timestamp sale_time = 10 100 [(google.api.field_behavior) = REQUIRED]; 101 102 // Output only. System generated globally unique ID for the `LfpSale`. 103 optional string uid = 11 [ 104 (google.api.field_info).format = UUID4, 105 (google.api.field_behavior) = OUTPUT_ONLY 106 ]; 107 108 // Optional. The [feed 109 // label](https://developers.google.com/shopping-content/guides/products/feed-labels) 110 // for the product. If this is not set, it will default to `regionCode`. 111 optional string feed_label = 12 [(google.api.field_behavior) = OPTIONAL]; 112} 113 114// Request message for the InsertLfpSale method. 115message InsertLfpSaleRequest { 116 // Required. The LFP provider account. 117 // Format: `accounts/{lfp_partner}` 118 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 119 120 // Required. The sale to insert. 121 LfpSale lfp_sale = 2 [(google.api.field_behavior) = REQUIRED]; 122} 123