CBS <-> Sepa Connector API interface
protobuf file contents
syntax = "proto2";
import "google/protobuf/timestamp.proto";
package sepa;
/*
message ParticipantBasicInfo {
required string name = 1;
required string account_id = 2; // usually IBAN
required string bic = 3;
}
message Participant {
required ParticipantBasicInfo basic_info = 1;
optional string country = 2; // e.g. LT
optional string address1 = 3;
optional string address2 = 4;
}
*/
message Participant {
required string name = 1;
required string account_id = 2; // usually IBAN
required string bic = 3;
optional string country = 4; // e.g. LT
optional string address1 = 5;
optional string address2 = 6;
}
message Payment /*FFCCTRNS*/{
required string interbank_message_id = 1; // e.g. D201910218968124
required string created_at = 2; // e.g. 2019-10-03T08:34:01
required string total_settlement_amount = 3; // e.g. 2.55
required string settlement_date = 4; // e.g. 2019-10-21
required string instructing_agent_bic = 5; // e.g. CIURGB21XXX
required string number_of_transactions = 6; // e.g. 1
message PaymentTransaction {
required string instruction_id = 1; // e.g. D201910218968124
optional string end_to_end_id = 2;
required string interbank_transfer_id = 3; // e.g. D201910218968124
required string settlement_amount = 4; // e.g. 2.55
optional string transfer_title = 5;
required Participant debtor = 6;
required Participant creditor = 7;
}
repeated PaymentTransaction transactions = 7;
}
message CancelRequest /*FFPCRQST*/{
required string interbank_message_id = 1;
required string created_at = 2;
required string number_of_transactions = 3; // e.g. 1
message CancelRequestTransaction {
required string interbank_recall_id = 1;
required string reason_originator_name = 2; // BIC or name (bank or user)
required string reason_info_property = 3;
optional string reason_info_additional = 4;
required string original_message_id = 5;
required string original_settlement_date = 6;
required Payment.PaymentTransaction original_payment_transaction = 7;
}
repeated CancelRequestTransaction transactions = 4;
}
message CancelRejection /*ROINVSTG*/ {
required string interbank_message_id = 1;
required string created_at = 2;
required string instructing_agent_bic = 3; // e.g. CIURGB21XXX
required string instructed_party = 4; // e.g. LIABLT2XMSD
required string interbank_resolution_id = 5;
required string reason_originator_name = 6; // BIC or name (bank or user)
required string reason_info_property = 7;
optional string reason_info_additional = 8;
required string original_message_id = 9;
required string original_settlement_date = 10;
required Payment.PaymentTransaction original_payment_transaction = 11;
}
message PaymentReturn /*PRTRN*/{
required string interbank_message_id = 1;
required string created_at = 2;
required string settlement_date = 3; // e.g. 2019-10-21
required string number_of_transactions = 4; // e.g. 1
required string total_return_amount = 5; // e.g. 2.55
required string instructing_agent_bic = 6; // e.g. CIURGB21XXX
message PaymentReturnTransaction {
required string interbank_return_id = 1;
required string return_settlement_amount = 2;
optional string charge_amount = 3;
optional string charge_bic = 4;
required string reason_originator_name = 5; // BIC or name (bank or user)
required string reason_info_property = 6;
optional string reason_info_additional = 7;
required string original_message_id = 8;
required string original_message_id_type = 9;
required string original_settlement_date = 10;
required Payment.PaymentTransaction original_payment_transaction = 11;
}
repeated PaymentReturnTransaction transactions = 7;
}
// Note: Unlike other messages this one is sent only one way (CBS<-SC)
message StandAloneNotification {
enum TDescription {
Acknowledged = 0; // PaymentReturn/Payment/CancelRejection/CancelRequest
Completed = 1; // Settled/Accepted/Forwarded // PaymentReturn/Payment/CancelRejection/CancelRequest
Postponed = 2; // due to bank being closed // PaymentReturn/Payment
Rejected = 3; // PaymentReturn/Payment/CancelRejection/CancelRequest
}
enum TSource {
SC = 0;
DIS = 1;
BANK = 2;
}
required string original_interbank_id = 1;
required TDescription description = 2;
required TSource source = 3;
optional string additional_info = 4; // e.g. exact reason of rejection
optional google.protobuf.Timestamp reopen_time = 5; // meaningful with Postponed only
}
message PaymentNotification {
required StandAloneNotification san = 1;
}
message PaymentReturnNotification {
required StandAloneNotification san = 1;
}
message CancelRequestNotification {
required StandAloneNotification san = 1;
}
message CancelRejectionNotification {
required StandAloneNotification san = 1;
}
Claim For Value Date Correction (REQMP)
int interbankMessageId
timestamp createdAt
text interbankId
text originalMessageId
text originalMessageIdType
text originalInterbankId
TAsset originalSettlementAsset
date originalSettlementDate
TParticipantBasicInfo originalDebtor
TParticipantBasicInfo originalCreditor
date modification
text instruction
Reject Correction (RESINV)
int interbankMessageId
timestamp createdAt
text interbankId
text originalMessageId
text originalMessageIdType
text originalInterbankId
text reasonBicOrBei // Business Entity Identifier (non-financial)
text reasonCode
text reasonInfoAdditional
TAmount originalSettlementAsset
date originalSettlementDate
text originalTitle
TParticipant originalDebtor
TParticipant originalCreditor
Mapping API types to BoL message types
- TPayment - FFCCTRNS
- TCancelRequest -FFPCRQST
- TCancelRejection - ROINVSTG
- TPaymentReturn - PRTRN
- TStatusChange - FFPSRPRT(?) - and what about FFPSRPRT referring to documents other than FFCCTRNS and PRTRN, also sometimes status changes due to an incoming document other than FFPSRPRT.
- Claim For Value Date Correction - REQMP
- Reject Correction - RESINV(?)
- ? - CNRECP
- ? - FFPSRPRQ
- ? - FINDOCS
- ? - NETADV
- ? - BALANCE (various CBAL* documents)
- ? - BTCDCNTF
- ? - DICTIONR (various *PARTS documents)
Questions
- Some BoL message and document types have no corresponding API types? Why? Will they be added later and if so when?
- Based on the diagrams all API types, except
TStatusChange
will be both sent and received by SC, bu it is not explicitly stated anywhere. -
TStatusChange
message can refer to either Payment or Return. What about other Recall? What about other message types? What should SC do if it receives FFPSRPRT document rejecting one of them (acceptance is ignored according to diagrams)? -
Claim For Value Date Correction
andReject Correction
are not proper ProtoBuf types, but merely lists of fields withoutrequired
andoptional
modifiers or field numbers assigned to them. - Should
TStatusChange
be sent only for FFPSRPRT incoming from PAS? Recall or Return messages incoming from PAS also change Payment status. - There is no API type for when SC rejects message due to bank not being available.
- Communication between SC and CDR submodule of DIS is synchronous. As such, to avoid SC waiting indefinitely for response in case of error, any error during document from CBS processing in CDR is also reported to SC. According to diagrams this kind of error should be reported to CBS to prompt status change. The API, however, does not specify any error type for this purpose. Should this be resolved by sending
TStatusChange
message to CBS? If so, what about errors occuring while SC queries CDR for new documents? Those do not cause any status changes in CBS. - Is wiki really the best place to keep source code? Shouldn't
.proto
files be placed in a dedicated repo or a dedicated branch ofblocktrades/SEPA
repo to make tracking changes and incorporating them in other projects easier?
Answers by @pjakubowski: https://chat.syncad.com/group/sepa_pl?msg=wfJMpsDBs8r43tATE
Answers by @Whoocush: https://chat.syncad.com/group/sepa_pl?msg=Zv2jCJ8HPpZ52yiZQ