class Lithic::Resources::Accounts

def initialize(client:)

Parameters:
  • client (Lithic::Client) --

Other tags:
    Api: - private
def initialize(client:)
  @client = client
end

def list(params = {})

Other tags:
    See: Lithic::Models::AccountListParams -

Returns:
  • (Lithic::Internal::CursorPage) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • starting_after (String) -- A cursor representing an item's token after which a page of results should begin
  • page_size (Integer) -- Page size (for pagination).
  • ending_before (String) -- A cursor representing an item's token before which a page of results should end.
  • end_ (Time) -- Date string in RFC 3339 format. Only entries created before the specified time w
  • begin_ (Time) -- Date string in RFC 3339 format. Only entries created after the specified time wi

Overloads:
  • list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {})
def list(params = {})
  parsed, options = Lithic::AccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/accounts",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::Account,
    options: options
  )
end

def retrieve(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountRetrieveParams -

Returns:
  • (Lithic::Account) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • account_token (String) -- Globally unique identifier for account.

Overloads:
  • retrieve(account_token, request_options: {})
def retrieve(account_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/accounts/%1$s", account_token],
    model: Lithic::Account,
    options: params[:request_options]
  )
end

def retrieve_spend_limits(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountRetrieveSpendLimitsParams -

Returns:
  • (Lithic::AccountSpendLimits) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • account_token (String) -- Globally unique identifier for account.

Overloads:
  • retrieve_spend_limits(account_token, request_options: {})
def retrieve_spend_limits(account_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/accounts/%1$s/spend_limits", account_token],
    model: Lithic::AccountSpendLimits,
    options: params[:request_options]
  )
end

def update(account_token, params = {})

Other tags:
    See: Lithic::Models::AccountUpdateParams -

Returns:
  • (Lithic::Account) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • verification_address (Lithic::AccountUpdateParams::VerificationAddress) -- Address used during Address Verification Service (AVS) checks during transaction
  • state (Symbol, Lithic::AccountUpdateParams::State) -- Account states.
  • monthly_spend_limit (Integer) -- Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a
  • lifetime_spend_limit (Integer) -- Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a
  • daily_spend_limit (Integer) -- Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a $1
  • account_token (String) -- Globally unique identifier for account.

Overloads:
  • update(account_token, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, verification_address: nil, request_options: {})
def update(account_token, params = {})
  parsed, options = Lithic::AccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/accounts/%1$s", account_token],
    body: parsed,
    model: Lithic::Account,
    options: options
  )
end