Class: Plaid::InvestmentsApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/plaid/apis/investments_api.rb

Overview

InvestmentsApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from Plaid::BaseApi

Instance Method Details

#investments_holdings_get(body) ⇒ ApiResponse

The ‘/investments/holdings/get` endpoint allows developers to receive user-authorized stock position data for `investment`-type accounts. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/plaid/apis/investments_api.rb', line 43

def investments_holdings_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/investments/holdings/get',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InvestmentsHoldingsGetResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end

#investments_transactions_get(body) ⇒ ApiResponse

The ‘/investments/transactions/get` endpoint allows developers to retrieve user-authorized transaction data for investment accounts. Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Due to the potentially large number of investment transactions associated with an Item, results are paginated. Manipulate the count and offset parameters in conjunction with the `total_investment_transactions` response body field to fetch all available investment transactions. type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/plaid/apis/investments_api.rb', line 20

def investments_transactions_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/investments/transactions/get',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InvestmentsTransactionsGetResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end