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.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

#create_transaction(plan_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:

  • plan_id (String)

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

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



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

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

#create_transaction_with_http_info(plan_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:

  • plan_id (String)

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

  • 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



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

def create_transaction_with_http_info(plan_id, data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.create_transaction ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse

Delete a transaction Deletes a transaction

Parameters:

  • plan_id (String)

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

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:



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

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

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

Delete a transaction Deletes a transaction

Parameters:

  • plan_id (String)

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

  • 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



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

def delete_transaction_with_http_info(plan_id, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.delete_transaction ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, transaction_id, opts = {}) ⇒ TransactionResponse

Get a transaction Returns a single transaction

Parameters:

  • plan_id (String)

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

  • transaction_id (String)

    The id of the transaction

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

    the optional parameters

Returns:



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

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

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

Get a transaction Returns a single transaction

Parameters:

  • plan_id (String)

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

  • 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



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

def get_transaction_by_id_with_http_info(plan_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 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, opts = {}) ⇒ TransactionsResponse

Get all transactions Returns plan transactions, excluding any pending transactions

Parameters:

  • plan_id (String)

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

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



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

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

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

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

Parameters:

  • plan_id (String)

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

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



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

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

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

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

Parameters:

  • plan_id (String)

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

  • 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



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

def (plan_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsApi.get_transactions_by_account ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/accounts/{account_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, category_id, opts = {}) ⇒ HybridTransactionsResponse

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

Parameters:

  • plan_id (String)

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

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



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

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

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

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

Parameters:

  • plan_id (String)

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

  • 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



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

def get_transactions_by_category_with_http_info(plan_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 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/categories/{category_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, month, opts = {}) ⇒ TransactionsResponse

Get all plan month transactions Returns all transactions for a specified month, excluding any pending transactions

Parameters:

  • plan_id (String)

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

  • month (String)

    The plan 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:



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

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

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

Get all plan month transactions Returns all transactions for a specified month, excluding any pending transactions

Parameters:

  • plan_id (String)

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

  • month (String)

    The plan 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<(TransactionsResponse, Integer, Hash)>)

    TransactionsResponse data, response status code and response headers



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

def get_transactions_by_month_with_http_info(plan_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 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/months/{month}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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] || 'TransactionsResponse'

  # 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(plan_id, payee_id, opts = {}) ⇒ HybridTransactionsResponse

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

Parameters:

  • plan_id (String)

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

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



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

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

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

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

Parameters:

  • plan_id (String)

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

  • 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



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

def get_transactions_by_payee_with_http_info(plan_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 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/payees/{payee_id}/transactions'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, opts = {}) ⇒ Array<(TransactionsResponse, Integer, Hash)>

Get all transactions Returns plan transactions, excluding any pending transactions

Parameters:

  • plan_id (String)

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

  • 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



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

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

Import transactions Imports available transactions on all linked accounts for the given plan. 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:

  • plan_id (String)

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

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

    the optional parameters

Returns:



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

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

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

Import transactions Imports available transactions on all linked accounts for the given plan. 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:

  • plan_id (String)

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

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

    the optional parameters

Returns:

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

    TransactionsImportResponse data, response status code and response headers



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

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

Update a transaction Updates a single transaction

Parameters:

  • plan_id (String)

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

  • transaction_id (String)

    The id of the transaction

  • data (PutTransactionWrapper)

    The transaction to update

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

    the optional parameters

Returns:



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

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

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

Update a transaction Updates a single transaction

Parameters:

  • plan_id (String)

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

  • 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



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

def update_transaction_with_http_info(plan_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 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_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 = '/plans/{plan_id}/transactions/{transaction_id}'.sub('{' + 'plan_id' + '}', CGI.escape(plan_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(plan_id, data, opts = {}) ⇒ SaveTransactionsResponse

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

Parameters:

  • plan_id (String)

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

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



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

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

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

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

Parameters:

  • plan_id (String)

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

  • 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



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

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