Class: BillForward::InvoicesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/api/invoices_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InvoicesApi

Returns a new instance of InvoicesApi.



30
31
32
# File 'lib/bf_ruby2/api/invoices_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/bf_ruby2/api/invoices_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#add_charge_to_invoice(invoice_id, charge, opts = {}) ⇒ SubscriptionChargePagedMetadata

Creates a charge on the specified invoice. to invoice","response":"addChargeToInvoice.html","request":"addChargeToInvoiceRequest.html"

Parameters:

  • invoice_id

    ID of the invoice.

  • charge

    The charge request

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

    the optional parameters

Returns:



40
41
42
43
# File 'lib/bf_ruby2/api/invoices_api.rb', line 40

def add_charge_to_invoice(invoice_id, charge, opts = {})
  data, _status_code, _headers = add_charge_to_invoice_with_http_info(invoice_id, charge, opts)
  return data
end

#add_charge_to_invoice_with_http_info(invoice_id, charge, opts = {}) ⇒ Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>

Creates a charge on the specified invoice. to invoice&quot;,&quot;response&quot;:&quot;addChargeToInvoice.html&quot;,&quot;request&quot;:&quot;addChargeToInvoiceRequest.html&quot;

Parameters:

  • invoice_id

    ID of the invoice.

  • charge

    The charge request

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

    the optional parameters

Returns:



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
92
93
# File 'lib/bf_ruby2/api/invoices_api.rb', line 51

def add_charge_to_invoice_with_http_info(invoice_id, charge, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.add_charge_to_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.add_charge_to_invoice" if invoice_id.nil?
  # verify the required parameter 'charge' is set
  fail ArgumentError, "Missing the required parameter 'charge' when calling InvoicesApi.add_charge_to_invoice" if charge.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/charges".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(charge)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionChargePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#add_charge_to_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#aggregate_invoices(request, opts = {}) ⇒ InvoicePagedMetadata

Aggregate Invoices into to one parent Invoice invoices","response":"AggregateResponse.html","request":"AggregateRequest.html"

Parameters:

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

    the optional parameters

Returns:



100
101
102
103
# File 'lib/bf_ruby2/api/invoices_api.rb', line 100

def aggregate_invoices(request, opts = {})
  data, _status_code, _headers = aggregate_invoices_with_http_info(request, opts)
  return data
end

#aggregate_invoices_with_http_info(request, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Aggregate Invoices into to one parent Invoice invoices&quot;,&quot;response&quot;:&quot;AggregateResponse.html&quot;,&quot;request&quot;:&quot;AggregateRequest.html&quot;

Parameters:

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata 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
# File 'lib/bf_ruby2/api/invoices_api.rb', line 110

def aggregate_invoices_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.aggregate_invoices ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling InvoicesApi.aggregate_invoices" if request.nil?
  # resource path
  local_var_path = "/invoices/aggregate".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#aggregate_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#execute_invoice(invoice_id, request, opts = {}) ⇒ InvoicePagedMetadata

Attempt payment for the outstanding value of an invoice invoice","response":"executeInvoiceResponse.html","request":"ExecuteInvoiceRequest.html"

Parameters:

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

    the optional parameters

Returns:



158
159
160
161
# File 'lib/bf_ruby2/api/invoices_api.rb', line 158

def execute_invoice(invoice_id, request, opts = {})
  data, _status_code, _headers = execute_invoice_with_http_info(invoice_id, request, opts)
  return data
end

#execute_invoice_with_http_info(invoice_id, request, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Attempt payment for the outstanding value of an invoice invoice&quot;,&quot;response&quot;:&quot;executeInvoiceResponse.html&quot;,&quot;request&quot;:&quot;ExecuteInvoiceRequest.html&quot;

Parameters:

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



169
170
171
172
173
174
175
176
177
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
# File 'lib/bf_ruby2/api/invoices_api.rb', line 169

def execute_invoice_with_http_info(invoice_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.execute_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.execute_invoice" if invoice_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling InvoicesApi.execute_invoice" if request.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/execute".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#execute_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_line_payments_for_all_invoices(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Generates InvoiceLinePayments for all existing InvoicePayments. { "nickname" : "Generate InvoiceLinePayments","response" : "Generate InvoiceLinePayments.html"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



218
219
220
221
# File 'lib/bf_ruby2/api/invoices_api.rb', line 218

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

#generate_line_payments_for_all_invoices_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Generates InvoiceLinePayments for all existing InvoicePayments. { &quot;nickname&quot; : &quot;Generate InvoiceLinePayments&quot;,&quot;response&quot; : &quot;Generate InvoiceLinePayments.html&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/bf_ruby2/api/invoices_api.rb', line 228

def generate_line_payments_for_all_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.generate_line_payments_for_all_invoices ..."
  end
  # resource path
  local_var_path = "/invoices/generate-line-payments".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#generate_line_payments_for_all_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_invoices(opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of all invoices. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve all invoices","response" : "getInvoiceAll.html"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded. (default to true)

  • :metadata (String)

Returns:



281
282
283
284
# File 'lib/bf_ruby2/api/invoices_api.rb', line 281

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

#get_all_invoices_as_csv(opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of all invoices. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve all invoices","response" : "getInvoiceAll.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



359
360
361
362
# File 'lib/bf_ruby2/api/invoices_api.rb', line 359

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

#get_all_invoices_as_csv_with_http_info(opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of all invoices. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve all invoices&quot;,&quot;response&quot; : &quot;getInvoiceAll.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/bf_ruby2/api/invoices_api.rb', line 374

def get_all_invoices_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_all_invoices_as_csv ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/all.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_all_invoices_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_invoices_with_http_info(opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of all invoices. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve all invoices&quot;,&quot;response&quot; : &quot;getInvoiceAll.html&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded.

  • :metadata (String)

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/bf_ruby2/api/invoices_api.rb', line 298

def get_all_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_all_invoices ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?
  query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_all_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bucketed_revenue_attributions_as_csv(opts = {}) ⇒ String

Retrieves (as CSV) all attributions of Invoice costs to Invoice lines, bucketed. { "nickname" : "(CSV) Retrieve bucketed revenue attributions","response" : "getBucketedRevenueAttributions.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:

  • (String)


430
431
432
433
# File 'lib/bf_ruby2/api/invoices_api.rb', line 430

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

#get_bucketed_revenue_attributions_as_csv_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Retrieves (as CSV) all attributions of Invoice costs to Invoice lines, bucketed. { &quot;nickname&quot; : &quot;(CSV) Retrieve bucketed revenue attributions&quot;,&quot;response&quot; : &quot;getBucketedRevenueAttributions.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/bf_ruby2/api/invoices_api.rb', line 442

def get_bucketed_revenue_attributions_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_bucketed_revenue_attributions_as_csv ..."
  end
  # resource path
  local_var_path = "/invoices/bucketed-revenue-attributions.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_bucketed_revenue_attributions_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_charges_on_invoice(invoice_id, opts = {}) ⇒ SubscriptionChargePagedMetadata

Returns all charges for the specified invoice. By default 10 values are returned. Records are returned in natural order. on invoice","response":"getChargesInvoice.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return. (default to 0)

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to id)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :state (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :type (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



498
499
500
501
# File 'lib/bf_ruby2/api/invoices_api.rb', line 498

def get_charges_on_invoice(invoice_id, opts = {})
  data, _status_code, _headers = get_charges_on_invoice_with_http_info(invoice_id, opts)
  return data
end

#get_charges_on_invoice_with_http_info(invoice_id, opts = {}) ⇒ Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>

Returns all charges for the specified invoice. By default 10 values are returned. Records are returned in natural order. on invoice&quot;,&quot;response&quot;:&quot;getChargesInvoice.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :state (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :type (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:



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

def get_charges_on_invoice_with_http_info(invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_charges_on_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.get_charges_on_invoice" if invoice_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'state'] && !['Voided', 'Pending', 'AwaitingPayment', 'Paid', 'Failed'].include?(opts[:'state'])
    fail ArgumentError, 'invalid value for "state", must be one of Voided, Pending, AwaitingPayment, Paid, Failed'
  end
  if opts[:'type'] && !['Setup', 'Upgrade', 'Manual', 'ProductRatePlanMigration', 'Arrears', 'Advance', 'Coupon', 'Usage', 'PricingComponent'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of Setup, Upgrade, Manual, ProductRatePlanMigration, Arrears, Advance, Coupon, Usage, PricingComponent'
  end
  # resource path
  local_var_path = "/invoices/{invoice-ID}/charges".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionChargePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_charges_on_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_invoice_line_payments_from_invoices_as_csv(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves credit note-paid from InvoicePayments upon line items, in CSV format. { "nickname" : "Credit InvoiceLinePayments CSV","response" : "Credit InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which credit payments will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which credit payments will be recognised (example input: 2015-10-13T11:50:24).

Returns:



582
583
584
585
# File 'lib/bf_ruby2/api/invoices_api.rb', line 582

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

#get_credit_invoice_line_payments_from_invoices_as_csv_by_payment_received(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves credit note-paid from InvoicePayments upon line items, in CSV format. { "nickname" : "Credit InvoiceLinePayments CSV","response" : "Credit InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which credit payments will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which credit payments will be recognised (example input: 2015-10-13T11:50:24).

Returns:



644
645
646
647
# File 'lib/bf_ruby2/api/invoices_api.rb', line 644

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

#get_credit_invoice_line_payments_from_invoices_as_csv_by_payment_received_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves credit note-paid from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Credit InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Credit InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which credit payments will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which credit payments will be recognised (example input: 2015-10-13T11:50:24).

Returns:



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/bf_ruby2/api/invoices_api.rb', line 656

def get_credit_invoice_line_payments_from_invoices_as_csv_by_payment_received_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_credit_invoice_line_payments_from_invoices_as_csv_by_payment_received ..."
  end
  # resource path
  local_var_path = "/invoices/payment-received/credit.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_credit_invoice_line_payments_from_invoices_as_csv_by_payment_received\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves credit note-paid from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Credit InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Credit InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which credit payments will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which credit payments will be recognised (example input: 2015-10-13T11:50:24).

Returns:



594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
# File 'lib/bf_ruby2/api/invoices_api.rb', line 594

def get_credit_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_credit_invoice_line_payments_from_invoices_as_csv ..."
  end
  # resource path
  local_var_path = "/invoices/credit.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_credit_invoice_line_payments_from_invoices_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_debit_invoice_line_payments_from_invoices_as_csv(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves received revenue from InvoicePayments upon line items, in CSV format. { "nickname" : "Debit InvoiceLinePayments CSV","response" : "Debit InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue will be recognised (example input: 2015-10-13T11:50:24).

Returns:



706
707
708
709
# File 'lib/bf_ruby2/api/invoices_api.rb', line 706

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

#get_debit_invoice_line_payments_from_invoices_as_csv_by_payment_received(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves received revenue from InvoicePayments upon line items, in CSV format. { "nickname" : "Debit InvoiceLinePayments CSV","response" : "Debit InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue will be recognised (example input: 2015-10-13T11:50:24).

Returns:



768
769
770
771
# File 'lib/bf_ruby2/api/invoices_api.rb', line 768

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

#get_debit_invoice_line_payments_from_invoices_as_csv_by_payment_received_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves received revenue from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Debit InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Debit InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue will be recognised (example input: 2015-10-13T11:50:24).

Returns:



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
# File 'lib/bf_ruby2/api/invoices_api.rb', line 780

def get_debit_invoice_line_payments_from_invoices_as_csv_by_payment_received_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_debit_invoice_line_payments_from_invoices_as_csv_by_payment_received ..."
  end
  # resource path
  local_var_path = "/invoices/payment-received/revenue.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_debit_invoice_line_payments_from_invoices_as_csv_by_payment_received\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_debit_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves received revenue from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Debit InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Debit InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue will be recognised (example input: 2015-10-13T11:50:24).

Returns:



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
757
758
759
# File 'lib/bf_ruby2/api/invoices_api.rb', line 718

def get_debit_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_debit_invoice_line_payments_from_invoices_as_csv ..."
  end
  # resource path
  local_var_path = "/invoices/revenue.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_debit_invoice_line_payments_from_invoices_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_as_html(id, opts = {}) ⇒ String

Retrieves a single invoice specified by the ID parameter. { "nickname" : "HTML invoice","response" : "getInvoiceByID.HTML.html"}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :tier_breakdown (BOOLEAN)

    Whether to provide a breakdown of charge tiering. (default to false)

  • :inclusive_end (BOOLEAN)

    Whether to present in the Invoice date range only those dates whose entirety are involved in the billing period. In other words: when true, this subtracts 1 from the &quot;period end&quot; date shown to the customer. (default to false)

  • :show_zero_cost (BOOLEAN)

    Whether to show zero-cost lines. (default to true)

  • :show_plan_only_when_ambiguous (BOOLEAN)

    Whether to state which plan the Invoice lines came from, regardless of whether there&#39;s only one plan involved in this Invoice. (default to true)

Returns:

  • (String)


838
839
840
841
# File 'lib/bf_ruby2/api/invoices_api.rb', line 838

def get_invoice_as_html(id, opts = {})
  data, _status_code, _headers = get_invoice_as_html_with_http_info(id, opts)
  return data
end

#get_invoice_as_html_with_http_info(id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Retrieves a single invoice specified by the ID parameter. { &quot;nickname&quot; : &quot;HTML invoice&quot;,&quot;response&quot; : &quot;getInvoiceByID.HTML.html&quot;}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :tier_breakdown (BOOLEAN)

    Whether to provide a breakdown of charge tiering.

  • :inclusive_end (BOOLEAN)

    Whether to present in the Invoice date range only those dates whose entirety are involved in the billing period. In other words: when true, this subtracts 1 from the &quot;period end&quot; date shown to the customer.

  • :show_zero_cost (BOOLEAN)

    Whether to show zero-cost lines.

  • :show_plan_only_when_ambiguous (BOOLEAN)

    Whether to state which plan the Invoice lines came from, regardless of whether there&#39;s only one plan involved in this Invoice.

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
# File 'lib/bf_ruby2/api/invoices_api.rb', line 858

def get_invoice_as_html_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_as_html ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling InvoicesApi.get_invoice_as_html" if id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/{ID}.html".sub('{format}','json').sub('{' + 'ID' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'tier_breakdown'] = opts[:'tier_breakdown'] if !opts[:'tier_breakdown'].nil?
  query_params[:'inclusive_end'] = opts[:'inclusive_end'] if !opts[:'inclusive_end'].nil?
  query_params[:'show_zero_cost'] = opts[:'show_zero_cost'] if !opts[:'show_zero_cost'].nil?
  query_params[:'show_plan_only_when_ambiguous'] = opts[:'show_plan_only_when_ambiguous'] if !opts[:'show_plan_only_when_ambiguous'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/html']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_as_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_as_pdf(id, opts = {}) ⇒ File

Retrieves a single invoice specified by the ID parameter. { "nickname" : "PDF Invoice","response" : "getInvoiceByID.pdf"}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :tier_breakdown (BOOLEAN)

    Whether to provide a breakdown of charge tiering. (default to false)

  • :inclusive_end (BOOLEAN)

    Whether to present in the Invoice date range only those dates whose entirety are involved in the billing period. In other words: when true, this subtracts 1 from the &quot;period end&quot; date shown to the customer. (default to false)

  • :show_zero_cost (BOOLEAN)

    Whether to show zero-cost lines. (default to true)

  • :show_plan_only_when_ambiguous (BOOLEAN)

    Whether to state which plan the Invoice lines came from, regardless of whether there&#39;s only one plan involved in this Invoice. (default to true)

  • :include_footer (BOOLEAN)
  • :group_line_items_by (String)

Returns:

  • (File)


930
931
932
933
# File 'lib/bf_ruby2/api/invoices_api.rb', line 930

def get_invoice_as_pdf(id, opts = {})
  data, _status_code, _headers = get_invoice_as_pdf_with_http_info(id, opts)
  return data
end

#get_invoice_as_pdf_with_http_info(id, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Retrieves a single invoice specified by the ID parameter. { &quot;nickname&quot; : &quot;PDF Invoice&quot;,&quot;response&quot; : &quot;getInvoiceByID.pdf&quot;}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :tier_breakdown (BOOLEAN)

    Whether to provide a breakdown of charge tiering.

  • :inclusive_end (BOOLEAN)

    Whether to present in the Invoice date range only those dates whose entirety are involved in the billing period. In other words: when true, this subtracts 1 from the &quot;period end&quot; date shown to the customer.

  • :show_zero_cost (BOOLEAN)

    Whether to show zero-cost lines.

  • :show_plan_only_when_ambiguous (BOOLEAN)

    Whether to state which plan the Invoice lines came from, regardless of whether there&#39;s only one plan involved in this Invoice.

  • :include_footer (BOOLEAN)
  • :group_line_items_by (String)

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
# File 'lib/bf_ruby2/api/invoices_api.rb', line 952

def get_invoice_as_pdf_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_as_pdf ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling InvoicesApi.get_invoice_as_pdf" if id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'group_line_items_by'] && !['Product', 'RatePlan', 'ProductAndRatePlan'].include?(opts[:'group_line_items_by'])
    fail ArgumentError, 'invalid value for "group_line_items_by", must be one of Product, RatePlan, ProductAndRatePlan'
  end
  # resource path
  local_var_path = "/invoices/{ID}.pdf".sub('{format}','json').sub('{' + 'ID' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'tier_breakdown'] = opts[:'tier_breakdown'] if !opts[:'tier_breakdown'].nil?
  query_params[:'inclusive_end'] = opts[:'inclusive_end'] if !opts[:'inclusive_end'].nil?
  query_params[:'show_zero_cost'] = opts[:'show_zero_cost'] if !opts[:'show_zero_cost'].nil?
  query_params[:'show_plan_only_when_ambiguous'] = opts[:'show_plan_only_when_ambiguous'] if !opts[:'show_plan_only_when_ambiguous'].nil?
  query_params[:'include_footer'] = opts[:'include_footer'] if !opts[:'include_footer'].nil?
  query_params[:'group_line_items_by'] = opts[:'group_line_items_by'] if !opts[:'group_line_items_by'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/pdf']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_by_id(invoice_id, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a single invoice specified by the invoice-ID parameter. { "nickname" : "Retrieve an existing invoice","response" : "getInvoiceByID.html"}

Parameters:

  • invoice_id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded. (default to true)

Returns:



1024
1025
1026
1027
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1024

def get_invoice_by_id(invoice_id, opts = {})
  data, _status_code, _headers = get_invoice_by_id_with_http_info(invoice_id, opts)
  return data
end

#get_invoice_by_id_as_csv(id, opts = {}) ⇒ String

Retrieves a single invoice specified by the ID parameter. { "nickname" : "CSV invoice","response" : "getInvoiceByID.csv"}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (String)


1099
1100
1101
1102
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1099

def get_invoice_by_id_as_csv(id, opts = {})
  data, _status_code, _headers = get_invoice_by_id_as_csv_with_http_info(id, opts)
  return data
end

#get_invoice_by_id_as_csv_with_http_info(id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Retrieves a single invoice specified by the ID parameter. { &quot;nickname&quot; : &quot;CSV invoice&quot;,&quot;response&quot; : &quot;getInvoiceByID.csv&quot;}

Parameters:

  • id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1110

def get_invoice_by_id_as_csv_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_by_id_as_csv ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling InvoicesApi.get_invoice_by_id_as_csv" if id.nil?
  # resource path
  local_var_path = "/invoices/{ID}.csv".sub('{format}','json').sub('{' + 'ID' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_by_id_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_by_id_with_http_info(invoice_id, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a single invoice specified by the invoice-ID parameter. { &quot;nickname&quot; : &quot;Retrieve an existing invoice&quot;,&quot;response&quot; : &quot;getInvoiceByID.html&quot;}

Parameters:

  • invoice_id

    The ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1041

def get_invoice_by_id_with_http_info(invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_by_id ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.get_invoice_by_id" if invoice_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/{invoice-ID}".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_by_subscription_id(subscription_id, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoices specified by the subscription-ID parameter. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by subscription","response" : "getInvoiceBySubscriptionID.html"}

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded. (default to true)

Returns:



1165
1166
1167
1168
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1165

def get_invoice_by_subscription_id(subscription_id, opts = {})
  data, _status_code, _headers = get_invoice_by_subscription_id_with_http_info(subscription_id, opts)
  return data
end

#get_invoice_by_subscription_id_with_http_info(subscription_id, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoices specified by the subscription-ID parameter. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by subscription&quot;,&quot;response&quot; : &quot;getInvoiceBySubscriptionID.html&quot;}

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1182

def get_invoice_by_subscription_id_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_by_subscription_id ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling InvoicesApi.get_invoice_by_subscription_id" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/subscription/{subscription-ID}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_by_subscription_version_id(subscription_version_id, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoices specified by the subscription-version-ID parameter. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by subscription version","response" : "getInvoiceBySubscriptionVersionID.html"}

Parameters:

  • subscription_version_id

    Version ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded. (default to true)

Returns:



1246
1247
1248
1249
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1246

def get_invoice_by_subscription_version_id(subscription_version_id, opts = {})
  data, _status_code, _headers = get_invoice_by_subscription_version_id_with_http_info(subscription_version_id, opts)
  return data
end

#get_invoice_by_subscription_version_id_with_http_info(subscription_version_id, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoices specified by the subscription-version-ID parameter. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by subscription version&quot;,&quot;response&quot; : &quot;getInvoiceBySubscriptionVersionID.html&quot;}

Parameters:

  • subscription_version_id

    Version ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1263

def get_invoice_by_subscription_version_id_with_http_info(subscription_version_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_by_subscription_version_id ..."
  end
  # verify the required parameter 'subscription_version_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_version_id' when calling InvoicesApi.get_invoice_by_subscription_version_id" if subscription_version_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/subscription/version/{subscription-version-ID}".sub('{format}','json').sub('{' + 'subscription-version-ID' + '}', subscription_version_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_by_subscription_version_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_by_version_id(version_id, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a single invoice, specified by the version-ID parameter. { "nickname" : "Retrieve by version","response" : "getInvoiceByVersionID.html"}

Parameters:

  • version_id

    The version-ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



1321
1322
1323
1324
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1321

def get_invoice_by_version_id(version_id, opts = {})
  data, _status_code, _headers = get_invoice_by_version_id_with_http_info(version_id, opts)
  return data
end

#get_invoice_by_version_id_with_http_info(version_id, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a single invoice, specified by the version-ID parameter. { &quot;nickname&quot; : &quot;Retrieve by version&quot;,&quot;response&quot; : &quot;getInvoiceByVersionID.html&quot;}

Parameters:

  • version_id

    The version-ID of the invoice.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1332

def get_invoice_by_version_id_with_http_info(version_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoice_by_version_id ..."
  end
  # verify the required parameter 'version_id' is set
  fail ArgumentError, "Missing the required parameter 'version_id' when calling InvoicesApi.get_invoice_by_version_id" if version_id.nil?
  # resource path
  local_var_path = "/invoices/version/{version-ID}".sub('{format}','json').sub('{' + 'version-ID' + '}', version_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8', 'text/xml']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoice_by_version_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_account_id(account_id, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoices specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by account","response" : "getInvoiceByAccountID.html"}

Parameters:

  • account_id

    ID of the account.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return. (default to 0)

  • :records (Integer)

    The maximum number of invoices to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded. (default to true)

Returns:



1387
1388
1389
1390
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1387

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

#get_invoices_by_account_id_with_http_info(account_id, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoices specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by account&quot;,&quot;response&quot; : &quot;getInvoiceByAccountID.html&quot;}

Parameters:

  • account_id

    ID of the account.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first invoice to return.

  • :records (Integer)

    The maximum number of invoices to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

  • :exclude_children (BOOLEAN)

    Should child invoices be excluded.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1404

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_account_id ..."
  end
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling InvoicesApi.get_invoices_by_account_id" if .nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/account/{account-ID}".sub('{format}','json').sub('{' + 'account-ID' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?
  query_params[:'exclude_children'] = opts[:'exclude_children'] if !opts[:'exclude_children'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_period_end(lower_threshold, upper_threshold, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by period-end","response" : "getInvoiceByPeriodEnd.html"}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1468
1469
1470
1471
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1468

def get_invoices_by_period_end(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_invoices_by_period_end_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_invoices_by_period_end_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by period-end&quot;,&quot;response&quot; : &quot;getInvoiceByPeriodEnd.html&quot;}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1485

def get_invoices_by_period_end_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_period_end ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling InvoicesApi.get_invoices_by_period_end" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling InvoicesApi.get_invoices_by_period_end" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/period-end/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_period_end\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_period_start(lower_threshold, upper_threshold, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by period-start","response" : "getInvoiceByPeriodStart.html"}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1550
1551
1552
1553
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1550

def get_invoices_by_period_start(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_invoices_by_period_start_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_invoices_by_period_start_as_csv(lower_threshold, upper_threshold, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by period-start","response" : "getInvoiceByPeriodStart.csv"}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1632
1633
1634
1635
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1632

def get_invoices_by_period_start_as_csv(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_invoices_by_period_start_as_csv_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_invoices_by_period_start_as_csv_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by period-start&quot;,&quot;response&quot; : &quot;getInvoiceByPeriodStart.csv&quot;}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1649

def get_invoices_by_period_start_as_csv_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_period_start_as_csv ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling InvoicesApi.get_invoices_by_period_start_as_csv" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling InvoicesApi.get_invoices_by_period_start_as_csv" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/period-start/{lower-threshold}/{upper-threshold}.csv".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_period_start_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_period_start_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by period-start&quot;,&quot;response&quot; : &quot;getInvoiceByPeriodStart.html&quot;}

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1567

def get_invoices_by_period_start_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_period_start ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling InvoicesApi.get_invoices_by_period_start" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling InvoicesApi.get_invoices_by_period_start" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_state(state, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoices, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by state","response" : "getInvoiceByState.html"}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return. (default to 0)

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to ID)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1713
1714
1715
1716
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1713

def get_invoices_by_state(state, opts = {})
  data, _status_code, _headers = get_invoices_by_state_with_http_info(state, opts)
  return data
end

#get_invoices_by_state_and_period_start(state, lower_threshold, upper_threshold, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects specified by the state parameter and with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by state and period-start","response" : "getInvoiceByStateAndPeriodStart.html"}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1797
1798
1799
1800
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1797

def get_invoices_by_state_and_period_start(state, lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_invoices_by_state_and_period_start_with_http_info(state, lower_threshold, upper_threshold, opts)
  return data
end

#get_invoices_by_state_and_period_start_as_csv(state, lower_threshold, upper_threshold, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects specified by the state parameter and with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by state and period-start","response" : "getInvoiceByStateAndPeriodStart.csv"}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1887
1888
1889
1890
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1887

def get_invoices_by_state_and_period_start_as_csv(state, lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_invoices_by_state_and_period_start_as_csv_with_http_info(state, lower_threshold, upper_threshold, opts)
  return data
end

#get_invoices_by_state_and_period_start_as_csv_with_http_info(state, lower_threshold, upper_threshold, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects specified by the state parameter and with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by state and period-start&quot;,&quot;response&quot; : &quot;getInvoiceByStateAndPeriodStart.csv&quot;}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1905

def get_invoices_by_state_and_period_start_as_csv_with_http_info(state, lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_state_and_period_start_as_csv ..."
  end
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling InvoicesApi.get_invoices_by_state_and_period_start_as_csv" if state.nil?
  # verify enum value
  unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling InvoicesApi.get_invoices_by_state_and_period_start_as_csv" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling InvoicesApi.get_invoices_by_state_and_period_start_as_csv" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/state/{state}/period-start/{lower-threshold}/{upper-threshold}.csv".sub('{format}','json').sub('{' + 'state' + '}', state.to_s).sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_state_and_period_start_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_state_and_period_start_with_http_info(state, lower_threshold, upper_threshold, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects specified by the state parameter and with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by state and period-start&quot;,&quot;response&quot; : &quot;getInvoiceByStateAndPeriodStart.html&quot;}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1815

def get_invoices_by_state_and_period_start_with_http_info(state, lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_state_and_period_start ..."
  end
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling InvoicesApi.get_invoices_by_state_and_period_start" if state.nil?
  # verify enum value
  unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling InvoicesApi.get_invoices_by_state_and_period_start" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling InvoicesApi.get_invoices_by_state_and_period_start" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/state/{state}/period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'state' + '}', state.to_s).sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_state_and_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_state_as_csv(state, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoices, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. { "nickname" : "Retrieve by state","response" : "getInvoiceByState.csv"}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return. (default to 0)

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

    Specify a field used to order the result set. (default to ID)

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC. (default to DESC)

  • :include_retired (BOOLEAN)

    Whether retired products should be returned. (default to false)

Returns:



1975
1976
1977
1978
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1975

def get_invoices_by_state_as_csv(state, opts = {})
  data, _status_code, _headers = get_invoices_by_state_as_csv_with_http_info(state, opts)
  return data
end

#get_invoices_by_state_as_csv_with_http_info(state, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoices, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by state&quot;,&quot;response&quot; : &quot;getInvoiceByState.csv&quot;}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1991

def get_invoices_by_state_as_csv_with_http_info(state, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_state_as_csv ..."
  end
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling InvoicesApi.get_invoices_by_state_as_csv" if state.nil?
  # verify enum value
  unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/state/{state}.csv".sub('{format}','json').sub('{' + 'state' + '}', state.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_state_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_by_state_with_http_info(state, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoices, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;Retrieve by state&quot;,&quot;response&quot; : &quot;getInvoiceByState.html&quot;}

Parameters:

  • state

    The current state of the invoice, either Paid, Pending, Unpaid or Voided.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired products should be returned.

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
# File 'lib/bf_ruby2/api/invoices_api.rb', line 1729

def get_invoices_by_state_with_http_info(state, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_invoices_by_state ..."
  end
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling InvoicesApi.get_invoices_by_state" if state.nil?
  # verify enum value
  unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/invoices/state/{state}".sub('{format}','json').sub('{' + 'state' + '}', state.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_retired'] = opts[:'include_retired'] if !opts[:'include_retired'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_invoices_by_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_line_payments(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves all InvoiceLine payment attributions. { "nickname" : "Retrieve InvoiceLine payment attributions","response" : "getInvoiceLinePayments.html"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which line payment attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which line payment attributions will be recognised (example input: 2015-10-13T11:50:24).

  • :include_gateway (Array<String>)

    Include attributions only from payments made via these payment gateways. Takes precedence over &#x60;exclude_gateway&#x60; param (if both are provided).

  • :exclude_gateway (Array<String>)

    Include attributions from payments made via all payment gateways, except these.

Returns:



2055
2056
2057
2058
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2055

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

#get_line_payments_as_csv(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves (as CSV) all InvoiceLine payment attributions. { "nickname" : "(CSV) Retrieve InvoiceLine payment attributions","response" : "getInvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which line payment attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which line payment attributions will be recognised (example input: 2015-10-13T11:50:24).

  • :include_gateway (Array<String>)

    Include attributions only from payments made via these payment gateways. Takes precedence over &#x60;exclude_gateway&#x60; param (if both are provided).

  • :exclude_gateway (Array<String>)

    Include attributions from payments made via all payment gateways, except these.

Returns:



2129
2130
2131
2132
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2129

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

#get_line_payments_as_csv_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves (as CSV) all InvoiceLine payment attributions. { &quot;nickname&quot; : &quot;(CSV) Retrieve InvoiceLine payment attributions&quot;,&quot;response&quot; : &quot;getInvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which line payment attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which line payment attributions will be recognised (example input: 2015-10-13T11:50:24).

  • :include_gateway (Array<String>)

    Include attributions only from payments made via these payment gateways. Takes precedence over &#x60;exclude_gateway&#x60; param (if both are provided).

  • :exclude_gateway (Array<String>)

    Include attributions from payments made via all payment gateways, except these.

Returns:



2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2143

def get_line_payments_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_line_payments_as_csv ..."
  end
  if opts[:'include_gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'include_gateway'])
    fail ArgumentError, 'invalid value for "include_gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  if opts[:'exclude_gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'exclude_gateway'])
    fail ArgumentError, 'invalid value for "exclude_gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  # resource path
  local_var_path = "/invoices/line-payments.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?
  query_params[:'include_gateway'] = @api_client.build_collection_param(opts[:'include_gateway'], :multi) if !opts[:'include_gateway'].nil?
  query_params[:'exclude_gateway'] = @api_client.build_collection_param(opts[:'exclude_gateway'], :multi) if !opts[:'exclude_gateway'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_line_payments_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_line_payments_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves all InvoiceLine payment attributions. { &quot;nickname&quot; : &quot;Retrieve InvoiceLine payment attributions&quot;,&quot;response&quot; : &quot;getInvoiceLinePayments.html&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which line payment attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which line payment attributions will be recognised (example input: 2015-10-13T11:50:24).

  • :include_gateway (Array<String>)

    Include attributions only from payments made via these payment gateways. Takes precedence over &#x60;exclude_gateway&#x60; param (if both are provided).

  • :exclude_gateway (Array<String>)

    Include attributions from payments made via all payment gateways, except these.

Returns:



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2069

def get_line_payments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_line_payments ..."
  end
  if opts[:'include_gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'include_gateway'])
    fail ArgumentError, 'invalid value for "include_gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  if opts[:'exclude_gateway'] && !['cybersource_token', 'card_vault', 'paypal_simple', 'locustworld', 'free', 'coupon', 'credit_note', 'stripe', 'braintree', 'balanced', 'paypal', 'billforward_test', 'offline', 'trial', 'stripeACH', 'authorizeNet', 'spreedly', 'sagePay', 'trustCommerce', 'payvision', 'kash'].include?(opts[:'exclude_gateway'])
    fail ArgumentError, 'invalid value for "exclude_gateway", must be one of cybersource_token, card_vault, paypal_simple, locustworld, free, coupon, credit_note, stripe, braintree, balanced, paypal, billforward_test, offline, trial, stripeACH, authorizeNet, spreedly, sagePay, trustCommerce, payvision, kash'
  end
  # resource path
  local_var_path = "/invoices/line-payments".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?
  query_params[:'include_gateway'] = @api_client.build_collection_param(opts[:'include_gateway'], :multi) if !opts[:'include_gateway'].nil?
  query_params[:'exclude_gateway'] = @api_client.build_collection_param(opts[:'exclude_gateway'], :multi) if !opts[:'exclude_gateway'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_line_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_metadata_for_invoice(invoice_id, opts = {}) ⇒ DynamicMetadata

Retrieve any associated metadata. metadata on invoice","request":"getInvoiceMetadataRequest.html","response":"getInvoiceMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2200
2201
2202
2203
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2200

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

#get_metadata_for_invoice_with_http_info(invoice_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Retrieve any associated metadata. metadata on invoice&quot;,&quot;request&quot;:&quot;getInvoiceMetadataRequest.html&quot;,&quot;response&quot;:&quot;getInvoiceMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2211

def (invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_metadata_for_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.get_metadata_for_invoice" if invoice_id.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/metadata".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_metadata_for_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_refund_invoice_line_payments_from_invoices_as_csv(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves awarded refunds from InvoicePayments upon line items, in CSV format. { "nickname" : "Refund InvoiceLinePayments CSV","response" : "Refund InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which refunds will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which refunds will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2261
2262
2263
2264
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2261

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

#get_refund_invoice_line_payments_from_invoices_as_csv_by_refund_received(opts = {}) ⇒ InvoiceLinePaymentPagedMetadata

Retrieves awarded refunds from InvoicePayments upon line items, in CSV format. { "nickname" : "Refund InvoiceLinePayments CSV","response" : "Refund InvoiceLinePayments.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which refunds will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which refunds will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2323
2324
2325
2326
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2323

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

#get_refund_invoice_line_payments_from_invoices_as_csv_by_refund_received_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves awarded refunds from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Refund InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Refund InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which refunds will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which refunds will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2335

def get_refund_invoice_line_payments_from_invoices_as_csv_by_refund_received_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_refund_invoice_line_payments_from_invoices_as_csv_by_refund_received ..."
  end
  # resource path
  local_var_path = "/invoices/payment-received/refund.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_refund_invoice_line_payments_from_invoices_as_csv_by_refund_received\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_refund_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {}) ⇒ Array<(InvoiceLinePaymentPagedMetadata, Fixnum, Hash)>

Retrieves awarded refunds from InvoicePayments upon line items, in CSV format. { &quot;nickname&quot; : &quot;Refund InvoiceLinePayments CSV&quot;,&quot;response&quot; : &quot;Refund InvoiceLinePayments.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which refunds will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which refunds will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2273

def get_refund_invoice_line_payments_from_invoices_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_refund_invoice_line_payments_from_invoices_as_csv ..."
  end
  # resource path
  local_var_path = "/invoices/refund.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/csv']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoiceLinePaymentPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_refund_invoice_line_payments_from_invoices_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_revenue_attributions(opts = {}) ⇒ RevenueAttributionPagedMetadata

Retrieves all attributions of Invoice costs to Invoice lines. { "nickname" : "Retrieve revenue attributions","response" : "getRevenueAttributions.html"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2385
2386
2387
2388
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2385

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

#get_revenue_attributions_as_csv(opts = {}) ⇒ String

Retrieves (as CSV) all attributions of Invoice costs to Invoice lines. { "nickname" : "(CSV) Retrieve revenue attributions","response" : "getRevenueAttributions.csv"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:

  • (String)


2447
2448
2449
2450
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2447

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

#get_revenue_attributions_as_csv_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Retrieves (as CSV) all attributions of Invoice costs to Invoice lines. { &quot;nickname&quot; : &quot;(CSV) Retrieve revenue attributions&quot;,&quot;response&quot; : &quot;getRevenueAttributions.csv&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2459

def get_revenue_attributions_as_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_revenue_attributions_as_csv ..."
  end
  # resource path
  local_var_path = "/invoices/revenue-attributions.csv".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_revenue_attributions_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_revenue_attributions_with_http_info(opts = {}) ⇒ Array<(RevenueAttributionPagedMetadata, Fixnum, Hash)>

Retrieves all attributions of Invoice costs to Invoice lines. { &quot;nickname&quot; : &quot;Retrieve revenue attributions&quot;,&quot;response&quot; : &quot;getRevenueAttributions.html&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :recognition_start (String)

    The UTC DateTime specifying the start of the interval within which revenue attributions will be recognised (example input: 2015-09-13T11:50:24).

  • :recognition_end (String)

    The UTC DateTime specifying the end of the interval within which revenue attributions will be recognised (example input: 2015-10-13T11:50:24).

Returns:



2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2397

def get_revenue_attributions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_revenue_attributions ..."
  end
  # resource path
  local_var_path = "/invoices/revenue-attributions".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'recognition_start'] = opts[:'recognition_start'] if !opts[:'recognition_start'].nil?
  query_params[:'recognition_end'] = opts[:'recognition_end'] if !opts[:'recognition_end'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RevenueAttributionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_revenue_attributions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_swagger_for_invoice(query_string, opts = {}) ⇒ SwaggerTypeListInv

{ "nickname" : "","response" : ""}

Parameters:

  • query_string

    The query string used to search.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The starting index of the search results. (default to 0)

  • :records (Integer)

    The number of search results to return. (default to 10)

  • :format (String)

    The response format, either JSON or XML. (default to JSON)

  • :wildcard (BOOLEAN)

    Toggle if we search for full words or whether a wildcard is used. (default to false)

  • :entity (BOOLEAN)

    Is an entity returned with the search results. (default to false)

Returns:



2513
2514
2515
2516
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2513

def get_swagger_for_invoice(query_string, opts = {})
  data, _status_code, _headers = get_swagger_for_invoice_with_http_info(query_string, opts)
  return data
end

#get_swagger_for_invoice_with_http_info(query_string, opts = {}) ⇒ Array<(SwaggerTypeListInv, Fixnum, Hash)>

{ &quot;nickname&quot; : &quot;&quot;,&quot;response&quot; : &quot;&quot;}

Parameters:

  • query_string

    The query string used to search.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The starting index of the search results.

  • :records (Integer)

    The number of search results to return.

  • :format (String)

    The response format, either JSON or XML.

  • :wildcard (BOOLEAN)

    Toggle if we search for full words or whether a wildcard is used.

  • :entity (BOOLEAN)

    Is an entity returned with the search results.

Returns:

  • (Array<(SwaggerTypeListInv, Fixnum, Hash)>)

    SwaggerTypeListInv data, response status code and response headers



2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2529

def get_swagger_for_invoice_with_http_info(query_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.get_swagger_for_invoice ..."
  end
  # verify the required parameter 'query_string' is set
  fail ArgumentError, "Missing the required parameter 'query_string' when calling InvoicesApi.get_swagger_for_invoice" if query_string.nil?
  # resource path
  local_var_path = "/invoices/swagger-end-point/{query-string}".sub('{format}','json').sub('{' + 'query-string' + '}', query_string.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
  query_params[:'wildcard'] = opts[:'wildcard'] if !opts[:'wildcard'].nil?
  query_params[:'entity'] = opts[:'entity'] if !opts[:'entity'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SwaggerTypeListInv')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#get_swagger_for_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_invoice(request, opts = {}) ⇒ InvoicePagedMetadata

Import an invoice. invoice","response":"ImportInvoiceResponse.html","request":"ImportInvoiceRequest.html"

Parameters:

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

    the optional parameters

Returns:



2582
2583
2584
2585
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2582

def import_invoice(request, opts = {})
  data, _status_code, _headers = import_invoice_with_http_info(request, opts)
  return data
end

#import_invoice_with_http_info(request, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Import an invoice. invoice&quot;,&quot;response&quot;:&quot;ImportInvoiceResponse.html&quot;,&quot;request&quot;:&quot;ImportInvoiceRequest.html&quot;

Parameters:

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2592

def import_invoice_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.import_invoice ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling InvoicesApi.import_invoice" if request.nil?
  # resource path
  local_var_path = "/invoices/import".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#import_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#recalculate_invoice(invoice_id, request, opts = {}) ⇒ InvoicePagedMetadata

Re-calculate an Invoice. an invoice","response":"recalculateInvoiceResponse.html","request":"RecalculateInvoiceRequest.html"

Parameters:

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

    the optional parameters

Returns:



2640
2641
2642
2643
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2640

def recalculate_invoice(invoice_id, request, opts = {})
  data, _status_code, _headers = recalculate_invoice_with_http_info(invoice_id, request, opts)
  return data
end

#recalculate_invoice_with_http_info(invoice_id, request, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Re-calculate an Invoice. an invoice&quot;,&quot;response&quot;:&quot;recalculateInvoiceResponse.html&quot;,&quot;request&quot;:&quot;RecalculateInvoiceRequest.html&quot;

Parameters:

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2651

def recalculate_invoice_with_http_info(invoice_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.recalculate_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.recalculate_invoice" if invoice_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling InvoicesApi.recalculate_invoice" if request.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/recalculate".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#recalculate_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_charge_from_invoice(invoice_id, charge_id, opts = {}) ⇒ SubscriptionChargePagedMetadata

Removes the specified charge from the specified Invoice. from invoice","response":"deleteChargesInvoice.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2702
2703
2704
2705
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2702

def remove_charge_from_invoice(invoice_id, charge_id, opts = {})
  data, _status_code, _headers = remove_charge_from_invoice_with_http_info(invoice_id, charge_id, opts)
  return data
end

#remove_charge_from_invoice_with_http_info(invoice_id, charge_id, opts = {}) ⇒ Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>

Removes the specified charge from the specified Invoice. from invoice&quot;,&quot;response&quot;:&quot;deleteChargesInvoice.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2714

def remove_charge_from_invoice_with_http_info(invoice_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.remove_charge_from_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.remove_charge_from_invoice" if invoice_id.nil?
  # verify the required parameter 'charge_id' is set
  fail ArgumentError, "Missing the required parameter 'charge_id' when calling InvoicesApi.remove_charge_from_invoice" if charge_id.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/charges/{charge-ID}".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s).sub('{' + 'charge-ID' + '}', charge_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionChargePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#remove_charge_from_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_metadata_from_invoice(invoice_id, opts = {}) ⇒ DynamicMetadata

Remove any associated metadata. metadata from invoice","request" :"deleteInvoiceMetadataRequest.html","response":"deleteInvoiceMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2765
2766
2767
2768
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2765

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

#remove_metadata_from_invoice_with_http_info(invoice_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any associated metadata. metadata from invoice&quot;,&quot;request&quot; :&quot;deleteInvoiceMetadataRequest.html&quot;,&quot;response&quot;:&quot;deleteInvoiceMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2776

def (invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.remove_metadata_from_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.remove_metadata_from_invoice" if invoice_id.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/metadata".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#remove_metadata_from_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_metadata_for_invoice(metadata, invoice_id, opts = {}) ⇒ DynamicMetadata

Remove any existing metadata keys and create the provided data. metadata on invoice","request":"setInvoiceMetadataRequest.html","response":"setInvoiceMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2826
2827
2828
2829
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2826

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

#set_metadata_for_invoice_with_http_info(metadata, invoice_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any existing metadata keys and create the provided data. metadata on invoice&quot;,&quot;request&quot;:&quot;setInvoiceMetadataRequest.html&quot;,&quot;response&quot;:&quot;setInvoiceMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2838

def (, invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.set_metadata_for_invoice ..."
  end
  # verify the required parameter 'metadata' is set
  fail ArgumentError, "Missing the required parameter 'metadata' when calling InvoicesApi.set_metadata_for_invoice" if .nil?
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.set_metadata_for_invoice" if invoice_id.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/metadata".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#set_metadata_for_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_invoice(invoice, opts = {}) ⇒ InvoicePagedMetadata

Update an Invoice. an invoice","response":"updateInvoiceResponse.html","request":"updateInvoiceRequest.html"

Parameters:

  • invoice

    The invoice object to be updated.

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

    the optional parameters

Returns:



2888
2889
2890
2891
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2888

def update_invoice(invoice, opts = {})
  data, _status_code, _headers = update_invoice_with_http_info(invoice, opts)
  return data
end

#update_invoice_with_http_info(invoice, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Update an Invoice. an invoice&quot;,&quot;response&quot;:&quot;updateInvoiceResponse.html&quot;,&quot;request&quot;:&quot;updateInvoiceRequest.html&quot;

Parameters:

  • invoice

    The invoice object to be updated.

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2898

def update_invoice_with_http_info(invoice, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.update_invoice ..."
  end
  # verify the required parameter 'invoice' is set
  fail ArgumentError, "Missing the required parameter 'invoice' when calling InvoicesApi.update_invoice" if invoice.nil?
  # resource path
  local_var_path = "/invoices".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/xml', 'application/xml', 'application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(invoice)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#update_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upsert_metadata_for_invoice(metadata, invoice_id, opts = {}) ⇒ DynamicMetadata

Update any existing metadata key-values and insert any new key-values, no keys will be removed. metadata on invoice","request":"upsertInvoiceMetadataRequest.html","response":"upsertInvoiceMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:



2947
2948
2949
2950
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2947

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

#upsert_metadata_for_invoice_with_http_info(metadata, invoice_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Update any existing metadata key-values and insert any new key-values, no keys will be removed. metadata on invoice&quot;,&quot;request&quot;:&quot;upsertInvoiceMetadataRequest.html&quot;,&quot;response&quot;:&quot;upsertInvoiceMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

Returns:

  • (Array<(DynamicMetadata, Fixnum, Hash)>)

    DynamicMetadata data, response status code and response headers



2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
# File 'lib/bf_ruby2/api/invoices_api.rb', line 2959

def (, invoice_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.upsert_metadata_for_invoice ..."
  end
  # verify the required parameter 'metadata' is set
  fail ArgumentError, "Missing the required parameter 'metadata' when calling InvoicesApi.upsert_metadata_for_invoice" if .nil?
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.upsert_metadata_for_invoice" if invoice_id.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}/metadata".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#upsert_metadata_for_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#void_invoice(invoice_id, organizations, opts = {}) ⇒ InvoicePagedMetadata

Voids the invoice specified by the invoice identifier parameter. { "nickname" : "Void an invoice","response" : "voidInvoice.html"}

Parameters:

  • invoice_id

    ID of the invoice.

  • organizations

    A list of organization-IDs used to restrict the scope of API calls.

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

    the optional parameters

Returns:



3010
3011
3012
3013
# File 'lib/bf_ruby2/api/invoices_api.rb', line 3010

def void_invoice(invoice_id, organizations, opts = {})
  data, _status_code, _headers = void_invoice_with_http_info(invoice_id, organizations, opts)
  return data
end

#void_invoice_with_http_info(invoice_id, organizations, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Voids the invoice specified by the invoice identifier parameter. { &quot;nickname&quot; : &quot;Void an invoice&quot;,&quot;response&quot; : &quot;voidInvoice.html&quot;}

Parameters:

  • invoice_id

    ID of the invoice.

  • organizations

    A list of organization-IDs used to restrict the scope of API calls.

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

    the optional parameters

Returns:

  • (Array<(InvoicePagedMetadata, Fixnum, Hash)>)

    InvoicePagedMetadata data, response status code and response headers



3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
# File 'lib/bf_ruby2/api/invoices_api.rb', line 3021

def void_invoice_with_http_info(invoice_id, organizations, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoicesApi.void_invoice ..."
  end
  # verify the required parameter 'invoice_id' is set
  fail ArgumentError, "Missing the required parameter 'invoice_id' when calling InvoicesApi.void_invoice" if invoice_id.nil?
  # verify the required parameter 'organizations' is set
  fail ArgumentError, "Missing the required parameter 'organizations' when calling InvoicesApi.void_invoice" if organizations.nil?
  # resource path
  local_var_path = "/invoices/{invoice-ID}".sub('{format}','json').sub('{' + 'invoice-ID' + '}', invoice_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(organizations, :multi)

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoicesApi#void_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end