Struct Field52A

Source
pub struct Field52A {
    pub account_line_indicator: Option<String>,
    pub account_number: Option<String>,
    pub bic: String,
}
Expand description

§Field 52A: Ordering Institution

§Overview

Field 52A identifies the ordering institution in SWIFT payment messages. This field specifies the financial institution that is acting on behalf of the ordering customer (Field 50) to initiate the payment. It represents the first institution in the payment chain and is crucial for routing, settlement, and compliance purposes.

§Format Specification

Format: [/1!a][/34x]4!a2!a2!c[3!c]

  • 1!a: Optional account line indicator (1 character)
  • 34x: Optional account number (up to 34 characters)
  • 4!a2!a2!c[3!c]: BIC code (8 or 11 characters)

§BIC Structure

DEUTDEFF500
││││││││└┴┴─ Branch Code (3 characters, optional)
││││││└┴──── Location Code (2 characters)
││││└┴────── Country Code (2 letters)
└┴┴┴──────── Bank Code (4 letters)

§Field Components

  • Account Line Indicator: Single character qualifier for account number type
  • Account Number: Institution’s account number for settlement
  • BIC: Bank Identifier Code uniquely identifying the institution

§Usage Context

Field 52A is used in:

  • MT103: Single Customer Credit Transfer
  • MT200: Financial Institution Transfer
  • MT202: General Financial Institution Transfer
  • MT202COV: Cover for customer credit transfer

§Business Applications

  • Payment routing: Identifying the institution to route payment through
  • Settlement: Providing account information for settlement processes
  • Compliance: Meeting regulatory requirements for institution identification
  • Correspondent banking: Managing relationships between correspondent banks
  • Risk management: Assessing counterparty risk and limits

§Examples

:52A:DEUTDEFFXXX
└─── Deutsche Bank Frankfurt (no account information)

:52A:/C/1234567890
CHASUS33XXX
└─── JPMorgan Chase New York with checking account 1234567890

:52A:/A/GB12ABCD12345678901234
ABCDEFGHJKL
└─── Bank with account line indicator A and IBAN account

:52A:/S/SWIFT001234567890
BNPAFRPPXXX
└─── BNP Paribas with SWIFT account identifier

§Account Line Indicators

Common account line indicators include:

  • A: Account identifier (generic)
  • B: Beneficiary account
  • C: Checking account
  • D: Deposit account
  • S: SWIFT account identifier
  • T: Trust account

§Validation Rules

  1. BIC format: Must be valid 8 or 11 character BIC
  2. BIC structure: 4!a2!a2!c[3!c] format required
  3. Account line indicator: If present, exactly 1 character
  4. Account number: If present, max 34 characters
  5. Character validation: All components must use valid character sets

§Network Validated Rules (SWIFT Standards)

  • BIC must be valid format and registered (Error: T27)
  • Account line indicator must be single character (Error: T12)
  • Account number cannot exceed 34 characters (Error: T15)
  • BIC country code must be valid ISO country code (Error: T28)
  • Characters must be from SWIFT character set (Error: T61)
  • Field 52A is mandatory in most payment message types (Error: C52)

Fields§

§account_line_indicator: Option<String>

Account line indicator (optional, 1 character)

§account_number: Option<String>

Account number (optional, up to 34 characters)

§bic: String

BIC code (8 or 11 characters)

Implementations§

Source§

impl Field52A

Source

pub fn new( account_line_indicator: Option<String>, account_number: Option<String>, bic: impl Into<String>, ) -> Result<Self, ParseError>

Create a new Field52A with validation

Source

pub fn account_line_indicator(&self) -> Option<&str>

Get the account line indicator

Source

pub fn account_number(&self) -> Option<&str>

Get the account number

Source

pub fn bic(&self) -> &str

Get the BIC code

Source

pub fn is_full_bic(&self) -> bool

Check if this is a full BIC (11 characters)

Trait Implementations§

Source§

impl Clone for Field52A

Source§

fn clone(&self) -> Field52A

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 Field52A

Source§

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

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

impl<'de> Deserialize<'de> for Field52A

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 PartialEq for Field52A

Source§

fn eq(&self, other: &Field52A) -> 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 Field52A

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 SwiftField for Field52A

Source§

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

Parse field value from string representation
Source§

fn to_swift_string(&self) -> String

Convert field back to SWIFT string format
Source§

fn validate(&self) -> ValidationResult

Validate field according to SWIFT format rules
Source§

fn format_spec() -> &'static str

Get field format specification
Source§

impl Eq for Field52A

Source§

impl StructuralPartialEq for Field52A

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> 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> 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, 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,