Class: Pluggy::Services::AccountService

Inherits:
BaseService show all
Defined in:
lib/pluggy/services/other_services.rb

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Pluggy::Services::BaseService

Instance Method Details

#balance(id) ⇒ Object

Live balance, read from the institution rather than the last sync. Slower than Account#balance and the one endpoint in scope that documents a 429 (institution rate limit) and a 502 (institution unavailable).



23
24
25
26
# File 'lib/pluggy/services/other_services.rb', line 23

def balance(id)
  require_args!(id: id)
  object_request(:get, "/accounts/#{id}/balance", klass: Resources::Balance)
end

#list(item_id:, type: nil) ⇒ Object

GET /accounts. type filters between "BANK" and "CREDIT".

paginated: false -- the endpoint returns a page envelope but documents no page/pageSize parameters, so there is no way to request page 2.



10
11
12
13
# File 'lib/pluggy/services/other_services.rb', line 10

def list(item_id:, type: nil)
  require_args!(item_id: item_id)
  list_request("/accounts", klass: Resources::Account, itemId: item_id, type: type)
end

#retrieve(id) ⇒ Object



15
16
17
18
# File 'lib/pluggy/services/other_services.rb', line 15

def retrieve(id)
  require_args!(id: id)
  object_request(:get, "/accounts/#{id}", klass: Resources::Account)
end

#statements(id) ⇒ Object

Monthly statement documents. Each url is signed and valid 30 minutes.



29
30
31
32
# File 'lib/pluggy/services/other_services.rb', line 29

def statements(id)
  require_args!(id: id)
  list_request("/accounts/#{id}/statements", klass: Resources::Statement)
end