sturnidae

Types

pub type CurrencyAndAmount {
  CurrencyAndAmount(currency: String, minor_units: Int)
}

Constructors

  • CurrencyAndAmount(currency: String, minor_units: Int)

    Arguments

    • currency

      The currency of the amount. e.g. GBP.

    • minor_units

      The amount in minor units. e.g. pence in GBP.

pub type Direction {
  In
  Out
}

Constructors

  • In

    Inbound transactions are money coming into the account.

  • Out

    Outbound transactions are money going out of the account.

An item from the account holders’s transaction feed.

pub type FeedItem {
  FeedItem(
    feed_item_uid: String,
    category_uid: String,
    amount: CurrencyAndAmount,
    source_amount: CurrencyAndAmount,
    updated_at: String,
    direction: Direction,
    transaction_time: String,
    source: String,
    status: TransactionStatus,
    counter_party_type: Option(String),
    counter_party_uid: Option(String),
    counter_party_name: String,
    total_fees: Option(Int),
    total_fee_amount: Option(CurrencyAndAmount),
    reference: Option(String),
    country: String,
    spending_category: String,
    user_note: Option(String),
  )
}

Constructors

  • FeedItem(
      feed_item_uid: String,
      category_uid: String,
      amount: CurrencyAndAmount,
      source_amount: CurrencyAndAmount,
      updated_at: String,
      direction: Direction,
      transaction_time: String,
      source: String,
      status: TransactionStatus,
      counter_party_type: Option(String),
      counter_party_uid: Option(String),
      counter_party_name: String,
      total_fees: Option(Int),
      total_fee_amount: Option(CurrencyAndAmount),
      reference: Option(String),
      country: String,
      spending_category: String,
      user_note: Option(String),
    )

    Arguments

    • feed_item_uid

      Unique identifier for this item.

    • category_uid

      The category on which the transaction happened.

    • updated_at

      The time the transaction was last updated at.

    • direction

      The direction of the transaction.

    • transaction_time

      The time of the transaction.

    • source

      The source of the transaction. e.g. MASTER_CARD.

    • status

      The status of a transaction.

    • counter_party_type

      The type of counter party for a transaction. e.g. MERCHANT

    • counter_party_uid

      The unique identifier for the counter party. e.g. for MERCHANT this will be the merchant uid, for PAYEE this will be the payee uid.

    • counter_party_name

      The name of the counter party

    • country

      The country in which the transaction took place. ISO 3166-1 alpha-2 country code.

    • user_note

      The user-provided transaction note

pub type StarlingApiError {
  StarlingClientError(status_code: Int, messages: List(String))
  StarlingServerError(status_code: Int, message: String)
}

Constructors

  • StarlingClientError(status_code: Int, messages: List(String))
  • StarlingServerError(status_code: Int, message: String)
pub type StarlingApiResult(t) =
  Result(t, StarlingApiError)
pub type TransactionStatus {
  Upcoming
  Pending
  Reversed
  Settled
  Declined
  Refunded
  Retrying
  AccountCheck
}

Constructors

  • Upcoming
  • Pending
  • Reversed
  • Settled
  • Declined
  • Refunded
  • Retrying
  • AccountCheck

Constants

pub const v2: String

Functions

pub fn decode_feed_item(
  d: Dynamic,
) -> Result(FeedItem, List(DecodeError))
pub fn direction_to_string(direction: Direction) -> String
pub fn get_feed_items_request(
  pat pat: String,
  account_uid account: String,
  category_uid category: String,
  changes_since limit: String,
) -> Request(String)

Create a request for the /api/v2/feed/account/{accountUid}/category/{categoryUid} endpoint.

🔒 Security: Requires the transaction:read OAuth scope

Categories are subdivisions of an account. The default category holds the main balance and transactions. Savings goals and spending spaces are examples of other categories. You can use /api/v2/accounts to get the default category UID for an account.

pub fn get_feed_items_response(
  response: Response(String),
) -> Result(List(FeedItem), StarlingApiError)

Decode a response from the /api/v2/feed/account/{accountUid}/category/{categoryUid} endpoint.

See the get_feed_items_request function for creating a request to this endpoint.

pub fn string_to_transaction_status(
  status: String,
) -> Result(TransactionStatus, Nil)
pub fn transaction_status_to_string(
  status: TransactionStatus,
) -> String
Search Document