|
| 1 | +// Copyright 2025 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 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.shopping.merchant.accounts.v1beta; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/api/client.proto"; |
| 21 | +import "google/api/field_behavior.proto"; |
| 22 | +import "google/api/resource.proto"; |
| 23 | +import "google/protobuf/empty.proto"; |
| 24 | +import "google/protobuf/field_mask.proto"; |
| 25 | +import "google/shopping/type/types.proto"; |
| 26 | + |
| 27 | +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; |
| 28 | +option java_multiple_files = true; |
| 29 | +option java_outer_classname = "CheckoutsettingsProto"; |
| 30 | +option java_package = "com.google.shopping.merchant.accounts.v1beta"; |
| 31 | + |
| 32 | +// Service for supporting [checkout |
| 33 | +// settings](https://support.google.com/merchants/answer/13945960). |
| 34 | +service CheckoutSettingsService { |
| 35 | + option (google.api.default_host) = "merchantapi.googleapis.com"; |
| 36 | + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; |
| 37 | + |
| 38 | + // Gets `CheckoutSettings` for the given merchant. This includes |
| 39 | + // information about review state, enrollment state and URL settings. |
| 40 | + rpc GetCheckoutSettings(GetCheckoutSettingsRequest) |
| 41 | + returns (CheckoutSettings) { |
| 42 | + option (google.api.http) = { |
| 43 | + get: "/accounts/v1beta/{name=accounts/*/programs/*/checkoutSettings}" |
| 44 | + }; |
| 45 | + option (google.api.method_signature) = "name"; |
| 46 | + } |
| 47 | + |
| 48 | + // Creates `CheckoutSettings` for the given merchant. |
| 49 | + rpc CreateCheckoutSettings(CreateCheckoutSettingsRequest) |
| 50 | + returns (CheckoutSettings) { |
| 51 | + option (google.api.http) = { |
| 52 | + post: "/accounts/v1beta/{parent=accounts/*/programs/*}/checkoutSettings" |
| 53 | + body: "checkout_settings" |
| 54 | + }; |
| 55 | + option (google.api.method_signature) = "parent,checkout_settings"; |
| 56 | + } |
| 57 | + |
| 58 | + // Updates `CheckoutSettings` for the given merchant. |
| 59 | + rpc UpdateCheckoutSettings(UpdateCheckoutSettingsRequest) |
| 60 | + returns (CheckoutSettings) { |
| 61 | + option (google.api.http) = { |
| 62 | + patch: "/accounts/v1beta/{checkout_settings.name=accounts/*/programs/*/checkoutSettings}" |
| 63 | + body: "checkout_settings" |
| 64 | + }; |
| 65 | + option (google.api.method_signature) = "checkout_settings,update_mask"; |
| 66 | + } |
| 67 | + |
| 68 | + // Deletes `CheckoutSettings` and unenrolls merchant from |
| 69 | + // `Checkout` program. |
| 70 | + rpc DeleteCheckoutSettings(DeleteCheckoutSettingsRequest) |
| 71 | + returns (google.protobuf.Empty) { |
| 72 | + option (google.api.http) = { |
| 73 | + delete: "/accounts/v1beta/{name=accounts/*/programs/*/checkoutSettings}" |
| 74 | + }; |
| 75 | + option (google.api.method_signature) = "name"; |
| 76 | + } |
| 77 | +} |
| 78 | + |
| 79 | +// Request message for `GetCheckoutSettings` method. |
| 80 | +message GetCheckoutSettingsRequest { |
| 81 | + // Required. The name/identifier of the merchant account. |
| 82 | + // Format: `accounts/{account}/programs/{program}/checkoutSettings` |
| 83 | + string name = 1 [ |
| 84 | + (google.api.field_behavior) = REQUIRED, |
| 85 | + (google.api.resource_reference) = { |
| 86 | + type: "merchantapi.googleapis.com/CheckoutSettings" |
| 87 | + } |
| 88 | + ]; |
| 89 | +} |
| 90 | + |
| 91 | +// Request message for the `CreateCheckoutSettings` method. |
| 92 | +message CreateCheckoutSettingsRequest { |
| 93 | + // Required. The merchant account for which the `CheckoutSettings` will be |
| 94 | + // created. |
| 95 | + string parent = 1 [ |
| 96 | + (google.api.field_behavior) = REQUIRED, |
| 97 | + (google.api.resource_reference) = { |
| 98 | + child_type: "merchantapi.googleapis.com/CheckoutSettings" |
| 99 | + } |
| 100 | + ]; |
| 101 | + |
| 102 | + // Required. The `CheckoutSettings` object to create. |
| 103 | + CheckoutSettings checkout_settings = 2 |
| 104 | + [(google.api.field_behavior) = REQUIRED]; |
| 105 | +} |
| 106 | + |
| 107 | +// Request message for the `UpdateCheckoutSettings` method. |
| 108 | +message UpdateCheckoutSettingsRequest { |
| 109 | + // Required. The updated version of the `CheckoutSettings`. |
| 110 | + // The `name` field is used to identify the `CheckoutSettings`. |
| 111 | + // Format: `accounts/{account}/programs/{program}/checkoutSettings` |
| 112 | + CheckoutSettings checkout_settings = 1 |
| 113 | + [(google.api.field_behavior) = REQUIRED]; |
| 114 | + |
| 115 | + // Required. List of fields being updated. |
| 116 | + // The following fields are supported (in both `snake_case` and |
| 117 | + // `lowerCamelCase`): |
| 118 | + // |
| 119 | + // - `eligible_destinations` |
| 120 | + // - `uri_settings` |
| 121 | + google.protobuf.FieldMask update_mask = 2 |
| 122 | + [(google.api.field_behavior) = REQUIRED]; |
| 123 | +} |
| 124 | + |
| 125 | +// Request message for the `DeleteCheckoutSettings` method. |
| 126 | +message DeleteCheckoutSettingsRequest { |
| 127 | + // Required. The name/identifier of the merchant account. |
| 128 | + // Format: `accounts/{account}/programs/{program}/checkoutSettings` |
| 129 | + string name = 1 [ |
| 130 | + (google.api.field_behavior) = REQUIRED, |
| 131 | + (google.api.resource_reference) = { |
| 132 | + type: "merchantapi.googleapis.com/CheckoutSettings" |
| 133 | + } |
| 134 | + ]; |
| 135 | +} |
| 136 | + |
| 137 | +// [CheckoutSettings](https://support.google.com/merchants/answer/13945960) for |
| 138 | +// a specific merchant. |
| 139 | +message CheckoutSettings { |
| 140 | + option (google.api.resource) = { |
| 141 | + type: "merchantapi.googleapis.com/CheckoutSettings" |
| 142 | + pattern: "accounts/{account}/programs/{program}/checkoutSettings" |
| 143 | + plural: "settings" |
| 144 | + singular: "checkoutSettings" |
| 145 | + }; |
| 146 | + |
| 147 | + // Enum indicating the enrollment state of merchant in `Checkout` |
| 148 | + // program. |
| 149 | + enum CheckoutEnrollmentState { |
| 150 | + // Default enrollment state when enrollment state is not specified. |
| 151 | + CHECKOUT_ENROLLMENT_STATE_UNSPECIFIED = 0; |
| 152 | + |
| 153 | + // Merchant has not enrolled into the program. |
| 154 | + INACTIVE = 1; |
| 155 | + |
| 156 | + // Merchant has enrolled into the program by providing either an |
| 157 | + // account level URL or checkout URLs as part of their feed. |
| 158 | + ENROLLED = 2; |
| 159 | + |
| 160 | + // Merchant has previously enrolled but opted out of the program. |
| 161 | + OPTED_OUT = 3; |
| 162 | + } |
| 163 | + |
| 164 | + // Enum indicating the review state of merchant in `Checkout` |
| 165 | + // program. |
| 166 | + enum CheckoutReviewState { |
| 167 | + // Default review state when review state is not specified. |
| 168 | + CHECKOUT_REVIEW_STATE_UNSPECIFIED = 0; |
| 169 | + |
| 170 | + // Merchant provided URLs are being reviewed for data quality issues. |
| 171 | + IN_REVIEW = 1; |
| 172 | + |
| 173 | + // Merchant account has been approved. Indicates the data quality checks |
| 174 | + // have passed. |
| 175 | + APPROVED = 2; |
| 176 | + |
| 177 | + // Merchant account has been disapproved due to data quality issues. |
| 178 | + DISAPPROVED = 3; |
| 179 | + } |
| 180 | + |
| 181 | + // Identifier. The resource name of the program configuration settings. |
| 182 | + // Format: `accounts/{account}/programs/{program}/checkoutSettings` |
| 183 | + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; |
| 184 | + |
| 185 | + // URI settings for cart or checkout URL. |
| 186 | + optional UriSettings uri_settings = 2; |
| 187 | + |
| 188 | + // Optional. The destinations to which the checkout program applies, valid |
| 189 | + // destination values are `SHOPPING_ADS`, `FREE_LISTINGS` |
| 190 | + repeated google.shopping.type.Destination.DestinationEnum |
| 191 | + eligible_destinations = 8 [(google.api.field_behavior) = OPTIONAL]; |
| 192 | + |
| 193 | + // Output only. Reflects the merchant enrollment state in `Checkout` program. |
| 194 | + optional CheckoutEnrollmentState enrollment_state = 3 |
| 195 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 196 | + |
| 197 | + // Output only. Reflects the merchant review state in `Checkout` program. |
| 198 | + // This is set based on the data quality reviews of the URL provided by |
| 199 | + // the merchant. |
| 200 | + // A merchant with enrollment state |
| 201 | + // as `ENROLLED` can be in the following review states: `IN_REVIEW`, |
| 202 | + // `APPROVED` or `DISAPPROVED`. A merchant must be in an `enrollment_state` of |
| 203 | + // `ENROLLED` before a review can begin for the merchant.For more details, |
| 204 | + // check the help center doc. |
| 205 | + optional CheckoutReviewState review_state = 4 |
| 206 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 207 | + |
| 208 | + // Output only. The effective value of `uri_settings` for a given merchant. If |
| 209 | + // account level settings are present then this value will be a copy of url |
| 210 | + // settings. Otherwise, it will have the value of the parent account (for only |
| 211 | + // marketplace sellers). |
| 212 | + UriSettings effective_uri_settings = 5 |
| 213 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 214 | + |
| 215 | + // Output only. The effective value of enrollment_state for a given merchant |
| 216 | + // ID. If account level settings are present then this value will be a copy of |
| 217 | + // the account level settings. Otherwise, it will have the value of the parent |
| 218 | + // account (for only marketplace sellers). |
| 219 | + optional CheckoutEnrollmentState effective_enrollment_state = 6 |
| 220 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 221 | + |
| 222 | + // Output only. The effective value of `review_state` for a given merchant ID. |
| 223 | + // If account level settings are present then this value will be a copy of the |
| 224 | + // account level settings. Otherwise, it will have the value of the parent |
| 225 | + // account (for only marketplace sellers). |
| 226 | + optional CheckoutReviewState effective_review_state = 7 |
| 227 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 228 | +} |
| 229 | + |
| 230 | +// URL settings for cart or checkout URL. |
| 231 | +message UriSettings { |
| 232 | + // Specifications related to the `Checkout` URL. The `UriTemplate` is |
| 233 | + // of the form `https://www.mystore.com/checkout?item_id={id}` |
| 234 | + // where `{id}` will be automatically replaced with [offer_id] |
| 235 | + // (https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.offer_id) |
| 236 | + // attribute from the merchant account |
| 237 | + oneof uri_template { |
| 238 | + // Checkout URL template. When the placeholders are expanded will redirect |
| 239 | + // the buyer to the merchant checkout page with the item in the cart. For |
| 240 | + // more details, check the [help center |
| 241 | + // doc](https://support.google.com/merchants/answer/13945960#method1&zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting) |
| 242 | + string checkout_uri_template = 1; |
| 243 | + |
| 244 | + // Cart URL template. When the placeholders are expanded will redirect the |
| 245 | + // buyer to the cart page on the merchant website with the selected |
| 246 | + // item in cart. For more details, check the [help center |
| 247 | + // doc](https://support.google.com/merchants/answer/13945960#method1&zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting) |
| 248 | + string cart_uri_template = 2; |
| 249 | + } |
| 250 | +} |
0 commit comments