Class: SyncteraRubySdk::ExternalAccountsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/api/external_accounts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExternalAccountsApi

Returns a new instance of ExternalAccountsApi.



19
20
21
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_external_accounts(add_accounts_request, opts = {}) ⇒ ExternalAccount

Add an external account Add an external account for a customer. The account will be created in an unverified state.

Parameters:

  • add_accounts_request (AddAccountsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



28
29
30
31
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 28

def add_external_accounts(add_accounts_request, opts = {})
  data, _status_code, _headers = add_external_accounts_with_http_info(add_accounts_request, opts)
  data
end

#add_external_accounts_with_http_info(add_accounts_request, opts = {}) ⇒ Array<(ExternalAccount, Integer, Hash)>

Add an external account Add an external account for a customer. The account will be created in an unverified state.

Parameters:

  • add_accounts_request (AddAccountsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(ExternalAccount, Integer, Hash)>)

    ExternalAccount data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 39

def add_external_accounts_with_http_info(add_accounts_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.add_external_accounts ...'
  end
  # verify the required parameter 'add_accounts_request' is set
  if @api_client.config.client_side_validation && add_accounts_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_accounts_request' when calling ExternalAccountsApi.add_external_accounts"
  end
  # resource path
  local_var_path = '/external_accounts'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_accounts_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.add_external_accounts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#add_external_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_vendor_external_accounts(add_vendor_accounts_request, opts = {}) ⇒ AddVendorAccountsResponse

Add external accounts through a vendor, such as Plaid. Add external accounts for a customer through an existing access token. The token must be valid, and the information on the accounts returned by the vendor must correspond to the customer. A success response for this route may include failures if an account could not be added, so it’s important that the caller checks the response body.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



99
100
101
102
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 99

def add_vendor_external_accounts(add_vendor_accounts_request, opts = {})
  data, _status_code, _headers = add_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts)
  data
end

#add_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts = {}) ⇒ Array<(AddVendorAccountsResponse, Integer, Hash)>

Add external accounts through a vendor, such as Plaid. Add external accounts for a customer through an existing access token. The token must be valid, and the information on the accounts returned by the vendor must correspond to the customer. A success response for this route may include failures if an account could not be added, so it&#39;s important that the caller checks the response body.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(AddVendorAccountsResponse, Integer, Hash)>)

    AddVendorAccountsResponse data, response status code and response headers



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 110

def add_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.add_vendor_external_accounts ...'
  end
  # verify the required parameter 'add_vendor_accounts_request' is set
  if @api_client.config.client_side_validation && add_vendor_accounts_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_vendor_accounts_request' when calling ExternalAccountsApi.add_vendor_external_accounts"
  end
  # resource path
  local_var_path = '/external_accounts/add_vendor_accounts'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_vendor_accounts_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AddVendorAccountsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.add_vendor_external_accounts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#add_vendor_external_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_access_token(external_account_access_token, opts = {}) ⇒ ExternalAccountAccessToken

Create a permanent access token for an external account

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



169
170
171
172
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 169

def create_access_token(, opts = {})
  data, _status_code, _headers = create_access_token_with_http_info(, opts)
  data
end

#create_access_token_with_http_info(external_account_access_token, opts = {}) ⇒ Array<(ExternalAccountAccessToken, Integer, Hash)>

Create a permanent access token for an external account

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(ExternalAccountAccessToken, Integer, Hash)>)

    ExternalAccountAccessToken data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 179

def create_access_token_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.create_access_token ...'
  end
  # verify the required parameter 'external_account_access_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_access_token' when calling ExternalAccountsApi.create_access_token"
  end
  # resource path
  local_var_path = '/external_accounts/access_tokens'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccountAccessToken'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.create_access_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#create_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a link token to verify an external account

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



238
239
240
241
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 238

def create_verification_link_token(, opts = {})
  data, _status_code, _headers = create_verification_link_token_with_http_info(, opts)
  data
end

Create a link token to verify an external account

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(ExternalAccountLinkToken, Integer, Hash)>)

    ExternalAccountLinkToken data, response status code and response headers



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 248

def create_verification_link_token_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.create_verification_link_token ...'
  end
  # verify the required parameter 'external_account_link_token' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_link_token' when calling ExternalAccountsApi.create_verification_link_token"
  end
  # resource path
  local_var_path = '/external_accounts/link_tokens'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccountLinkToken'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.create_verification_link_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#create_verification_link_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_external_account(external_account_id, opts = {}) ⇒ DeleteResponse

Delete an external account Deletes an external account, given an external account ID. If no accounts left, the access token to the financial institution will be removed

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



307
308
309
310
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 307

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#delete_external_account_with_http_info(external_account_id, opts = {}) ⇒ Array<(DeleteResponse, Integer, Hash)>

Delete an external account Deletes an external account, given an external account ID. If no accounts left, the access token to the financial institution will be removed

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteResponse, Integer, Hash)>)

    DeleteResponse data, response status code and response headers



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 317

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.delete_external_account ...'
  end
  # verify the required parameter 'external_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_id' when calling ExternalAccountsApi.delete_external_account"
  end
  # resource path
  local_var_path = '/external_accounts/{external_account_id}'.sub('{' + 'external_account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.delete_external_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#delete_external_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_external_account(external_account_id, opts = {}) ⇒ ExternalAccount

Get an external account Returns an external account, given an external account ID.

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



370
371
372
373
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 370

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#get_external_account_balance(external_account_id, opts = {}) ⇒ ExternalAccountBalance

Get external account balances Given an external account ID, return the account balances in real time. The data returned by this endpoint is always fetched synchronously; it is not cached by Synctera. As a result, response latency is often high.

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :max_age (Integer)

    Optional relative age of a balance in seconds. If the balance is older than the requested seconds it will fail. This field is optional for most financial institutions, but required for some, so you should probably send it.

Returns:



434
435
436
437
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 434

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#get_external_account_balance_with_http_info(external_account_id, opts = {}) ⇒ Array<(ExternalAccountBalance, Integer, Hash)>

Get external account balances Given an external account ID, return the account balances in real time. The data returned by this endpoint is always fetched synchronously; it is not cached by Synctera. As a result, response latency is often high.

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :max_age (Integer)

    Optional relative age of a balance in seconds. If the balance is older than the requested seconds it will fail. This field is optional for most financial institutions, but required for some, so you should probably send it.

Returns:

  • (Array<(ExternalAccountBalance, Integer, Hash)>)

    ExternalAccountBalance data, response status code and response headers



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 445

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.get_external_account_balance ...'
  end
  # verify the required parameter 'external_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_id' when calling ExternalAccountsApi.get_external_account_balance"
  end
  if @api_client.config.client_side_validation && !opts[:'max_age'].nil? && opts[:'max_age'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_age"]" when calling ExternalAccountsApi.get_external_account_balance, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/external_accounts/{external_account_id}/balance'.sub('{' + 'external_account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'max_age'] = opts[:'max_age'] if !opts[:'max_age'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccountBalance'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.get_external_account_balance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#get_external_account_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_external_account_transactions(external_account_id, start_date, end_date, opts = {}) ⇒ ExternalAccountsTransactionList

List transactions of a given external account Returns a list of transactions on from the external account, given an external account ID. Maximum 500 transctions will be returned.

Parameters:

  • external_account_id (String)

    External Account ID

  • start_date (Date)

    Date range filtering for transactions. Date is inclusive. Date must be in UTC.

  • end_date (Date)

    Date range filtering for transactions. Date is exclusive. Date must be in UTC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



505
506
507
508
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 505

def (, start_date, end_date, opts = {})
  data, _status_code, _headers = (, start_date, end_date, opts)
  data
end

#get_external_account_transactions_with_http_info(external_account_id, start_date, end_date, opts = {}) ⇒ Array<(ExternalAccountsTransactionList, Integer, Hash)>

List transactions of a given external account Returns a list of transactions on from the external account, given an external account ID. Maximum 500 transctions will be returned.

Parameters:

  • external_account_id (String)

    External Account ID

  • start_date (Date)

    Date range filtering for transactions. Date is inclusive. Date must be in UTC.

  • end_date (Date)

    Date range filtering for transactions. Date is exclusive. Date must be in UTC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 517

def (, start_date, end_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.get_external_account_transactions ...'
  end
  # verify the required parameter 'external_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_id' when calling ExternalAccountsApi.get_external_account_transactions"
  end
  # verify the required parameter 'start_date' is set
  if @api_client.config.client_side_validation && start_date.nil?
    fail ArgumentError, "Missing the required parameter 'start_date' when calling ExternalAccountsApi.get_external_account_transactions"
  end
  # verify the required parameter 'end_date' is set
  if @api_client.config.client_side_validation && end_date.nil?
    fail ArgumentError, "Missing the required parameter 'end_date' when calling ExternalAccountsApi.get_external_account_transactions"
  end
  # resource path
  local_var_path = '/external_accounts/{external_account_id}/transactions'.sub('{' + 'external_account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_date'] = start_date
  query_params[:'end_date'] = end_date

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccountsTransactionList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.get_external_account_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#get_external_account_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_external_account_with_http_info(external_account_id, opts = {}) ⇒ Array<(ExternalAccount, Integer, Hash)>

Get an external account Returns an external account, given an external account ID.

Parameters:

  • external_account_id (String)

    External Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ExternalAccount, Integer, Hash)>)

    ExternalAccount data, response status code and response headers



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 380

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.get_external_account ...'
  end
  # verify the required parameter 'external_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_id' when calling ExternalAccountsApi.get_external_account"
  end
  # resource path
  local_var_path = '/external_accounts/{external_account_id}'.sub('{' + 'external_account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.get_external_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#get_external_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_external_accounts(opts = {}) ⇒ ExternalAccountsList

List external accounts Returns a list of all external accounts assigned to customers.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :customer_id (Array<String>)

    A list of customer unique identifiers, with a comma separating any values.

  • :business_id (Array<String>)

    A list of business unique identifiers, with a comma separating any values.

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :include_history (Boolean)

    If true, include old (inactive) records as well. (default to false)

Returns:



584
585
586
587
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 584

def list_external_accounts(opts = {})
  data, _status_code, _headers = list_external_accounts_with_http_info(opts)
  data
end

#list_external_accounts_with_http_info(opts = {}) ⇒ Array<(ExternalAccountsList, Integer, Hash)>

List external accounts Returns a list of all external accounts assigned to customers.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :customer_id (Array<String>)

    A list of customer unique identifiers, with a comma separating any values.

  • :business_id (Array<String>)

    A list of business unique identifiers, with a comma separating any values.

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :include_history (Boolean)

    If true, include old (inactive) records as well. (default to false)

Returns:

  • (Array<(ExternalAccountsList, Integer, Hash)>)

    ExternalAccountsList data, response status code and response headers



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 598

def list_external_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.list_external_accounts ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ExternalAccountsApi.list_external_accounts, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/external_accounts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'customer_id'] = @api_client.build_collection_param(opts[:'customer_id'], :csv) if !opts[:'customer_id'].nil?
  query_params[:'business_id'] = @api_client.build_collection_param(opts[:'business_id'], :csv) if !opts[:'business_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccountsList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.list_external_accounts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#list_external_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sync_vendor_external_accounts(add_vendor_accounts_request, opts = {}) ⇒ AddVendorAccountsResponse

Sync external accounts through a vendor, such as Plaid. Sync external accounts for a customer through an existing access token. The token must be valid, and the information on the accounts returned by the vendor must correspond to the customer. A success response for this route may include failures if an account could not be added and deletions if the account is removed by the end user, so it’s important that the caller checks the response body.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



657
658
659
660
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 657

def sync_vendor_external_accounts(add_vendor_accounts_request, opts = {})
  data, _status_code, _headers = sync_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts)
  data
end

#sync_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts = {}) ⇒ Array<(AddVendorAccountsResponse, Integer, Hash)>

Sync external accounts through a vendor, such as Plaid. Sync external accounts for a customer through an existing access token. The token must be valid, and the information on the accounts returned by the vendor must correspond to the customer. A success response for this route may include failures if an account could not be added and deletions if the account is removed by the end user, so it&#39;s important that the caller checks the response body.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(AddVendorAccountsResponse, Integer, Hash)>)

    AddVendorAccountsResponse data, response status code and response headers



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 668

def sync_vendor_external_accounts_with_http_info(add_vendor_accounts_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.sync_vendor_external_accounts ...'
  end
  # verify the required parameter 'add_vendor_accounts_request' is set
  if @api_client.config.client_side_validation && add_vendor_accounts_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_vendor_accounts_request' when calling ExternalAccountsApi.sync_vendor_external_accounts"
  end
  # resource path
  local_var_path = '/external_accounts/sync_vendor_accounts'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_vendor_accounts_request)

  # return_type
  return_type = opts[:debug_return_type] || 'AddVendorAccountsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.sync_vendor_external_accounts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#sync_vendor_external_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_external_account(external_account_id, patch_external_account, opts = {}) ⇒ ExternalAccount

Patch an external account Edits an unverified external account, given an external account ID.

Parameters:

  • external_account_id (String)

    External Account ID

  • patch_external_account (PatchExternalAccount)

    External account to be updated

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:



729
730
731
732
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 729

def (, , opts = {})
  data, _status_code, _headers = (, , opts)
  data
end

#update_external_account_with_http_info(external_account_id, patch_external_account, opts = {}) ⇒ Array<(ExternalAccount, Integer, Hash)>

Patch an external account Edits an unverified external account, given an external account ID.

Parameters:

  • external_account_id (String)

    External Account ID

  • patch_external_account (PatchExternalAccount)

    External account to be updated

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

Returns:

  • (Array<(ExternalAccount, Integer, Hash)>)

    ExternalAccount data, response status code and response headers



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
# File 'lib/synctera_ruby_sdk/api/external_accounts_api.rb', line 741

def (, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExternalAccountsApi.update_external_account ...'
  end
  # verify the required parameter 'external_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'external_account_id' when calling ExternalAccountsApi.update_external_account"
  end
  # verify the required parameter 'patch_external_account' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'patch_external_account' when calling ExternalAccountsApi.update_external_account"
  end
  # resource path
  local_var_path = '/external_accounts/{external_account_id}'.sub('{' + 'external_account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body()

  # return_type
  return_type = opts[:debug_return_type] || 'ExternalAccount'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"ExternalAccountsApi.update_external_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExternalAccountsApi#update_external_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end