Class: Plaid::BankTransferApi

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

Overview

BankTransferApi

Constant Summary

Constants inherited from BaseApi

Plaid::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

#bank_transfer_balance_get(body) ⇒ ApiResponse

Use the ‘/bank_transfer/balance/get` endpoint to see the available balance in your bank transfer account. Debit transfers increase this balance once their status is posted. Credit transfers decrease this balance when they are created. The transactable balance shows the amount in your account that you are able to use for transfers, and is essentially your available balance minus your minimum balance. Note that this endpoint can only be used with FBO accounts, when using Bank Transfers in the Full Service configuration. It cannot be used on your own account when using Bank Transfers in the BTS Platform configuration. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/plaid/apis/bank_transfer_api.rb', line 266

def bank_transfer_balance_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/balance/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(BankTransferBalanceGetResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_cancel(body) ⇒ ApiResponse

Use the ‘/bank_transfer/cancel` endpoint to cancel a bank transfer. A transfer is eligible for cancelation if the `cancellable` property returned by `/bank_transfer/get` is `true`. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/plaid/apis/bank_transfer_api.rb', line 15

def bank_transfer_cancel(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/cancel',
                                 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(BankTransferCancelResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_create(body) ⇒ ApiResponse

Use the ‘/bank_transfer/create` endpoint to initiate a new bank transfer. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/plaid/apis/bank_transfer_api.rb', line 153

def bank_transfer_create(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/create',
                                 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(BankTransferCreateResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_event_list(body) ⇒ ApiResponse

Use the ‘/bank_transfer/event/list` endpoint to get a list of bank transfer events based on specified filter criteria. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/plaid/apis/bank_transfer_api.rb', line 205

def bank_transfer_event_list(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/event/list',
                                 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(BankTransferEventListResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_event_sync(body) ⇒ ApiResponse

‘/bank_transfer/event/sync` allows you to request up to the next 25 bank transfer events that happened after a specific `event_id`. Use the `/bank_transfer/event/sync` endpoint to guarantee you have seen all bank transfer events. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/plaid/apis/bank_transfer_api.rb', line 96

def bank_transfer_event_sync(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/event/sync',
                                 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(BankTransferEventSyncResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_get(body) ⇒ ApiResponse

The ‘/bank_transfer/get` fetches information about the bank transfer corresponding to the given `bank_transfer_id`. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/plaid/apis/bank_transfer_api.rb', line 231

def bank_transfer_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/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(BankTransferGetResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_list(body) ⇒ ApiResponse

Use the ‘/bank_transfer/list` endpoint to see a list of all your bank transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired bank transfers. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/plaid/apis/bank_transfer_api.rb', line 68

def bank_transfer_list(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/list',
                                 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(BankTransferListResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_migrate_account(body) ⇒ ApiResponse

As an alternative to adding Items via Link, you can also use the ‘/bank_transfer/migrate_account` endpoint to migrate known account and routing numbers to Plaid Items. Note that Items created in this way are not compatible with endpoints for other products, such as `/accounts/balance/get`, and can only be used with Bank Transfer endpoints. If you require access to other endpoints, create the Item through Link instead. Access to `/bank_transfer/migrate_account` is not enabled by default; to obtain access, contact your Plaid Account Manager. type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/plaid/apis/bank_transfer_api.rb', line 128

def (body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/migrate_account',
                                 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(BankTransferMigrateAccountResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_sweep_get(body) ⇒ ApiResponse

The ‘/bank_transfer/sweep/get` endpoint fetches information about the sweep corresponding to the given `sweep_id`. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def bank_transfer_sweep_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/sweep/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(BankTransferSweepGetResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#bank_transfer_sweep_list(body) ⇒ ApiResponse

The ‘/bank_transfer/sweep/list` endpoint fetches information about the sweeps matching the given filters. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/plaid/apis/bank_transfer_api.rb', line 179

def bank_transfer_sweep_list(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/bank_transfer/sweep/list',
                                 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(BankTransferSweepListResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end