Class: YNAB::TransactionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ynab/api/transactions_api.rb

Direct Known Subclasses

Overrides::TransactionsApi

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TransactionsApi

Returns a new instance of TransactionsApi.



16
17
18
# File 'lib/ynab/api/transactions_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/ynab/api/transactions_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#create_transaction(budget_id, data, opts = {}) ⇒ SaveTransactionsResponse

Create a single transaction or multiple transactions Creates a single transaction or multiple transactions. If you provide a body containing a ‘transaction` object, a single transaction will be created and if you provide a body containing a `transactions` array, multiple transactions will be created. Scheduled transactions (transactions with a future date) cannot be created on this endpoint.

Parameters:

  • budget_id (String)

    The id of the budget. "last-used" can be used to specify the last used budget and "default" can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • data (PostTransactionsWrapper)

    The transaction or transactions to create. To create a single transaction you can specify a value for the `transaction` object and to create multiple transactions you can specify an array of `transactions`. It is expected that you will only provide a value for one of these objects.

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

    the optional parameters

Returns:



25
26
27
28
# File 'lib/ynab/api/transactions_api.rb', line 25

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

#create_transaction_with_http_info(budget_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>

Create a single transaction or multiple transactions Creates a single transaction or multiple transactions. If you provide a body containing a &#x60;transaction&#x60; object, a single transaction will be created and if you provide a body containing a &#x60;transactions&#x60; array, multiple transactions will be created. Scheduled transactions (transactions with a future date) cannot be created on this endpoint.

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • data (PostTransactionsWrapper)

    The transaction or transactions to create. To create a single transaction you can specify a value for the &#x60;transaction&#x60; object and to create multiple transactions you can specify an array of &#x60;transactions&#x60;. It is expected that you will only provide a value for one of these objects.

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

    the optional parameters

Returns:

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

    SaveTransactionsResponse data, response status code and response headers



36
37
38
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/ynab/api/transactions_api.rb', line 36

def create_transaction_with_http_info(budget_id, data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.create_transaction ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.create_transaction"
  end
  # verify the required parameter 'data' is set
  if @api_client.config.client_side_validation && data.nil?
    fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.create_transaction"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.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'])
  # 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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.create_transaction",
    :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: TransactionsApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_transaction(budget_id, transaction_id, opts = {}) ⇒ TransactionResponse

Deletes an existing transaction Deletes a transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:



99
100
101
102
# File 'lib/ynab/api/transactions_api.rb', line 99

def delete_transaction(budget_id, transaction_id, opts = {})
  data, _status_code, _headers = delete_transaction_with_http_info(budget_id, transaction_id, opts)
  data
end

#delete_transaction_with_http_info(budget_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>

Deletes an existing transaction Deletes a transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:

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

    TransactionResponse 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
# File 'lib/ynab/api/transactions_api.rb', line 110

def delete_transaction_with_http_info(budget_id, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.delete_transaction ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.delete_transaction"
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.delete_transaction"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.delete_transaction",
    :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: TransactionsApi#delete_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transaction_by_id(budget_id, transaction_id, opts = {}) ⇒ TransactionResponse

Single transaction Returns a single transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:



168
169
170
171
# File 'lib/ynab/api/transactions_api.rb', line 168

def get_transaction_by_id(budget_id, transaction_id, opts = {})
  data, _status_code, _headers = get_transaction_by_id_with_http_info(budget_id, transaction_id, opts)
  data
end

#get_transaction_by_id_with_http_info(budget_id, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>

Single transaction Returns a single transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:

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

    TransactionResponse 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
# File 'lib/ynab/api/transactions_api.rb', line 179

def get_transaction_by_id_with_http_info(budget_id, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction_by_id ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transaction_by_id"
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.get_transaction_by_id"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_transaction_by_id",
    :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: TransactionsApi#get_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions(budget_id, opts = {}) ⇒ TransactionsResponse

List transactions Returns budget transactions, excluding any pending transactions

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:



239
240
241
242
# File 'lib/ynab/api/transactions_api.rb', line 239

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

#get_transactions_by_account(budget_id, account_id, opts = {}) ⇒ TransactionsResponse

List account transactions Returns all transactions for a specified account, excluding any pending transactions

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • account_id (String)

    The id of the account

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:



312
313
314
315
# File 'lib/ynab/api/transactions_api.rb', line 312

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

#get_transactions_by_account_with_http_info(budget_id, account_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>

List account transactions Returns all transactions for a specified account, excluding any pending transactions

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • account_id (String)

    The id of the account

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:

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

    TransactionsResponse data, response status code and response headers



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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/ynab/api/transactions_api.rb', line 326

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

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_transactions_by_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: TransactionsApi#get_transactions_by_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions_by_category(budget_id, category_id, opts = {}) ⇒ HybridTransactionsResponse

List category transactions, excluding any pending transactions Returns all transactions for a specified category

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • category_id (String)

    The id of the category

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:



390
391
392
393
# File 'lib/ynab/api/transactions_api.rb', line 390

def get_transactions_by_category(budget_id, category_id, opts = {})
  data, _status_code, _headers = get_transactions_by_category_with_http_info(budget_id, category_id, opts)
  data
end

#get_transactions_by_category_with_http_info(budget_id, category_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>

List category transactions, excluding any pending transactions Returns all transactions for a specified category

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • category_id (String)

    The id of the category

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:

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

    HybridTransactionsResponse data, response status code and response headers



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/ynab/api/transactions_api.rb', line 404

def get_transactions_by_category_with_http_info(budget_id, category_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_category ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transactions_by_category"
  end
  # verify the required parameter 'category_id' is set
  if @api_client.config.client_side_validation && category_id.nil?
    fail ArgumentError, "Missing the required parameter 'category_id' when calling TransactionsApi.get_transactions_by_category"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/categories/{category_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_transactions_by_category",
    :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: TransactionsApi#get_transactions_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions_by_month(budget_id, month, opts = {}) ⇒ HybridTransactionsResponse

List transactions in month, excluding any pending transactions Returns all transactions for a specified month

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • month (String)

    The budget month in ISO format (e.g. 2016-12-01) (&quot;current&quot; can also be used to specify the current calendar month (UTC))

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:



468
469
470
471
# File 'lib/ynab/api/transactions_api.rb', line 468

def get_transactions_by_month(budget_id, month, opts = {})
  data, _status_code, _headers = get_transactions_by_month_with_http_info(budget_id, month, opts)
  data
end

#get_transactions_by_month_with_http_info(budget_id, month, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>

List transactions in month, excluding any pending transactions Returns all transactions for a specified month

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • month (String)

    The budget month in ISO format (e.g. 2016-12-01) (&quot;current&quot; can also be used to specify the current calendar month (UTC))

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:

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

    HybridTransactionsResponse data, response status code and response headers



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/ynab/api/transactions_api.rb', line 482

def get_transactions_by_month_with_http_info(budget_id, month, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_month ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transactions_by_month"
  end
  # verify the required parameter 'month' is set
  if @api_client.config.client_side_validation && month.nil?
    fail ArgumentError, "Missing the required parameter 'month' when calling TransactionsApi.get_transactions_by_month"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/months/{month}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'month' + '}', CGI.escape(month.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_transactions_by_month",
    :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: TransactionsApi#get_transactions_by_month\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions_by_payee(budget_id, payee_id, opts = {}) ⇒ HybridTransactionsResponse

List payee transactions, excluding any pending transactions Returns all transactions for a specified payee

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • payee_id (String)

    The id of the payee

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:



546
547
548
549
# File 'lib/ynab/api/transactions_api.rb', line 546

def get_transactions_by_payee(budget_id, payee_id, opts = {})
  data, _status_code, _headers = get_transactions_by_payee_with_http_info(budget_id, payee_id, opts)
  data
end

#get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {}) ⇒ Array<(HybridTransactionsResponse, Integer, Hash)>

List payee transactions, excluding any pending transactions Returns all transactions for a specified payee

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • payee_id (String)

    The id of the payee

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:

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

    HybridTransactionsResponse data, response status code and response headers



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/ynab/api/transactions_api.rb', line 560

def get_transactions_by_payee_with_http_info(budget_id, payee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_payee ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.get_transactions_by_payee"
  end
  # verify the required parameter 'payee_id' is set
  if @api_client.config.client_side_validation && payee_id.nil?
    fail ArgumentError, "Missing the required parameter 'payee_id' when calling TransactionsApi.get_transactions_by_payee"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/payees/{payee_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'payee_id' + '}', CGI.escape(payee_id.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_transactions_by_payee",
    :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: TransactionsApi#get_transactions_by_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions_with_http_info(budget_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>

List transactions Returns budget transactions, excluding any pending transactions

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

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

    the optional parameters

Options Hash (opts):

  • :since_date (Date)

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

  • :type (String)

    If specified, only transactions of the specified type will be included. &quot;uncategorized&quot; and &quot;unapproved&quot; are currently supported.

  • :last_knowledge_of_server (Integer)

    The starting server knowledge. If provided, only entities that have changed since &#x60;last_knowledge_of_server&#x60; will be included.

Returns:

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

    TransactionsResponse data, response status code and response headers



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
301
# File 'lib/ynab/api/transactions_api.rb', line 252

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

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.get_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: TransactionsApi#get_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_transactions(budget_id, opts = {}) ⇒ TransactionsImportResponse

Import transactions Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking "Import" on each account in the web application or tapping the "New Transactions" banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

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

    the optional parameters

Returns:



620
621
622
623
# File 'lib/ynab/api/transactions_api.rb', line 620

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

#import_transactions_with_http_info(budget_id, opts = {}) ⇒ Array<(TransactionsImportResponse, Integer, Hash)>

Import transactions Imports available transactions on all linked accounts for the given budget. Linked accounts allow transactions to be imported directly from a specified financial institution and this endpoint initiates that import. Sending a request to this endpoint is the equivalent of clicking &quot;Import&quot; on each account in the web application or tapping the &quot;New Transactions&quot; banner in the mobile applications. The response for this endpoint contains the transaction ids that have been imported.

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

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

    the optional parameters

Returns:

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

    TransactionsImportResponse data, response status code and response headers



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/ynab/api/transactions_api.rb', line 630

def import_transactions_with_http_info(budget_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.import_transactions ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.import_transactions"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions/import'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.import_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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionsApi#import_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_transaction(budget_id, transaction_id, data, opts = {}) ⇒ TransactionResponse

Updates an existing transaction Updates a single transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

  • data (PutTransactionWrapper)

    The transaction to update

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

    the optional parameters

Returns:



685
686
687
688
# File 'lib/ynab/api/transactions_api.rb', line 685

def update_transaction(budget_id, transaction_id, data, opts = {})
  data, _status_code, _headers = update_transaction_with_http_info(budget_id, transaction_id, data, opts)
  data
end

#update_transaction_with_http_info(budget_id, transaction_id, data, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>

Updates an existing transaction Updates a single transaction

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • transaction_id (String)

    The id of the transaction

  • data (PutTransactionWrapper)

    The transaction to update

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

    the optional parameters

Returns:

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

    TransactionResponse data, response status code and response headers



697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# File 'lib/ynab/api/transactions_api.rb', line 697

def update_transaction_with_http_info(budget_id, transaction_id, data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transaction ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.update_transaction"
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling TransactionsApi.update_transaction"
  end
  # verify the required parameter 'data' is set
  if @api_client.config.client_side_validation && data.nil?
    fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transaction"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions/{transaction_id}'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.to_s)).sub('{' + 'transaction_id' + '}', CGI.escape(transaction_id.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'])
  # 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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.update_transaction",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionsApi#update_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_transactions(budget_id, data, opts = {}) ⇒ SaveTransactionsResponse

Update multiple transactions Updates multiple transactions, by ‘id` or `import_id`.

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • data (PatchTransactionsWrapper)

    The transactions to update. Each transaction must have either an &#x60;id&#x60; or &#x60;import_id&#x60; specified. If &#x60;id&#x60; is specified as null an &#x60;import_id&#x60; value can be provided which will allow transaction(s) to be updated by its &#x60;import_id&#x60;. If an &#x60;id&#x60; is specified, it will always be used for lookup. You should not specify both &#x60;id&#x60; and &#x60;import_id&#x60;. Updating an &#x60;import_id&#x60; on an existing transaction is not allowed; if an &#x60;import_id&#x60; is specified, it will only be used to lookup the transaction.

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

    the optional parameters

Returns:



764
765
766
767
# File 'lib/ynab/api/transactions_api.rb', line 764

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

#update_transactions_with_http_info(budget_id, data, opts = {}) ⇒ Array<(SaveTransactionsResponse, Integer, Hash)>

Update multiple transactions Updates multiple transactions, by &#x60;id&#x60; or &#x60;import_id&#x60;.

Parameters:

  • budget_id (String)

    The id of the budget. &quot;last-used&quot; can be used to specify the last used budget and &quot;default&quot; can be used if default budget selection is enabled (see: api.ynab.com/#oauth-default-budget).

  • data (PatchTransactionsWrapper)

    The transactions to update. Each transaction must have either an &#x60;id&#x60; or &#x60;import_id&#x60; specified. If &#x60;id&#x60; is specified as null an &#x60;import_id&#x60; value can be provided which will allow transaction(s) to be updated by its &#x60;import_id&#x60;. If an &#x60;id&#x60; is specified, it will always be used for lookup. You should not specify both &#x60;id&#x60; and &#x60;import_id&#x60;. Updating an &#x60;import_id&#x60; on an existing transaction is not allowed; if an &#x60;import_id&#x60; is specified, it will only be used to lookup the transaction.

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

    the optional parameters

Returns:

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

    SaveTransactionsResponse data, response status code and response headers



775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
# File 'lib/ynab/api/transactions_api.rb', line 775

def update_transactions_with_http_info(budget_id, data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.update_transactions ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling TransactionsApi.update_transactions"
  end
  # verify the required parameter 'data' is set
  if @api_client.config.client_side_validation && data.nil?
    fail ArgumentError, "Missing the required parameter 'data' when calling TransactionsApi.update_transactions"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/transactions'.sub('{' + 'budget_id' + '}', CGI.escape(budget_id.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'])
  # 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

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

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

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

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

  new_options = opts.merge(
    :operation => :"TransactionsApi.update_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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionsApi#update_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end