Account

Struct Account 

Source
pub struct Account {
    pub id: AccountId,
    pub migrated: Option<String>,
    pub authorisation: AuthorizationId,
    pub credentials: Option<AuthorizationId>,
    pub name: String,
    pub status: Active,
    pub formatted_acount: Option<String>,
    pub refreshed: RefreshDetails,
    pub balance: BalanceDetails,
    pub kind: BankAccountKind,
    pub attributes: Vec<Attribute>,
}
Expand description

An Akahu account is something that has a balance. Some connections (like banks) have lots of accounts, while others (like KiwiSaver providers) may only have one. Different types of accounts have different attributes and abilities, which can get a bit confusing! The rest of this page should help you figure everything out, from an account’s provider to whether it can make payments.

Keep in mind that we limit what information is available depending on your app permissions. This is done in order to protect user privacy, however it also means that some of the data here may not be visible to you.

Fields§

§id: AccountId

The id key is a unique identifier for the account in the Akahu system.

It is always be prefixed by acc_ so that you can tell that it belongs to an account.

[https://developers.akahu.nz/docs/the-account-model#_id]

§migrated: Option<String>

The identifier of this account’s predecessor.

This attribute is only present if the account has been migrated to an official open banking connection from a classic Akahu connection.

Read more about official open banking, and migrating to it here.

[https://developers.akahu.nz/docs/the-account-model#_migrated]

§authorisation: AuthorizationId

Financial accounts are connected to Akahu via an authorisation with the user’s financial institution. Multiple accounts can be connected during a single authorisation, causing them to have the same authorisation identifier. This identifier can also be used to link a specific account to identity data for the party who completed the authorisation.

This identifier can also be used to revoke access to all the accounts connected to that authorisation.

For example, if you have 3 ANZ accounts, they will all have the same authorisation. Your ANZ accounts and your friend’s ANZ accounts have different logins, so they will have a different authorisation key. The authorisation key is in no way derived or related to your login credentials - it’s just a random ID.

[https://developers.akahu.nz/docs/the-account-model#_authorisation]

§credentials: Option<AuthorizationId>
👎Deprecated: Please use authorisation instead.
§name: String

This is the name of the account. If the connection allows customisation, the name will be the custom name (or nickname), e.g. “Spending Account”. Otherwise Akahu falls back to the product name, e.g. “Super Saver”.

[https://developers.akahu.nz/docs/the-account-model#name]

§status: Active

This attribute indicates the status of Akahu’s connection to this account.

It is possible for Akahu to lose the ability to authenticate with a financial institution if the user revokes Akahu’s access directly via their institution, or changes their login credentials, which in some cases can cause our long-lived access to be revoked.

[https://developers.akahu.nz/docs/the-account-model#status]

§formatted_acount: Option<String>

If the account has a well defined account number (eg. a bank account number, or credit card number) this will be defined here with a standard format across connections. This field will be the value undefined for accounts with KiwiSaver providers and investment platform accounts.

For NZ banks, we use the common format 00-0000-0000000-00. For credit cards, we return a redacted card number 1234---1234 or --****-1234

[https://developers.akahu.nz/docs/the-account-model#formatted_account]

§refreshed: RefreshDetails

Akahu can refresh different parts of an account’s data at different rates. The timestamps in the refreshed object tell you when that account data was last updated.

When looking at a timestamp in here, you can think “Akahu’s view of the account (balance/metadata/transactions) is up to date as of $TIME”.

[https://developers.akahu.nz/docs/the-account-model#refreshed]

§balance: BalanceDetails§kind: BankAccountKind

What sort of account this is. Akahu provides specific bank account types, and falls back to more general types for other types of connection.

[https://developers.akahu.nz/docs/the-account-model#type]

§attributes: Vec<Attribute>

The list of attributes indicates what abilities an account has.

See Attribute for more information.

[https://developers.akahu.nz/docs/the-account-model#attributes]

Trait Implementations§

Source§

impl Clone for Account

Source§

fn clone(&self) -> Account

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 Account

Source§

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

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

impl<'de> Deserialize<'de> for Account

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 Account

Source§

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

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 Eq for Account

Source§

impl StructuralPartialEq for Account

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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