providerapi

io.token.proto.providerapi /external/src/main/proto/providerapi/providerapi.proto


syntax = "proto3";
package io.token.proto.providerapi;

import "account.proto";
import "bankstatus.proto";
import "token.proto";
import "transferinstructions.proto";
import "providerspecific.proto";
import "money.proto";
import "extensions/field.proto";

message Account {
  string id = 1 [(io.token.proto.extensions.field.redact) = true];
  string name = 2 [(io.token.proto.extensions.field.redact) = true];
  string number = 3 [(io.token.proto.extensions.field.redact) = true];
  string state = 4;
  io.token.proto.common.account.AccountFeatures account_features = 5;
}

message Transaction {
  string id = 1;
  string account_id = 2 [(io.token.proto.extensions.field.redact) = true];
  string amount = 3;
  string currency = 4; // ISO4217: 3 letter code such as "USD" or "EUR"
  Type type = 5;
  Status status = 6;
  string account_number = 7 [(io.token.proto.extensions.field.redact) = true]; // Optional account number of the transaction
  string description = 8 [(io.token.proto.extensions.field.redact) = true]; // Optional description of the transaction
  int64 created_at = 9; // Optional timestamp in milliseconds, use booking date if creation date is not available

  map<string, string> metadata = 10 [(io.token.proto.extensions.field.redact) = true]; // Optional additional fields.
  io.token.proto.common.providerspecific.ProviderTransactionDetails provider_transaction_details = 11;

  enum Status {
    INVALID = 0;
    SUCCESS = 1;
    INSUFFICIENT_FUNDS = 2;
    FAILURE = 3;
    PENDING = 4;
    SENT = 5;
    INITIATED = 6;
  }

  enum Type {
    INVALID_TYPE = 0;
    DEBIT = 1;
    CREDIT = 2;
  }
}

message StandingOrder {
  string id = 1;
  string account_id = 2 [(io.token.proto.extensions.field.redact) = true];
  string start_date = 3; // ISO 8601: YYYY-MM-DD or	YYYYMMDD
  string end_date = 4;   // Optional. ISO 8601: YYYY-MM-DD or	YYYYMMDD
  string frequency = 5;  // ISO 20022: DAIL, WEEK, TOWK, MNTH, TOMN, QUTR, SEMI, YEAR
  string amount = 6;     // Amount of each individual payment
  string currency = 7;   // ISO 4217, 3 letter currency code such as "USD" or "EUR".
  Status status = 8;
  string description = 9 [(io.token.proto.extensions.field.redact) = true]; // Optional description of the transaction
  int64 created_at = 10; // Optional timestamp in milliseconds, use booking date if creation date is not available

  map<string, string> metadata = 11 [(io.token.proto.extensions.field.redact) = true]; // Optional additional fields.
  io.token.proto.common.providerspecific.ProviderStandingOrderDetails provider_details = 12;

  enum Status {
    INVALID = 0;
    ACTIVE = 1;
    INACTIVE = 2;
    PROCESSING = 3;
    FAILED = 4;
    INITIATION_COMPLETE = 5; // Should only be used in GetStandingOrderStatusResponse when
                             // it is not possible to determine ACTIVE/INACTIVE.
    CANCELED = 6;
    INITIATED = 7 [deprecated = true]; // TODO(RD-2723) remove
  }
}

message Balance {
  string amount = 1;
  string available_amount = 2;
  string currency = 3; // ISO4217: 3 letter code such as "USD" or "EUR"
  int64 updated_at_ms = 4;
  repeated TypedBalance other_balances = 5; // optional

  message TypedBalance {
    string type = 1;
    string amount = 2;
    string currency = 3;
    int64 updated_at_ms = 4;
  }
}

message TransferPayload {
  string amount = 1;
  string currency = 2; // ISO4217: 3 letter code such as "USD" or "EUR"
  string reference_id = 3;
  string description = 4 [(io.token.proto.extensions.field.redact) = true]; // Optional description
  io.token.proto.common.transferinstructions.TransferInstructions.Metadata metadata = 5 [deprecated=true];
  repeated io.token.proto.common.transferinstructions.TransferEndpoint destinations = 6 [deprecated=true];
  repeated io.token.proto.common.transferinstructions.TransferDestination transfer_destinations = 7 [deprecated=true];
  string execution_date = 8; // Optional. ISO 8601: YYYY-MM-DD or YYYYMMDD.
  bool confirm_funds = 9;
  io.token.proto.common.transferinstructions.TransferInstructions transfer_instructions = 10;
}

message StandingOrderPayload {
  string start_date = 1; // ISO 8601: YYYY-MM-DD or	YYYYMMDD
  string end_date = 2;   // Optional. ISO 8601: YYYY-MM-DD or	YYYYMMDD
  string frequency = 3;  // ISO 20022: DAIL, WEEK, TOWK, MNTH, TOMN, QUTR, SEMI, YEAR
  string amount = 4;     // Amount of each individual payment
  string currency = 5;   // ISO 4217, 3 letter currency code such as "USD" or "EUR".
  string reference_id = 6;
  string description = 7 [(io.token.proto.extensions.field.redact) = true]; // Optional description
  repeated io.token.proto.common.transferinstructions.TransferDestination destinations = 8;
  io.token.proto.common.transferinstructions.TransferInstructions.Metadata metadata = 9;
}

message GetBalanceRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
}

message GetBalanceResponse {
  Balance balance = 1;
}

message GetTransactionsRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  int32 limit = 5;
  string offset = 6;
}

message GetTransactionsResponse {
  repeated Transaction transactions = 1;
  string offset = 2;
}

message GetTransactionRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  string transaction_id = 4;
}

message GetTransactionResponse {
  Transaction transaction = 1;
}

message GetStandingOrdersRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  int32 limit = 5;
  string offset = 6;
}

message GetStandingOrdersResponse {
  repeated StandingOrder standing_orders = 1;
  string offset = 2;
}

message GetStandingOrderRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  string standing_order_id = 4;
}

message GetStandingOrderResponse {
  StandingOrder standing_order = 1;
}

message GetAccountDetailsRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
}

message GetAccountDetailsResponse {
  io.token.proto.common.account.AccountDetails account_details = 1;
}

message ResolveDestinationRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
}

message ResolveDestinationResponse {
  repeated io.token.proto.common.account.BankAccount destinations = 1 [deprecated=true];
  repeated io.token.proto.common.transferinstructions.TransferEndpoint endpoints = 2 [deprecated = true];
  repeated io.token.proto.common.transferinstructions.TransferDestination transfer_destinations = 3;
}

message TransferRequest {
  string bank_id = 1;
  string account_id = 2; // Optional, empty for appless flow
  string payment_state = 3;
  TransferPayload payload = 4;
}

message TransferResponse {
  Transaction transaction = 1;
  string payment_id = 2;
}

message InitiatePaymentRequest {
  string bank_id = 1;
  string account_id = 2; // Optional, empty in appless flow
  string account_state = 3; // Optional, empty in appless flow
  string client_state = 4;
  string member_state = 5; // Optional
  TransferPayload payload = 6;
  string callback_uri = 7;
}

message InitiatePaymentResponse {
  string member_state = 1;
  string redirect_url = 2; // Optional; external authorization required if present
  string payment_id = 3;   // Optional; only required for OneStepPaymentService
}

message PaymentCallbackRequest {
  string bank_id = 1;
  map<string, string> parameters = 2 [(io.token.proto.extensions.field.redact) = true];
}

message PaymentCallbackResponse {
  string payment_state = 2;
  string client_state = 3;
  bool funds_available = 4;
}

message CancelPaymentRequest {
  string bank_id = 1;
  string payment_state = 2;
  string account_id = 3 [deprecated = true]; // Optional; empty in appless flow
}

message CancelPaymentResponse {
}

message GetPaymentStatusRequest {
  string bank_id = 1;
  string payment_id = 2;
  string payment_state = 3;
}

message GetPaymentStatusResponse {
  Transaction.Status status = 1;
}

message OneStepPaymentCallbackRequest {
  string bank_id = 1;
  map<string, string> parameters = 2 [(io.token.proto.extensions.field.redact) = true];
}

message OneStepPaymentCallbackResponse {
  string payment_id = 1;
  Transaction.Status payment_status = 2;
  string client_state = 3;
}

message GetOneStepPaymentStatusRequest {
  string bank_id = 1;
  string payment_id = 2;
}

message GetOneStepPaymentStatusResponse {
  Transaction.Status status = 1;
}

message CancelOneStepPaymentRequest {
  string bank_id = 1;
  string payment_id = 2;
}

message CancelOneStepPaymentResponse {
}

message InitiateStandingOrderRequest {
  string bank_id = 1;
  string account_id = 2; // Optional, empty in appless flow
  string account_state = 3; // Optional, empty in appless flow
  string client_state = 4;
  string member_state = 5; // Optional
  StandingOrderPayload payload = 6;
  string callback_uri = 7;
}

message InitiateStandingOrderResponse {
  string member_state = 1;
  string redirect_url = 2; // Optional; external authorization required if present
}

message StandingOrderCallbackRequest {
  string bank_id = 1;
  map<string, string> parameters = 2 [(io.token.proto.extensions.field.redact) = true];
}

message StandingOrderCallbackResponse {
  string payment_state = 1;
  string client_state = 2;
}

message SubmitStandingOrderRequest {
  string bank_id = 1;
  string account_id = 2; // Optional, empty for appless flow
  string payment_state = 3;
  StandingOrderPayload payload = 4;
}

message SubmitStandingOrderResponse {
  StandingOrder standing_order = 1;
  string submission_id = 2;  // Used to look up standing order status if no standing order ID is present
}

message GetStandingOrderStatusRequest {
  string bank_id = 1;
  string submission_id = 2;
  string payment_state = 3;
}

message GetStandingOrderStatusResponse {
  StandingOrder.Status status = 1;
}

message InitiateLinkingRequest {
  string bank_id = 1;
  string client_state = 2;
  string member_state = 3; // Optional
  string callback_uri = 4;
  oneof resource_list {
    io.token.proto.common.token.TokenRequestPayload.AccessBody.ResourceTypeList resource_type_list  = 6;
    io.token.proto.common.token.TokenRequestPayload.AccessBody.AccountResourceList account_resource_list = 7;
  }

  repeated ResourceType resources = 5 [deprecated = true];
  enum ResourceType {
    option deprecated = true;
    INVALID = 0;
    BALANCES = 1;
    TRANSACTIONS = 2;
    TRANSFER_DESTINATIONS = 3;
    FUNDS_CONFIRMATIONS = 4;
  }
}

message InitiateLinkingResponse {
  string member_state = 1;
  string redirect_url = 2;
}

message LinkingCallbackRequest {
  string bank_id = 1;
  map<string, string> parameters = 2 [(io.token.proto.extensions.field.redact) = true];
}

message LinkingCallbackResponse {
  repeated Account accounts = 1;
  string client_state = 2;
}

message UnlinkAccountRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  repeated string payment_states = 4; // outstanding payments associated with the account that should be cancelled
}

message UnlinkAccountResponse {
}

message DeleteMemberRequest {
  string bank_id = 1;
  string member_state = 2;
  repeated string payment_states = 3; // optional: only used in appless flow
}

message DeleteMemberResponse {
}

message GetBankStatusRequest {
  string bank_id = 1;
}

message GetBankStatusResponse {
  io.token.proto.common.bankstatus.BankStatus status = 1;
}

message ConfirmFundsRequest {
  string bank_id = 1;
  string account_id = 2;
  string account_state = 3;
  io.token.proto.common.money.Money money = 4;
}

message ConfirmFundsResponse {
  bool funds_available = 1;
}

service AccountService {
  rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse) {}

  rpc GetTransactions (GetTransactionsRequest) returns (GetTransactionsResponse) {}

  rpc GetTransaction (GetTransactionRequest) returns (GetTransactionResponse) {}

  rpc GetStandingOrders (GetStandingOrdersRequest) returns (GetStandingOrdersResponse) {}

  rpc GetStandingOrder (GetStandingOrderRequest) returns (GetStandingOrderResponse) {}

  rpc ResolveDestination (ResolveDestinationRequest) returns (ResolveDestinationResponse) {}

  rpc GetAccountDetails(GetAccountDetailsRequest) returns (GetAccountDetailsResponse) {}

  rpc ConfirmFunds (ConfirmFundsRequest) returns (ConfirmFundsResponse) {}
}

service TransferService {
  rpc Transfer (TransferRequest) returns (TransferResponse) {}

  rpc GetPaymentStatus (GetPaymentStatusRequest) returns (GetPaymentStatusResponse) {}

  rpc InitiatePayment (InitiatePaymentRequest) returns (InitiatePaymentResponse) {}

  rpc PaymentCallback (PaymentCallbackRequest) returns (PaymentCallbackResponse) {}

  rpc CancelPayment (CancelPaymentRequest) returns (CancelPaymentResponse) {}
}

service OneStepPaymentService {
  rpc InitiatePayment (InitiatePaymentRequest) returns (InitiatePaymentResponse) {}

  rpc PaymentCallback (OneStepPaymentCallbackRequest) returns (OneStepPaymentCallbackResponse) {}

  rpc GetPaymentStatus (GetOneStepPaymentStatusRequest) returns (GetOneStepPaymentStatusResponse) {}

  rpc CancelPayment (CancelOneStepPaymentRequest) returns (CancelOneStepPaymentResponse) {}
}

service StandingOrderService {
  rpc InitiateStandingOrder (InitiateStandingOrderRequest) returns (InitiateStandingOrderResponse) {}

  rpc StandingOrderCallback (StandingOrderCallbackRequest) returns (StandingOrderCallbackResponse) {}

  rpc SubmitStandingOrder (SubmitStandingOrderRequest) returns (SubmitStandingOrderResponse) {}

  rpc GetStandingOrderStatus (GetStandingOrderStatusRequest) returns (GetStandingOrderStatusResponse) {}
}

service LinkingService {
  rpc InitiateLinking (InitiateLinkingRequest) returns (InitiateLinkingResponse) {}

  rpc LinkingCallback (LinkingCallbackRequest) returns (LinkingCallbackResponse) {}

  rpc UnlinkAccount (UnlinkAccountRequest) returns (UnlinkAccountResponse) {}
}

service MemberService {
  rpc DeleteMember (DeleteMemberRequest) returns (DeleteMemberResponse) {}
}

service StatusService {
  rpc GetBankStatus (GetBankStatusRequest) returns (GetBankStatusResponse) {}
}

io.token.proto.providerapi /external/src/main/proto/providerapi/providersigning.proto


syntax = "proto3";
package io.token.proto.providerapi;

message SignRequest {
  string payload = 1;
  string tpp_id = 2;
  string bank_id = 3;
}

message SignResponse {
  Signature signature = 1;

  message Signature {
    string signature = 1;
    string signature_algorithm = 2;
  }
}

message SignJwtRequest {
  string jwt_payload = 1; // JSON string
  string tpp_id = 2;
  string bank_id = 3;
  // JSON string of additional headers other than 'alg' and 'kid'
  string additional_jwt_headers = 4;
}

message SignJwtResponse {
  string jws = 1;
}

service ProviderSigningService {
  rpc Sign (SignRequest) returns (SignResponse) {}
  rpc SignJwt (SignJwtRequest) returns (SignJwtResponse) {}
}

io.token.proto.providerapi /external/src/main/proto/providerapi/secret.proto


syntax = "proto3";
package io.token.proto.providerapi;

import "extensions/field.proto";

message Payload {
  string id = 1;
  bytes data = 2;
}

message StoreSecretRequest {
  Payload payload = 1 [(io.token.proto.extensions.field.redact) = true];
}

message StoreSecretResponse {
  string secret_id = 1;
}

message GetSecretRequest {
  string secret_id = 1;
}

message GetSecretResponse {
  Payload payload = 1 [(io.token.proto.extensions.field.redact) = true];
}

service SecretService {
  rpc StoreSecret (StoreSecretRequest) returns (StoreSecretResponse) {}
  rpc GetSecret (GetSecretRequest) returns (GetSecretResponse) {}
}