pub struct BasicHeader {
pub application_id: String,
pub service_id: String,
pub logical_terminal: String,
pub sender_bic: String,
pub session_number: String,
pub sequence_number: String,
}
Expand description
Basic Header (Block 1): SWIFT Message Identification and Routing
§Purpose
The Basic Header constitutes the first mandatory block of every SWIFT message, providing essential identification, routing, and sequencing information. This header enables the SWIFT network to authenticate the sender, route the message appropriately, and maintain message sequence integrity across the global financial messaging infrastructure.
§Format Specification
- Block Format:
{1:F01SSSSSSSSSCCC0000NNNNNN}
- Total Length: Exactly 25 characters
- Structure: Application ID + Service ID + LT Address + Session + Sequence
- Character Set: Alphanumeric, uppercase only
§Business Context Applications
- Message Authentication: Sender identification and verification
- Network Routing: Logical terminal addressing for message delivery
- Session Management: Message sequencing within communication sessions
- Audit Trail: Complete message tracking and reconciliation
§Component Breakdown
§Application Identifier (1 character)
- F: FIN application (Financial messages)
- A: GPA application (General Purpose Application)
- L: GPA application (for certain message types)
- Usage: Determines message processing rules and validation
§Service Identifier (2 characters)
- 01: FIN service (standard financial messages)
- 03: FIN Copy service (third-party copy)
- 05: GPA service
- 21: ACK/NAK service
§Logical Terminal Address (12 characters)
- BIC Code: First 8 characters (institution identifier)
- Terminal Code: Next 1 character (logical terminal)
- Branch Code: Last 3 characters (XXX for head office)
- Format: Must be valid SWIFT-connected BIC
§Network Validation Requirements
- BIC Validation: Must be active SWIFT participant
- Service Compatibility: Service ID must match message type
- Session Validity: Session number must be within valid range
- Sequence Continuity: Sequence numbers must be sequential
§Session and Sequence Management
§Session Number (4 digits)
- Range: 0000-9999
- Purpose: Groups related messages within a session
- Reset: Can be reset based on bilateral agreement
- Tracking: Used for message reconciliation
§Sequence Number (6 digits)
- Range: 000000-999999
- Increment: Sequential within session
- Uniqueness: Combined with session ensures message uniqueness
- Recovery: Critical for message recovery procedures
§Regional Considerations
- Time Zones: LT address determines processing time zone
- Operating Hours: Service availability based on regional center
- Holiday Schedules: Regional holiday impacts on processing
- Regulatory Compliance: Regional reporting requirements
§Error Prevention Guidelines
- BIC Accuracy: Verify sender BIC is authorized for service
- Sequence Management: Maintain strict sequence number control
- Session Coordination: Coordinate session numbers with correspondent
- Format Compliance: Ensure exact 25-character length
§Security and Authentication
- Sender Authentication: BIC must match authenticated connection
- Message Integrity: Header contributes to message MAC calculation
- Non-repudiation: Sender identification cannot be disputed
- Audit Trail: Complete tracking from sender to receiver
§Integration with Other Blocks
- Block 2: Message type and routing continuation
- Block 3: Optional user header for enhanced services
- Block 4: Message text validated based on Block 1 service
- Block 5: Trailer with checksums and authentication
§Compliance Framework
- SWIFT Standards: Full compliance with FIN interface standards
- Service Level Agreements: Performance guarantees based on service
- Regulatory Reporting: Sender identification for compliance
- Audit Requirements: Complete message trail maintenance
§Best Practices
- BIC Management: Keep BIC directory updated
- Sequence Control: Implement robust sequence management
- Session Planning: Plan session number allocation
- Error Recovery: Implement sequence gap detection
§See Also
- SWIFT FIN Interface Standards: Block 1 Specifications
- BIC Directory: Valid SWIFT Participant Codes
- Session Management Guide: Best Practices
- Message Sequencing: Control and Recovery Procedures
Fields§
§application_id: String
Application identifier
Format: 1!a - Single alphabetic character Values: F (FIN), A (GPA), L (GPA legacy) Determines message processing rules and validation requirements
service_id: String
Service identifier
Format: 2!n - Two numeric characters Common values: 01 (FIN), 03 (FIN Copy), 05 (GPA), 21 (ACK/NAK) Specifies the SWIFT service type for message handling
logical_terminal: String
Logical Terminal (LT) address
Format: 12!c - 12 alphanumeric characters Structure: 8-char BIC + 1-char terminal + 3-char branch Uniquely identifies the sending terminal in SWIFT network
sender_bic: String
Sender BIC extracted from logical terminal
Format: 8!c - First 8 characters of logical terminal The sending institution’s Bank Identifier Code
session_number: String
Session number
Format: 4!n - Four numeric digits (0000-9999) Groups related messages within a communication session Used for message reconciliation and recovery procedures
sequence_number: String
Sequence number
Format: 6!n - Six numeric digits (000000-999999) Sequential message counter within session Critical for message ordering and duplicate detection
Implementations§
Trait Implementations§
Source§impl Clone for BasicHeader
impl Clone for BasicHeader
Source§fn clone(&self) -> BasicHeader
fn clone(&self) -> BasicHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BasicHeader
impl Debug for BasicHeader
Source§impl<'de> Deserialize<'de> for BasicHeader
impl<'de> Deserialize<'de> for BasicHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for BasicHeader
impl Display for BasicHeader
Source§impl PartialEq for BasicHeader
impl PartialEq for BasicHeader
Source§impl Serialize for BasicHeader
impl Serialize for BasicHeader
impl StructuralPartialEq for BasicHeader
Auto Trait Implementations§
impl Freeze for BasicHeader
impl RefUnwindSafe for BasicHeader
impl Send for BasicHeader
impl Sync for BasicHeader
impl Unpin for BasicHeader
impl UnwindSafe for BasicHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more