BasicHeader

Struct BasicHeader 

Source
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§

Source§

impl BasicHeader

Source

pub fn parse(block1: &str) -> Result<Self>

Parse basic header from block 1 string

Trait Implementations§

Source§

impl Clone for BasicHeader

Source§

fn clone(&self) -> BasicHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BasicHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BasicHeader

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for BasicHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BasicHeader

Source§

fn eq(&self, other: &BasicHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BasicHeader

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BasicHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: Rng + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,