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.cloud.paymentgateway.issuerswitch.accountmanager.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/paymentgateway/issuerswitch/v1/common_fields.proto"; 24import "google/longrunning/operations.proto"; 25import "google/protobuf/timestamp.proto"; 26import "google/type/money.proto"; 27 28option csharp_namespace = "Google.Cloud.PaymentGateway.IssuerSwitch.AccountManager.V1"; 29option go_package = "cloud.google.com/go/paymentgateway/issuerswitch/accountmanager/apiv1/accountmanagerpb;accountmanagerpb"; 30option java_multiple_files = true; 31option java_outer_classname = "AccountManagerTransactionsProto"; 32option java_package = "com.google.cloud.paymentgateway.issuerswitch.accountmanager.v1"; 33option php_namespace = "Google\\Cloud\\PaymentGateway\\IssuerSwitch\\AccountManager\\V1"; 34option ruby_package = "Google::Cloud::PaymentGateway::IssuerSwitch::AccountManager::V1"; 35 36// Lists and exports transactions processed by the account manager. 37service AccountManagerTransactions { 38 option (google.api.default_host) = "issuerswitch.googleapis.com"; 39 option (google.api.oauth_scopes) = 40 "https://www.googleapis.com/auth/cloud-platform"; 41 42 // Export transactions received within the specified time range as a 43 // file into a configured target location. The returned `Operation` type has 44 // the following method-specific fields: 45 // 46 // - `metadata`: 47 // [ExportAccountManagerTransactionsMetadata][google.cloud.paymentgateway.issuerswitch.accountmanager.v1.ExportAccountManagerTransactionsMetadata] 48 // - `response`: 49 // [ExportAccountManagerTransactionsResponse][google.cloud.paymentgateway.issuerswitch.accountmanager.v1.ExportAccountManagerTransactionsResponse] 50 // 51 // The exported file will be in the standard CSV format where each row in the 52 // file represents a transaction. The file has the following fields in order: 53 // 54 // 1. `TransactionID` 55 // * **Min Length** - 35 characters 56 // * **Max Length** - 35 characters 57 // * **Description** - Account manager transaction ID. 58 // 1. `TransactionType` 59 // * **Min Length** - 22 characters 60 // * **Max Length** - 25 characters 61 // * **Description** - Type of the transaction. This will be one of 62 // `TRANSACTION_TYPE_CREDIT`, `TRANSACTION_TYPE_CREDIT_REVERSAL`, 63 // `TRANSACTION_TYPE_DEBIT` or `TRANSACTION_TYPE_DEBIT_REVERSAL`. When 64 // account manager is used for managing UPI Lite transactions, the CREDIT 65 // transactions would be for Lite account top-ups and DEBIT transactions 66 // could be either for a Lite account disablement where balance is 67 // transferred back the underlying bank account or for a Lite account 68 // financial transaction which happened offline. 69 // 1. `AccountID` 70 // * **Min Length** - 35 characters 71 // * **Max Length** - 35 characters 72 // * **Description** - Account ID. When account manager is used for 73 // managing UPI Lite transactions, this column will contain the Lite 74 // Reference Number (LRN) of the UPI Lite account. 75 // 1. `State` 76 // * **Min Length** - 6 characters 77 // * **Max Length** - 12 characters 78 // * **Description** - State of the transaction. This will be one of 79 // `SUCCEEDED` or `FAILED`. 80 // 1. `RRN` 81 // * **Min Length** - 12 characters 82 // * **Max Length** - 12 characters 83 // * **Description** - Retrieval reference number associated with the 84 // transaction. 85 // 1. `PayerVPA` 86 // * **Min Length** - 3 characters 87 // * **Max Length** - 255 characters 88 // * **Description** - Virtual Payment Address (VPA) of the payer. 89 // 1. `PayerIFSC` 90 // * **Min Length** - 11 characters 91 // * **Max Length** - 11 characters 92 // * **Description** - IFSC of the payer's bank account. 93 // 1. `PayerAccountNumber` 94 // * **Min Length** - 1 characters 95 // * **Max Length** - 30 characters 96 // * **Description** - Payer's bank account number. 97 // 1. `PayeeVPA` 98 // * **Min Length** - 3 characters 99 // * **Max Length** - 255 characters 100 // * **Description** - Virtual Payment Address (VPA) of the payee. 101 // 1. `PayeeIFSC` 102 // * **Min Length** - 11 characters 103 // * **Max Length** - 11 characters 104 // * **Description** - IFSC of the payee's bank account. 105 // 1. `PayeeAccountNumber` 106 // * **Min Length** - 1 characters 107 // * **Max Length** - 30 characters 108 // * **Description** - Payee's bank account number. 109 // 1. `PayeeMCC` 110 // * **Min Length** - 4 characters 111 // * **Max Length** - 4 characters 112 // * **Description** - Payee's Merchant Category Code (MCC), only if the 113 // payee is a merchant. 114 // 1. `PayeeMerchantID` 115 // * **Min Length** - 4 characters 116 // * **Max Length** - 4 characters 117 // * **Description** - Payee's merchant ID, only if the payee is a 118 // merchant. 119 // 1. `Currency` 120 // * **Min Length** - 3 characters 121 // * **Max Length** - 3 characters 122 // * **Description** - Currency of the amount involved in the transaction. 123 // The currency codes are defined in ISO 4217. 124 // 1. `Amount` 125 // * **Description** - Amount involved in the transaction. 126 // 1. `Purpose` 127 // * **Min Length** - 1 characters 128 // * **Max Length** - 4 characters 129 // * **Description** - Purpose code associated with the transaction. When 130 // account manager is used for managing UPI Lite transactions, this column 131 // will contain one of the values from `41` (Lite account creation with 132 // initial topup), `42` (Lite account topup), `43` (Lite account 133 // disablement with balance transfer) or `44` (Lite account online 134 // transaction). 135 // 1. `TransactionTime` 136 // * **Min Length** - 20 characters 137 // * **Max Length** - 20 characters 138 // * **Description** - Timestamp (in UTC) indicating the timestamp at 139 // which the transaction took place. The format will be as per RFC-3339. 140 // Example : 2022-11-22T23:00:05Z 141 rpc ExportAccountManagerTransactions(ExportAccountManagerTransactionsRequest) 142 returns (google.longrunning.Operation) { 143 option (google.api.http) = { 144 post: "/v1/{parent=projects/*/accountManagers/*}/transactions:export" 145 body: "*" 146 }; 147 option (google.longrunning.operation_info) = { 148 response_type: "ExportAccountManagerTransactionsResponse" 149 metadata_type: "ExportAccountManagerTransactionsMetadata" 150 }; 151 } 152 153 // List account manager transactions that satisfy specified filter criteria. 154 rpc ListAccountManagerTransactions(ListAccountManagerTransactionsRequest) 155 returns (ListAccountManagerTransactionsResponse) { 156 option (google.api.http) = { 157 get: "/v1/{parent=projects/*/accountManagers/*}/transactions" 158 }; 159 option (google.api.method_signature) = "parent"; 160 } 161 162 // Batch reconcile account manager transactions and return status for each 163 // transaction. 164 rpc BatchReconcileAccountManagerTransactions( 165 BatchReconcileAccountManagerTransactionsRequest) 166 returns (BatchReconcileAccountManagerTransactionsResponse) { 167 option (google.api.http) = { 168 post: "/v1/{parent=projects/*/accountManagers/*}/transactions:batchReconcile" 169 body: "*" 170 }; 171 option (google.api.method_signature) = "parent,requests"; 172 } 173} 174 175// A transaction processed by the account manager. 176message AccountManagerTransaction { 177 option (google.api.resource) = { 178 type: "issuerswitch.googleapis.com/AccountManagerTransaction" 179 pattern: "projects/{project}/accountManagers/{account_manager}/transactions/{transaction}" 180 plural: "accountManagerTransactions" 181 singular: "accountManagerTransaction" 182 }; 183 184 // The name of the transaction. This uniquely identifies the 185 // transaction. Format of name is 186 // projects/{project}/accountManagers/{account_manager}/transactions/{transaction}. 187 string name = 1; 188 189 // The account ID for which the transaction was processed. 190 string account_id = 2; 191 192 // Information about the transaction. 193 AccountManagerTransactionInfo info = 3; 194 195 // The payer in the transaction. 196 AccountManagerSettlementParticipant payer = 4; 197 198 // The payee in the transaction. 199 AccountManagerSettlementParticipant payee = 5; 200 201 // Reconciliation information for the transaction. 202 AccountManagerTransactionReconciliationInfo reconciliation_info = 6; 203 204 // The amount for payment settlement in the transaction. 205 google.type.Money amount = 7; 206} 207 208// Information about a transaction processed by the account manager. 209message AccountManagerTransactionInfo { 210 // Specifies the current state of the transaction. 211 enum State { 212 // Unspecified state. 213 STATE_UNSPECIFIED = 0; 214 215 // The transaction has successfully completed. 216 SUCCEEDED = 1; 217 218 // The transaction has failed. 219 FAILED = 2; 220 } 221 222 // Common metadata about a transaction. 223 message AccountManagerTransactionMetadata { 224 // The time at which the transaction took place. 225 google.protobuf.Timestamp transaction_time = 1; 226 227 // Output only. The time at which the transaction resource was created by 228 // the account manager. 229 google.protobuf.Timestamp create_time = 2 230 [(google.api.field_behavior) = OUTPUT_ONLY]; 231 232 // Output only. The time at which the transaction resource was last updated 233 // by the account manager. 234 google.protobuf.Timestamp update_time = 3 235 [(google.api.field_behavior) = OUTPUT_ONLY]; 236 237 // Retrieval reference number (RRN) for the transaction. 238 string retrieval_reference_number = 4; 239 240 // The initiation mode of this transaction. 241 string initiation_mode = 5; 242 243 // The purpose code of this transaction. 244 string purpose_code = 6; 245 } 246 247 // All details about any error in the processing of a transaction. 248 message AccountManagerTransactionErrorDetails { 249 // Output only. Error code of the failed transaction. 250 string error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 251 252 // Output only. Error description for the failed transaction. 253 string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 254 } 255 256 // An identifier that is mandatorily present in every transaction processed 257 // via account manager. 258 string id = 1; 259 260 // The transaction type. 261 AccountManagerTransactionType transaction_type = 3; 262 263 // Output only. The transaction's state. 264 State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 265 266 // Metadata about the transaction. 267 AccountManagerTransactionMetadata metadata = 6; 268 269 // Output only. Any error details for the current transaction, if the state is 270 // `FAILED`. 271 AccountManagerTransactionErrorDetails error_details = 7 272 [(google.api.field_behavior) = OUTPUT_ONLY]; 273} 274 275// A participant in a payment settlement transaction processed by the 276// account manager. The participant could either be the payer or the payee 277// in the transaction. 278message AccountManagerSettlementParticipant { 279 // The participant information. 280 AccountManagerParticipant participant = 1; 281 282 // Information about a merchant who is a participant in the payment. This 283 // field will be specified only if the participant is a merchant. 284 AccountManagerMerchantInfo merchant_info = 2; 285} 286 287// A participant in a transaction processed by the account manager. 288message AccountManagerParticipant { 289 // The type of the participant. 290 enum Persona { 291 // Unspecified persona. 292 PERSONA_UNSPECIFIED = 0; 293 294 // Participant is an entity. 295 ENTITY = 1; 296 297 // Participant is a person. 298 PERSON = 2; 299 } 300 301 // The payment address of the participant. In the UPI system, this will be the 302 // virtual payment address (VPA) of the participant. 303 string payment_address = 1; 304 305 // The persona of the participant. 306 Persona persona = 2; 307 308 // Unique identification of an account. 309 google.cloud.paymentgateway.issuerswitch.v1.AccountReference account = 3; 310} 311 312// A merchant in a transaction processed by the account manager. 313message AccountManagerMerchantInfo { 314 // Merchant Category Code (MCC) as specified by UPI. This is a four-digit 315 // number listed in ISO 18245 for retail financial services. 316 string category_code = 1; 317 318 // ID of the merchant. 319 string id = 2; 320} 321 322// Reconciliation information for a transaction processed by account manager. 323message AccountManagerTransactionReconciliationInfo { 324 // State of transaction reconciliation. 325 enum ReconciliationState { 326 // Unspecified state. 327 RECONCILIATION_STATE_UNSPECIFIED = 0; 328 329 // Reconciliation was successful. 330 SUCCEEDED = 1; 331 332 // Reconciliation failed. 333 FAILED = 2; 334 } 335 336 // Output only. State of reconciliation. 337 ReconciliationState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 338 339 // Time at which reconciliation was performed for the transaction. 340 google.protobuf.Timestamp reconciliation_time = 2; 341} 342 343// Request for the `ExportAccountManagerTransactions` method. 344message ExportAccountManagerTransactionsRequest { 345 // Required. The parent resource for the transactions. The format is 346 // `projects/{project}/accountManagers/{account_manager}`. 347 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 348 349 // Optional. Transaction type of an account manager transaction. The possible 350 // values for transaction type are 351 // 352 // * CREDIT 353 // * CREDIT_REVERSAL 354 // * DEBIT 355 // * DEBIT_REVERSAL 356 // 357 // If no transaction type is specified, records of all the above transaction 358 // types will be exported. 359 AccountManagerTransactionType transaction_type = 3 360 [(google.api.field_behavior) = OPTIONAL]; 361 362 // Optional. The start time for the query. 363 google.protobuf.Timestamp start_time = 4 364 [(google.api.field_behavior) = OPTIONAL]; 365 366 // Optional. The end time for the query. 367 google.protobuf.Timestamp end_time = 5 368 [(google.api.field_behavior) = OPTIONAL]; 369} 370 371// Request for the `ListAccountManagerTransactions` method. Callers can request 372// for transactions to be filtered by the given filter criteria and specified 373// pagination parameters. 374message ListAccountManagerTransactionsRequest { 375 // Required. The parent resource. The format is 376 // `projects/{project}/accountManagers/{account_manager}`. 377 string parent = 1 [ 378 (google.api.field_behavior) = REQUIRED, 379 (google.api.resource_reference) = { 380 child_type: "issuerswitch.googleapis.com/AccountManagerTransaction" 381 } 382 ]; 383 384 // Optional. The maximum number of transactions to return. The service may 385 // return fewer than this value. If unspecified or if the specified value is 386 // less than 1, at most 50 transactions will be returned. The maximum value is 387 // 1000; values above 1000 will be coerced to 1000. While paginating, you can 388 // specify a new page size parameter for each page of transactions to be 389 // listed. 390 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 391 392 // Optional. A page token, received from a previous 393 // `ListAccountManagerTransactions` call. Specify this parameter to retrieve 394 // the next page of transactions. 395 // 396 // When paginating, you must specify only the `page_token` parameter. The 397 // filter that was specified in the initial call to the 398 // `ListAccountManagerTransactions` method that returned the page token will 399 // be reused for all further calls where the page token parameter is 400 // specified. 401 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 402 403 // Optional. An expression that filters the list of transactions. 404 // 405 // A filter expression consists of a field name, a comparison operator, and 406 // a value for filtering. The value must be a string, a number, or a 407 // boolean. The comparison operator must be one of: `<`, `>`, or `=`. 408 // Filters are not case sensitive. 409 // 410 // The following fields in the `Transaction` are eligible for filtering: 411 // 412 // * `accountID` - The account ID. Allowed comparison operators: `=`. When 413 // account manager is used for managing UPI Lite transactions, accountID 414 // should be the Lite Reference Number (LRN). 415 // * `accountNumber` - Bank account number associated with the 416 // account. Allowed comparison operators: `=`. 417 // * `IFSC` - Bank IFSC code associated with the account. 418 // Allowed comparison operators: `=`. 419 // * `RRN` - The retrieval reference number of the transaction. Allowed 420 // comparison operators: `=`. 421 // * `transactionTime` - The timestamp (in UTC) at which the transaction 422 // took place. The value should be in the format `YYYY-MM-DDTHH:MM:SSZ`. 423 // Allowed comparison operators: `>`, `<`. 424 // 425 // You can combine multiple expressions by enclosing each expression in 426 // parentheses. Expressions are combined with AND logic. No other logical 427 // operators are supported. 428 // 429 // Here are a few examples: 430 // 431 // * `rrn = 123456789123` - The RRN is _123456789123_. 432 // * `(accountID = 12345678) AND (transactionTime < "2021-08-15T14:50:00Z")` 433 // - The accountID is 12345678 and the transaction was received 434 // before _2021-08-15 14:50:00 UTC_. 435 // * `transactionTime > "2021-08-15T14:50:00Z" AND transactionTime < 436 // "2021-08-16T14:50:00Z"` - The transaction was received between 437 // _2021-08-15 14:50:00 UTC_ and _2021-08-16 14:50:00 UTC_. 438 string filter = 5 [(google.api.field_behavior) = OPTIONAL]; 439} 440 441// Response for the `ListAccountManagerTransactions` method. 442message ListAccountManagerTransactionsResponse { 443 // List of account manager transactions satisfying the filtered request. 444 repeated AccountManagerTransaction account_manager_transactions = 1; 445 446 // Pass this token in the ListAccountManagerTransactionsRequest to continue to 447 // list results. If all results have been returned, this field is an empty 448 // string or not present in the response. 449 string next_page_token = 2; 450} 451 452// Reconciliation request for an account manager transaction. 453message ReconcileAccountManagerTransactionsRequest { 454 // Required. The transaction that will be reconciled. 455 AccountManagerTransaction transaction = 1 456 [(google.api.field_behavior) = REQUIRED]; 457} 458 459// Request for the `BatchReconcileAccountManagerTransactions` method. 460message BatchReconcileAccountManagerTransactionsRequest { 461 // Required. The parent resource. The format is 462 // `projects/{project}/accountManagers/{account_manager}`. 463 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 464 465 // Required. The request message specifying the transaction to reconcile. 466 // A maximum of 200 transactions can be reconciled in a batch. 467 repeated ReconcileAccountManagerTransactionsRequest requests = 2 468 [(google.api.field_behavior) = REQUIRED]; 469} 470 471// Response for the `BatchReconcileAccountManagerTransactions` method. 472message BatchReconcileAccountManagerTransactionsResponse { 473 // List of transactions reconciled. 474 repeated AccountManagerTransaction account_manager_transactions = 1; 475} 476 477// The type of a account manager transaction. Every transaction processed by the 478// account manager will be one of these transaction types. 479enum AccountManagerTransactionType { 480 // Unspecified transaction type. 481 ACCOUNT_MANAGER_TRANSACTION_TYPE_UNSPECIFIED = 0; 482 483 // Credit transaction type. 484 CREDIT = 1; 485 486 // Credit reversal transaction type. 487 CREDIT_REVERSAL = 2; 488 489 // Debit transaction type. 490 DEBIT = 3; 491 492 // Debit reversal transaction type. 493 DEBIT_REVERSAL = 4; 494} 495