Class: SwaggerClient::BillingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/billing_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BillingApi

Returns a new instance of BillingApi.



19
20
21
# File 'lib/swagger_client/api/billing_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/billing_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_automated_invoice_rule(body, opts = {}) ⇒ AutomatedInvoiceRule

Create an automated invoice rule Creates an automated invoice rule with the specified parameters

Parameters:

  • body

    automated invoice rule

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/swagger_client/api/billing_api.rb', line 27

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

#add_automated_invoice_rule_with_http_info(body, opts = {}) ⇒ Array<(AutomatedInvoiceRule, Fixnum, Hash)>

Create an automated invoice rule Creates an automated invoice rule with the specified parameters

Parameters:

  • body

    automated invoice rule

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

    the optional parameters

Returns:

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

    AutomatedInvoiceRule data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/swagger_client/api/billing_api.rb', line 37

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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 => 'AutomatedInvoiceRule')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#add_automated_invoice_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_billing_schedule(body, opts = {}) ⇒ String

Add a new billing schedule for subscription line item Creates a new billing schedule entry for an event based charge

Parameters:

  • body

    new billing event

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

    the optional parameters

Returns:

  • (String)


81
82
83
84
# File 'lib/swagger_client/api/billing_api.rb', line 81

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

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

Add a new billing schedule for subscription line item Creates a new billing schedule entry for an event based charge

Parameters:

  • body

    new billing event

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/swagger_client/api/billing_api.rb', line 91

def add_billing_schedule_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.add_billing_schedule ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.add_billing_schedule"
  end
  # resource path
  local_var_path = '/invoices/schedule'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#add_billing_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_subscription_charge_alias(alias_id, opts = {}) ⇒ nil

Create an alias for a subscription id/charge id pair This allows you to specify a string alias for a subscription id and a charge id. This can be useful when, for example, you want to upload usage statistics and would rather specify your own id (or another external id), rather than referring to Subskribe’s internal ids.

Parameters:

  • alias_id

    alias to map to create the mapping for

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)

    the subscription id

  • :charge_id (String)

    the charge id

Returns:

  • (nil)


135
136
137
138
# File 'lib/swagger_client/api/billing_api.rb', line 135

def add_subscription_charge_alias(alias_id, opts = {})
  add_subscription_charge_alias_with_http_info(alias_id, opts)
  nil
end

#add_subscription_charge_alias_with_http_info(alias_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create an alias for a subscription id/charge id pair This allows you to specify a string alias for a subscription id and a charge id. This can be useful when, for example, you want to upload usage statistics and would rather specify your own id (or another external id), rather than referring to Subskribe&#39;s internal ids.

Parameters:

  • alias_id

    alias to map to create the mapping for

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)

    the subscription id

  • :charge_id (String)

    the charge id

Returns:

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

    nil, response status code and response headers



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/swagger_client/api/billing_api.rb', line 147

def add_subscription_charge_alias_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.add_subscription_charge_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling BillingApi.add_subscription_charge_alias"
  end
  # resource path
  local_var_path = '/alias/subscriptionCharge/{aliasId}'.sub('{' + 'aliasId' + '}', alias_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = opts[:'subscription_id'] if !opts[:'subscription_id'].nil?
  query_params[:'chargeId'] = opts[:'charge_id'] if !opts[:'charge_id'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#add_subscription_charge_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#apply_credit_memo(body, opts = {}) ⇒ nil

Apply a credit memo Applies a credit memo per the specified parameters

Parameters:

  • body

    application details in json

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

    the optional parameters

Returns:

  • (nil)


190
191
192
193
# File 'lib/swagger_client/api/billing_api.rb', line 190

def apply_credit_memo(body, opts = {})
  apply_credit_memo_with_http_info(body, opts)
  nil
end

#apply_credit_memo_with_http_info(body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Apply a credit memo Applies a credit memo per the specified parameters

Parameters:

  • body

    application details in json

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/swagger_client/api/billing_api.rb', line 200

def apply_credit_memo_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.apply_credit_memo ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.apply_credit_memo"
  end
  # resource path
  local_var_path = '/settlements/applyCreditMemo'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#apply_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_bulk_invoice_run(body, opts = {}) ⇒ String

Create a bulk invoice run Creates a bulk invoice run as specified by the input parameters. On success the id of the run is returned.

Parameters:

  • body

    json representing the run parameters

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

    the optional parameters

Returns:

  • (String)


243
244
245
246
# File 'lib/swagger_client/api/billing_api.rb', line 243

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

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

Create a bulk invoice run Creates a bulk invoice run as specified by the input parameters. On success the id of the run is returned.

Parameters:

  • body

    json representing the run parameters

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/swagger_client/api/billing_api.rb', line 253

def create_bulk_invoice_run_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.create_bulk_invoice_run ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.create_bulk_invoice_run"
  end
  # resource path
  local_var_path = '/invoices/bulk'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#create_bulk_invoice_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_invoice_document(invoice_number, opts = {}) ⇒ nil

Generate invoice PDF Generates a PDF version of the specified invoice. Once generated, PDF can be later fetched via a call to /invoiceNumber/pdf.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


295
296
297
298
# File 'lib/swagger_client/api/billing_api.rb', line 295

def create_invoice_document(invoice_number, opts = {})
  create_invoice_document_with_http_info(invoice_number, opts)
  nil
end

#create_invoice_document_with_http_info(invoice_number, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Generate invoice PDF Generates a PDF version of the specified invoice. Once generated, PDF can be later fetched via a call to /invoiceNumber/pdf.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/swagger_client/api/billing_api.rb', line 305

def create_invoice_document_with_http_info(invoice_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.create_invoice_document ...'
  end
  # verify the required parameter 'invoice_number' is set
  if @api_client.config.client_side_validation && invoice_number.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_number' when calling BillingApi.create_invoice_document"
  end
  # resource path
  local_var_path = '/invoices/{invoiceNumber}/pdf'.sub('{' + 'invoiceNumber' + '}', invoice_number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#create_invoice_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_billing_schedule(id, opts = {}) ⇒ nil

Delete an existing billing schedule Billing schedules must be deleted in reverse chronological order.

Parameters:

  • id

    billing schedule entry id

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

    the optional parameters

Returns:

  • (nil)


346
347
348
349
# File 'lib/swagger_client/api/billing_api.rb', line 346

def delete_billing_schedule(id, opts = {})
  delete_billing_schedule_with_http_info(id, opts)
  nil
end

#delete_billing_schedule_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an existing billing schedule Billing schedules must be deleted in reverse chronological order.

Parameters:

  • id

    billing schedule entry id

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/swagger_client/api/billing_api.rb', line 356

def delete_billing_schedule_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.delete_billing_schedule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.delete_billing_schedule"
  end
  # resource path
  local_var_path = '/invoices/schedule/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#delete_billing_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_invoice(number, opts = {}) ⇒ InvoiceJson

Delete invoice Deletes the specified invoice

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:



397
398
399
400
# File 'lib/swagger_client/api/billing_api.rb', line 397

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

#delete_invoice_with_http_info(number, opts = {}) ⇒ Array<(InvoiceJson, Fixnum, Hash)>

Delete invoice Deletes the specified invoice

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:

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

    InvoiceJson data, response status code and response headers



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/swagger_client/api/billing_api.rb', line 407

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

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#delete_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_subscription_charge_alias(alias_id, opts = {}) ⇒ nil

Delete the specified alias Deletes the specified alias mapping

Parameters:

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

    the optional parameters

Returns:

  • (nil)


449
450
451
452
# File 'lib/swagger_client/api/billing_api.rb', line 449

def delete_subscription_charge_alias(alias_id, opts = {})
  delete_subscription_charge_alias_with_http_info(alias_id, opts)
  nil
end

#delete_subscription_charge_alias_with_http_info(alias_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the specified alias Deletes the specified alias mapping

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/swagger_client/api/billing_api.rb', line 459

def delete_subscription_charge_alias_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.delete_subscription_charge_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling BillingApi.delete_subscription_charge_alias"
  end
  # resource path
  local_var_path = '/alias/subscriptionCharge/{aliasId}'.sub('{' + 'aliasId' + '}', alias_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#delete_subscription_charge_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_invoice(subscription_id, target_date, invoice_charge_inclusion_option, opts = {}) ⇒ Array<InvoiceJson>

Generate subscription invoices Generates the invoices for the given subscription

Parameters:

  • subscription_id

    id of the subscription

  • target_date

    Time in seconds since Epoch (GMT) to generate invoice from

  • invoice_charge_inclusion_option

    types of charges to include

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

    the optional parameters

Options Hash (opts):

  • :invoice_date (Integer)

    Time in seconds since Epoch (GMT) to set invoice date to

Returns:



503
504
505
506
# File 'lib/swagger_client/api/billing_api.rb', line 503

def generate_invoice(subscription_id, target_date, invoice_charge_inclusion_option, opts = {})
  data, _status_code, _headers = generate_invoice_with_http_info(subscription_id, target_date, invoice_charge_inclusion_option, opts)
  data
end

#generate_invoice_with_http_info(subscription_id, target_date, invoice_charge_inclusion_option, opts = {}) ⇒ Array<(Array<InvoiceJson>, Fixnum, Hash)>

Generate subscription invoices Generates the invoices for the given subscription

Parameters:

  • subscription_id

    id of the subscription

  • target_date

    Time in seconds since Epoch (GMT) to generate invoice from

  • invoice_charge_inclusion_option

    types of charges to include

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

    the optional parameters

Options Hash (opts):

  • :invoice_date (Integer)

    Time in seconds since Epoch (GMT) to set invoice date to

Returns:

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

    Array<InvoiceJson> data, response status code and response headers



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
# File 'lib/swagger_client/api/billing_api.rb', line 516

def generate_invoice_with_http_info(subscription_id, target_date, invoice_charge_inclusion_option, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.generate_invoice ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling BillingApi.generate_invoice"
  end
  # verify the required parameter 'target_date' is set
  if @api_client.config.client_side_validation && target_date.nil?
    fail ArgumentError, "Missing the required parameter 'target_date' when calling BillingApi.generate_invoice"
  end
  # verify the required parameter 'invoice_charge_inclusion_option' is set
  if @api_client.config.client_side_validation && invoice_charge_inclusion_option.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_charge_inclusion_option' when calling BillingApi.generate_invoice"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['INCLUDE_USAGE', 'EXCLUDE_USAGE', 'ONLY_USAGE'].include?(invoice_charge_inclusion_option)
    fail ArgumentError, "invalid value for 'invoice_charge_inclusion_option', must be one of INCLUDE_USAGE, EXCLUDE_USAGE, ONLY_USAGE"
  end
  # resource path
  local_var_path = '/invoices/generate'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = subscription_id
  query_params[:'targetDate'] = target_date
  query_params[:'invoiceChargeInclusionOption'] = invoice_charge_inclusion_option
  query_params[:'invoiceDate'] = opts[:'invoice_date'] if !opts[:'invoice_date'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<InvoiceJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#generate_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_receivable_contact(opts = {}) ⇒ AccountReceivableContactJson

Get the contact for accounts receivable Returns the details of the account receivable contact for your tenant

Parameters:

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

    the optional parameters

Returns:



573
574
575
576
# File 'lib/swagger_client/api/billing_api.rb', line 573

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

#get_account_receivable_contact_with_http_info(opts = {}) ⇒ Array<(AccountReceivableContactJson, Fixnum, Hash)>

Get the contact for accounts receivable Returns the details of the account receivable contact for your tenant

Parameters:

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

    the optional parameters

Returns:



582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/swagger_client/api/billing_api.rb', line 582

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_account_receivable_contact ...'
  end
  # resource path
  local_var_path = '/accountReceivableContact'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'AccountReceivableContactJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_account_receivable_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_automated_invoice_rule(id, opts = {}) ⇒ nil

Get automated invoice rule details Returns the details of the specified automated invoice rule

Parameters:

  • id

    id of the automated invoice rule

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

    the optional parameters

Returns:

  • (nil)


620
621
622
623
# File 'lib/swagger_client/api/billing_api.rb', line 620

def get_automated_invoice_rule(id, opts = {})
  get_automated_invoice_rule_with_http_info(id, opts)
  nil
end

#get_automated_invoice_rule_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get automated invoice rule details Returns the details of the specified automated invoice rule

Parameters:

  • id

    id of the automated invoice rule

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/swagger_client/api/billing_api.rb', line 630

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

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_automated_invoice_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_automated_invoice_rules(opts = {}) ⇒ nil

Get automated invoice rules for a tenant Returns all the configured automated invoice rules for the tenant

Parameters:

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

    the optional parameters

Returns:

  • (nil)


670
671
672
673
# File 'lib/swagger_client/api/billing_api.rb', line 670

def get_automated_invoice_rules(opts = {})
  get_automated_invoice_rules_with_http_info(opts)
  nil
end

#get_automated_invoice_rules_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get automated invoice rules for a tenant Returns all the configured automated invoice rules for the tenant

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/swagger_client/api/billing_api.rb', line 679

def get_automated_invoice_rules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_automated_invoice_rules ...'
  end
  # resource path
  local_var_path = '/automatedInvoiceRules'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_automated_invoice_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_billing_schedules(subscription_id, subscription_charge_id, opts = {}) ⇒ Array<BillingEventEntry>

Get billing schedules for a subscription line item Retrieve all billing schedules for a subscription line item

Parameters:

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

    the optional parameters

Returns:



717
718
719
720
# File 'lib/swagger_client/api/billing_api.rb', line 717

def get_billing_schedules(subscription_id, subscription_charge_id, opts = {})
  data, _status_code, _headers = get_billing_schedules_with_http_info(subscription_id, subscription_charge_id, opts)
  data
end

#get_billing_schedules_with_http_info(subscription_id, subscription_charge_id, opts = {}) ⇒ Array<(Array<BillingEventEntry>, Fixnum, Hash)>

Get billing schedules for a subscription line item Retrieve all billing schedules for a subscription line item

Parameters:

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

    the optional parameters

Returns:

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

    Array<BillingEventEntry> data, response status code and response headers



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
760
761
762
763
764
765
766
767
768
769
770
# File 'lib/swagger_client/api/billing_api.rb', line 728

def get_billing_schedules_with_http_info(subscription_id, subscription_charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_billing_schedules ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling BillingApi.get_billing_schedules"
  end
  # verify the required parameter 'subscription_charge_id' is set
  if @api_client.config.client_side_validation && subscription_charge_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_charge_id' when calling BillingApi.get_billing_schedules"
  end
  # resource path
  local_var_path = '/invoices/schedule'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = subscription_id
  query_params[:'subscriptionChargeId'] = subscription_charge_id

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<BillingEventEntry>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_billing_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_invoice_run(bulk_invoice_run_id, opts = {}) ⇒ BulkInvoiceRun

Get bulk invoice run details Returns the details of the specified bulk invoice run

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Returns:



776
777
778
779
# File 'lib/swagger_client/api/billing_api.rb', line 776

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

#get_bulk_invoice_run_items(bulk_invoice_run_id, opts = {}) ⇒ Array<BulkInvoiceRunItem>

Get items for bulk invoice run Returns the items associated with the specified bulk invoice run

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Returns:



828
829
830
831
# File 'lib/swagger_client/api/billing_api.rb', line 828

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

#get_bulk_invoice_run_items_with_http_info(bulk_invoice_run_id, opts = {}) ⇒ Array<(Array<BulkInvoiceRunItem>, Fixnum, Hash)>

Get items for bulk invoice run Returns the items associated with the specified bulk invoice run

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Returns:

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

    Array<BulkInvoiceRunItem> data, response status code and response headers



838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/swagger_client/api/billing_api.rb', line 838

def get_bulk_invoice_run_items_with_http_info(bulk_invoice_run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_bulk_invoice_run_items ...'
  end
  # verify the required parameter 'bulk_invoice_run_id' is set
  if @api_client.config.client_side_validation && bulk_invoice_run_id.nil?
    fail ArgumentError, "Missing the required parameter 'bulk_invoice_run_id' when calling BillingApi.get_bulk_invoice_run_items"
  end
  # resource path
  local_var_path = '/invoices/bulk/{bulkInvoiceRunId}/runItems'.sub('{' + 'bulkInvoiceRunId' + '}', bulk_invoice_run_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<BulkInvoiceRunItem>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_bulk_invoice_run_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bulk_invoice_run_with_http_info(bulk_invoice_run_id, opts = {}) ⇒ Array<(BulkInvoiceRun, Fixnum, Hash)>

Get bulk invoice run details Returns the details of the specified bulk invoice run

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Returns:

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

    BulkInvoiceRun data, response status code and response headers



786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/swagger_client/api/billing_api.rb', line 786

def get_bulk_invoice_run_with_http_info(bulk_invoice_run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_bulk_invoice_run ...'
  end
  # verify the required parameter 'bulk_invoice_run_id' is set
  if @api_client.config.client_side_validation && bulk_invoice_run_id.nil?
    fail ArgumentError, "Missing the required parameter 'bulk_invoice_run_id' when calling BillingApi.get_bulk_invoice_run"
  end
  # resource path
  local_var_path = '/invoices/bulk/{bulkInvoiceRunId}'.sub('{' + 'bulkInvoiceRunId' + '}', bulk_invoice_run_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'BulkInvoiceRun')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_bulk_invoice_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_dunning_setting(opts = {}) ⇒ DunningSettingJson

Get dunning settings Returns the dunning settings for your tenant

Parameters:

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

    the optional parameters

Returns:



879
880
881
882
# File 'lib/swagger_client/api/billing_api.rb', line 879

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

#get_dunning_setting_with_http_info(opts = {}) ⇒ Array<(DunningSettingJson, Fixnum, Hash)>

Get dunning settings Returns the dunning settings for your tenant

Parameters:

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

    the optional parameters

Returns:

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

    DunningSettingJson data, response status code and response headers



888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/swagger_client/api/billing_api.rb', line 888

def get_dunning_setting_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_dunning_setting ...'
  end
  # resource path
  local_var_path = '/dunningSetting'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'DunningSettingJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_dunning_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice(number, opts = {}) ⇒ InvoiceJson

Get invoice details Returns the details of the specified invoice number

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:



926
927
928
929
# File 'lib/swagger_client/api/billing_api.rb', line 926

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

#get_invoice_balance(number, opts = {}) ⇒ InvoiceBalanceJson

Get invoice balance Returns the balance of the specified invoice number

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:



978
979
980
981
# File 'lib/swagger_client/api/billing_api.rb', line 978

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

#get_invoice_balance_with_http_info(number, opts = {}) ⇒ Array<(InvoiceBalanceJson, Fixnum, Hash)>

Get invoice balance Returns the balance of the specified invoice number

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:

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

    InvoiceBalanceJson data, response status code and response headers



988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
# File 'lib/swagger_client/api/billing_api.rb', line 988

def get_invoice_balance_with_http_info(number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_invoice_balance ...'
  end
  # verify the required parameter 'number' is set
  if @api_client.config.client_side_validation && number.nil?
    fail ArgumentError, "Missing the required parameter 'number' when calling BillingApi.get_invoice_balance"
  end
  # resource path
  local_var_path = '/invoices/{number}/balance'.sub('{' + 'number' + '}', number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceBalanceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_invoice_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_document_pdf(invoice_number, opts = {}) ⇒ nil

Download invoice PDF Downloads the PDF for an invoice after it has been generated via a POST to /invoiceNumber/pdf. The data return will be the PDF document contents.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

  • (nil)


1030
1031
1032
1033
# File 'lib/swagger_client/api/billing_api.rb', line 1030

def get_invoice_document_pdf(invoice_number, opts = {})
  get_invoice_document_pdf_with_http_info(invoice_number, opts)
  nil
end

#get_invoice_document_pdf_with_http_info(invoice_number, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Download invoice PDF Downloads the PDF for an invoice after it has been generated via a POST to /invoiceNumber/pdf. The data return will be the PDF document contents.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1040
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
# File 'lib/swagger_client/api/billing_api.rb', line 1040

def get_invoice_document_pdf_with_http_info(invoice_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_invoice_document_pdf ...'
  end
  # verify the required parameter 'invoice_number' is set
  if @api_client.config.client_side_validation && invoice_number.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_number' when calling BillingApi.get_invoice_document_pdf"
  end
  # resource path
  local_var_path = '/invoices/{invoiceNumber}/pdf'.sub('{' + 'invoiceNumber' + '}', invoice_number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_invoice_document_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice_with_http_info(number, opts = {}) ⇒ Array<(InvoiceJson, Fixnum, Hash)>

Get invoice details Returns the details of the specified invoice number

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:

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

    InvoiceJson data, response status code and response headers



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
# File 'lib/swagger_client/api/billing_api.rb', line 936

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

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices(opts = {}) ⇒ InvoiceJsonPaginationResponse

Get all invoices for a subscription Returns all invoices for a subscription. The result is paginated. Use the cursor returned from a request in subsequent calls to retrieve all results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)
  • :status (String)

    status filter for invoices

  • :cursor (String)

    used to iterate through all results

  • :limit (Integer)

    number of items per page

Returns:



1084
1085
1086
1087
# File 'lib/swagger_client/api/billing_api.rb', line 1084

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

#get_invoices_with_http_info(opts = {}) ⇒ Array<(InvoiceJsonPaginationResponse, Fixnum, Hash)>

Get all invoices for a subscription Returns all invoices for a subscription. The result is paginated. Use the cursor returned from a request in subsequent calls to retrieve all results.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)
  • :status (String)

    status filter for invoices

  • :cursor (String)

    used to iterate through all results

  • :limit (Integer)

    number of items per page

Returns:



1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
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
# File 'lib/swagger_client/api/billing_api.rb', line 1097

def get_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_invoices ...'
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['DRAFT', 'POSTED', 'PAID', 'CONVERTED', 'VOIDED'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of DRAFT, POSTED, PAID, CONVERTED, VOIDED'
  end
  # resource path
  local_var_path = '/invoices'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = opts[:'subscription_id'] if !opts[:'subscription_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJsonPaginationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_raw_invoice_document_json(invoice_number, opts = {}) ⇒ nil

Get the invoice document JSON that is used to render invoice PDF Invoice document JSON that contains all details required to render full Invoice document

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

  • (nil)


1142
1143
1144
1145
# File 'lib/swagger_client/api/billing_api.rb', line 1142

def get_raw_invoice_document_json(invoice_number, opts = {})
  get_raw_invoice_document_json_with_http_info(invoice_number, opts)
  nil
end

#get_raw_invoice_document_json_with_http_info(invoice_number, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get the invoice document JSON that is used to render invoice PDF Invoice document JSON that contains all details required to render full Invoice document

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/swagger_client/api/billing_api.rb', line 1152

def get_raw_invoice_document_json_with_http_info(invoice_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_raw_invoice_document_json ...'
  end
  # verify the required parameter 'invoice_number' is set
  if @api_client.config.client_side_validation && invoice_number.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_number' when calling BillingApi.get_raw_invoice_document_json"
  end
  # resource path
  local_var_path = '/invoices/{invoiceNumber}/documentJson'.sub('{' + 'invoiceNumber' + '}', invoice_number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_raw_invoice_document_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_settlement_application(id, opts = {}) ⇒ SettlementApplication

Get settlement application details Gets the details of specified settlement application.

Parameters:

  • id

    id of the settlement application

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

    the optional parameters

Returns:



1193
1194
1195
1196
# File 'lib/swagger_client/api/billing_api.rb', line 1193

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

#get_settlement_application_with_http_info(id, opts = {}) ⇒ Array<(SettlementApplication, Fixnum, Hash)>

Get settlement application details Gets the details of specified settlement application.

Parameters:

  • id

    id of the settlement application

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

    the optional parameters

Returns:

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

    SettlementApplication data, response status code and response headers



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
1233
1234
1235
1236
1237
1238
1239
# File 'lib/swagger_client/api/billing_api.rb', line 1203

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

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'SettlementApplication')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_settlement_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_settlement_applications(invoice_number, opts = {}) ⇒ Array<SettlementApplication>

Get settlement applications Returns the settlement applications for the specified invoice number.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:



1245
1246
1247
1248
# File 'lib/swagger_client/api/billing_api.rb', line 1245

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

#get_settlement_applications_with_http_info(invoice_number, opts = {}) ⇒ Array<(Array<SettlementApplication>, Fixnum, Hash)>

Get settlement applications Returns the settlement applications for the specified invoice number.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

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

    Array<SettlementApplication> data, response status code and response headers



1255
1256
1257
1258
1259
1260
1261
1262
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
# File 'lib/swagger_client/api/billing_api.rb', line 1255

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

  # query parameters
  query_params = {}
  query_params[:'invoiceNumber'] = invoice_number

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<SettlementApplication>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_settlement_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_charge_alias(alias_id, opts = {}) ⇒ SubscriptionChargeAlias

Get the details of an alias Returns the details of the specified alias id including the subscription id and the charge id it is mapped to.

Parameters:

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

    the optional parameters

Returns:



1298
1299
1300
1301
# File 'lib/swagger_client/api/billing_api.rb', line 1298

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

#get_subscription_charge_alias_with_http_info(alias_id, opts = {}) ⇒ Array<(SubscriptionChargeAlias, Fixnum, Hash)>

Get the details of an alias Returns the details of the specified alias id including the subscription id and the charge id it is mapped to.

Parameters:

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

    the optional parameters

Returns:

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

    SubscriptionChargeAlias data, response status code and response headers



1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/swagger_client/api/billing_api.rb', line 1308

def get_subscription_charge_alias_with_http_info(alias_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_subscription_charge_alias ...'
  end
  # verify the required parameter 'alias_id' is set
  if @api_client.config.client_side_validation && alias_id.nil?
    fail ArgumentError, "Missing the required parameter 'alias_id' when calling BillingApi.get_subscription_charge_alias"
  end
  # resource path
  local_var_path = '/alias/subscriptionCharge/{aliasId}'.sub('{' + 'aliasId' + '}', alias_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'SubscriptionChargeAlias')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_subscription_charge_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_for_subscription_charge(subscription_id, charge_id, opts = {}) ⇒ Array<InvoiceItemJson>

Get usage Returns the usage invoice items for the specified subscription and charge

Parameters:

  • subscription_id

    id of the subscription

  • charge_id

    id of the charge

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

    the optional parameters

Returns:



1351
1352
1353
1354
# File 'lib/swagger_client/api/billing_api.rb', line 1351

def get_usage_for_subscription_charge(subscription_id, charge_id, opts = {})
  data, _status_code, _headers = get_usage_for_subscription_charge_with_http_info(subscription_id, charge_id, opts)
  data
end

#get_usage_for_subscription_charge_with_http_info(subscription_id, charge_id, opts = {}) ⇒ Array<(Array<InvoiceItemJson>, Fixnum, Hash)>

Get usage Returns the usage invoice items for the specified subscription and charge

Parameters:

  • subscription_id

    id of the subscription

  • charge_id

    id of the charge

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

    the optional parameters

Returns:

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

    Array<InvoiceItemJson> data, response status code and response headers



1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
# File 'lib/swagger_client/api/billing_api.rb', line 1362

def get_usage_for_subscription_charge_with_http_info(subscription_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.get_usage_for_subscription_charge ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling BillingApi.get_usage_for_subscription_charge"
  end
  # verify the required parameter 'charge_id' is set
  if @api_client.config.client_side_validation && charge_id.nil?
    fail ArgumentError, "Missing the required parameter 'charge_id' when calling BillingApi.get_usage_for_subscription_charge"
  end
  # resource path
  local_var_path = '/invoices/usage'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = subscription_id
  query_params[:'chargeId'] = charge_id

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<InvoiceItemJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#get_usage_for_subscription_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_aliases_for_subscription(opts = {}) ⇒ Array<SubscriptionChargeAlias>

Get aliases for a subscription Returns all aliases for the specified subscription id.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)

    id of the subscription

Returns:



1410
1411
1412
1413
# File 'lib/swagger_client/api/billing_api.rb', line 1410

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

#list_aliases_for_subscription_with_http_info(opts = {}) ⇒ Array<(Array<SubscriptionChargeAlias>, Fixnum, Hash)>

Get aliases for a subscription Returns all aliases for the specified subscription id.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :subscription_id (String)

    id of the subscription

Returns:

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

    Array<SubscriptionChargeAlias> data, response status code and response headers



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
# File 'lib/swagger_client/api/billing_api.rb', line 1420

def list_aliases_for_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.list_aliases_for_subscription ...'
  end
  # resource path
  local_var_path = '/alias/subscriptionCharge'

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<SubscriptionChargeAlias>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#list_aliases_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_invoice(number, opts = {}) ⇒ InvoiceJson

Mark invoice as posted Marks the specified invoice as posted

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:



1459
1460
1461
1462
# File 'lib/swagger_client/api/billing_api.rb', line 1459

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

#post_invoice_with_http_info(number, opts = {}) ⇒ Array<(InvoiceJson, Fixnum, Hash)>

Mark invoice as posted Marks the specified invoice as posted

Parameters:

  • number

    number of the invoice

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

    the optional parameters

Returns:

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

    InvoiceJson data, response status code and response headers



1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
# File 'lib/swagger_client/api/billing_api.rb', line 1469

def post_invoice_with_http_info(number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.post_invoice ...'
  end
  # verify the required parameter 'number' is set
  if @api_client.config.client_side_validation && number.nil?
    fail ArgumentError, "Missing the required parameter 'number' when calling BillingApi.post_invoice"
  end
  # resource path
  local_var_path = '/invoices/{number}/post'.sub('{' + 'number' + '}', number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#post_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_invoices_for_bulk_invoice_run(bulk_invoice_run_id, opts = {}) ⇒ BulkInvoiceRun

Posts invoices for a bulk run Marks all invoices associated with the specified bulk run as posted

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Options Hash (opts):

  • :body (Array<String>)

Returns:



1512
1513
1514
1515
# File 'lib/swagger_client/api/billing_api.rb', line 1512

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

#post_invoices_for_bulk_invoice_run_with_http_info(bulk_invoice_run_id, opts = {}) ⇒ Array<(BulkInvoiceRun, Fixnum, Hash)>

Posts invoices for a bulk run Marks all invoices associated with the specified bulk run as posted

Parameters:

  • bulk_invoice_run_id

    id of the run

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

    the optional parameters

Options Hash (opts):

  • :body (Array<String>)

Returns:

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

    BulkInvoiceRun data, response status code and response headers



1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
# File 'lib/swagger_client/api/billing_api.rb', line 1523

def post_invoices_for_bulk_invoice_run_with_http_info(bulk_invoice_run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.post_invoices_for_bulk_invoice_run ...'
  end
  # verify the required parameter 'bulk_invoice_run_id' is set
  if @api_client.config.client_side_validation && bulk_invoice_run_id.nil?
    fail ArgumentError, "Missing the required parameter 'bulk_invoice_run_id' when calling BillingApi.post_invoices_for_bulk_invoice_run"
  end
  # resource path
  local_var_path = '/invoices/bulk/{bulkInvoiceRunId}/post'.sub('{' + 'bulkInvoiceRunId' + '}', bulk_invoice_run_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['ApiKeyAuth']
  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 => 'BulkInvoiceRun')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#post_invoices_for_bulk_invoice_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#preview_invoice_by_order_period(subscription_id, opts = {}) ⇒ Array<InvoiceItemJson>

Get unbilled usage Returns the unbilled usage invoice items for the specified subscription

Parameters:

  • subscription_id

    id of the subscription

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

    the optional parameters

Returns:



1565
1566
1567
1568
# File 'lib/swagger_client/api/billing_api.rb', line 1565

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

#preview_invoice_by_order_period1(opts = {}) ⇒ Array<InvoicePreviewJson>

Preview invoices Returns a preview of invoice for the specified order id OR subscription id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    id of order

  • :subscription_id (String)

    id of subscription

Returns:



1619
1620
1621
1622
# File 'lib/swagger_client/api/billing_api.rb', line 1619

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

#preview_invoice_by_order_period1_with_http_info(opts = {}) ⇒ Array<(Array<InvoicePreviewJson>, Fixnum, Hash)>

Preview invoices Returns a preview of invoice for the specified order id OR subscription id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    id of order

  • :subscription_id (String)

    id of subscription

Returns:

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

    Array<InvoicePreviewJson> data, response status code and response headers



1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
# File 'lib/swagger_client/api/billing_api.rb', line 1630

def preview_invoice_by_order_period1_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.preview_invoice_by_order_period1 ...'
  end
  # resource path
  local_var_path = '/invoices/preview'

  # query parameters
  query_params = {}
  query_params[:'orderId'] = opts[:'order_id'] if !opts[:'order_id'].nil?
  query_params[:'subscriptionId'] = opts[:'subscription_id'] if !opts[:'subscription_id'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<InvoicePreviewJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#preview_invoice_by_order_period1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#preview_invoice_by_order_period_with_http_info(subscription_id, opts = {}) ⇒ Array<(Array<InvoiceItemJson>, Fixnum, Hash)>

Get unbilled usage Returns the unbilled usage invoice items for the specified subscription

Parameters:

  • subscription_id

    id of the subscription

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

    the optional parameters

Returns:

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

    Array<InvoiceItemJson> data, response status code and response headers



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
# File 'lib/swagger_client/api/billing_api.rb', line 1575

def preview_invoice_by_order_period_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.preview_invoice_by_order_period ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling BillingApi.preview_invoice_by_order_period"
  end
  # resource path
  local_var_path = '/invoices/unbilledUsage'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = subscription_id

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<InvoiceItemJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#preview_invoice_by_order_period\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_account_receivable_contact(opts = {}) ⇒ nil

Set the contact for accounts receivable Sets the details of the account receivable contact for your tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1670
1671
1672
1673
# File 'lib/swagger_client/api/billing_api.rb', line 1670

def (opts = {})
  (opts)
  nil
end

#put_account_receivable_contact_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Set the contact for accounts receivable Sets the details of the account receivable contact for your tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
# File 'lib/swagger_client/api/billing_api.rb', line 1680

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.put_account_receivable_contact ...'
  end
  # resource path
  local_var_path = '/accountReceivableContact'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'account_receivable_contact_json'])
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#put_account_receivable_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_invoice_reminder(invoice_number, opts = {}) ⇒ nil

Send an Invoice Reminder Sends a reminder email for the specified invoice

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

  • (nil)


1717
1718
1719
1720
# File 'lib/swagger_client/api/billing_api.rb', line 1717

def send_invoice_reminder(invoice_number, opts = {})
  send_invoice_reminder_with_http_info(invoice_number, opts)
  nil
end

#send_invoice_reminder_with_http_info(invoice_number, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send an Invoice Reminder Sends a reminder email for the specified invoice

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1727
1728
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
# File 'lib/swagger_client/api/billing_api.rb', line 1727

def send_invoice_reminder_with_http_info(invoice_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.send_invoice_reminder ...'
  end
  # verify the required parameter 'invoice_number' is set
  if @api_client.config.client_side_validation && invoice_number.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_number' when calling BillingApi.send_invoice_reminder"
  end
  # resource path
  local_var_path = '/dunning/sendInvoiceReminder/{invoiceNumber}'.sub('{' + 'invoiceNumber' + '}', invoice_number.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#send_invoice_reminder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_test_dunning_email(reminder_type, opts = {}) ⇒ nil

Send a test email Sends a test email for dunning to the use associated with this API call. Note A user bound api key is required for this operation.

Parameters:

  • reminder_type

    type of the reminder

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

    the optional parameters

Returns:

  • (nil)


1770
1771
1772
1773
# File 'lib/swagger_client/api/billing_api.rb', line 1770

def send_test_dunning_email(reminder_type, opts = {})
  send_test_dunning_email_with_http_info(reminder_type, opts)
  nil
end

#send_test_dunning_email_with_http_info(reminder_type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send a test email Sends a test email for dunning to the use associated with this API call. Note A user bound api key is required for this operation.

Parameters:

  • reminder_type

    type of the reminder

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
# File 'lib/swagger_client/api/billing_api.rb', line 1780

def send_test_dunning_email_with_http_info(reminder_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.send_test_dunning_email ...'
  end
  # verify the required parameter 'reminder_type' is set
  if @api_client.config.client_side_validation && reminder_type.nil?
    fail ArgumentError, "Missing the required parameter 'reminder_type' when calling BillingApi.send_test_dunning_email"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['WEEK_BEFORE_DUE_DATE', 'DUE_DATE', 'WEEK_AFTER_DUE_DATE', 'TWO_WEEKS_AFTER_DUE_DATE', 'MONTH_AFTER_DUE_DATE', 'TWO_MONTHS_AFTER_DUE_DATE'].include?(reminder_type)
    fail ArgumentError, "invalid value for 'reminder_type', must be one of WEEK_BEFORE_DUE_DATE, DUE_DATE, WEEK_AFTER_DUE_DATE, TWO_WEEKS_AFTER_DUE_DATE, MONTH_AFTER_DUE_DATE, TWO_MONTHS_AFTER_DUE_DATE"
  end
  # resource path
  local_var_path = '/dunning/sendTestEmail/{reminderType}'.sub('{' + 'reminderType' + '}', reminder_type.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#send_test_dunning_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_automated_invoice_rule(id, body, opts = {}) ⇒ nil

Update automated invoice rule details Updates the details of the specified automated invoice rule

Parameters:

  • id

    id of the automated invoice rule

  • body

    automated invoice rule

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

    the optional parameters

Returns:

  • (nil)


1828
1829
1830
1831
# File 'lib/swagger_client/api/billing_api.rb', line 1828

def update_automated_invoice_rule(id, body, opts = {})
  update_automated_invoice_rule_with_http_info(id, body, opts)
  nil
end

#update_automated_invoice_rule_with_http_info(id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update automated invoice rule details Updates the details of the specified automated invoice rule

Parameters:

  • id

    id of the automated invoice rule

  • body

    automated invoice rule

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
1873
1874
1875
1876
1877
1878
# File 'lib/swagger_client/api/billing_api.rb', line 1839

def update_automated_invoice_rule_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.update_automated_invoice_rule ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BillingApi.update_automated_invoice_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.update_automated_invoice_rule"
  end
  # resource path
  local_var_path = '/automatedInvoiceRules/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#update_automated_invoice_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_dunning_setting(opts = {}) ⇒ nil

Update dunning settings Updates the dunning settings for your tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1884
1885
1886
1887
# File 'lib/swagger_client/api/billing_api.rb', line 1884

def update_dunning_setting(opts = {})
  update_dunning_setting_with_http_info(opts)
  nil
end

#update_dunning_setting_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update dunning settings Updates the dunning settings for your tenant

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/swagger_client/api/billing_api.rb', line 1894

def update_dunning_setting_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.update_dunning_setting ...'
  end
  # resource path
  local_var_path = '/dunningSetting'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#update_dunning_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_invoice(number, body, opts = {}) ⇒ InvoiceJson

Update invoice details Updates the details of the specified invoice.

Parameters:

  • number

    number of the invoice

  • body

    json representing invoice details

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

    the optional parameters

Returns:



1932
1933
1934
1935
# File 'lib/swagger_client/api/billing_api.rb', line 1932

def update_invoice(number, body, opts = {})
  data, _status_code, _headers = update_invoice_with_http_info(number, body, opts)
  data
end

#update_invoice_sequence(invoice_config_id, opts = {}) ⇒ TenantInvoiceConfig

Update invoice sequence Updates the invoice sequence by invoice config id.

Parameters:

  • invoice_config_id

    invoice config id

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

    the optional parameters

Options Hash (opts):

  • :next_invoice_number (Integer)

    long integer value

Returns:



1990
1991
1992
1993
# File 'lib/swagger_client/api/billing_api.rb', line 1990

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

#update_invoice_sequence_with_http_info(invoice_config_id, opts = {}) ⇒ Array<(TenantInvoiceConfig, Fixnum, Hash)>

Update invoice sequence Updates the invoice sequence by invoice config id.

Parameters:

  • invoice_config_id

    invoice config id

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

    the optional parameters

Options Hash (opts):

  • :next_invoice_number (Integer)

    long integer value

Returns:

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

    TenantInvoiceConfig data, response status code and response headers



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
# File 'lib/swagger_client/api/billing_api.rb', line 2001

def update_invoice_sequence_with_http_info(invoice_config_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.update_invoice_sequence ...'
  end
  # verify the required parameter 'invoice_config_id' is set
  if @api_client.config.client_side_validation && invoice_config_id.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_config_id' when calling BillingApi.update_invoice_sequence"
  end
  # resource path
  local_var_path = '/invoices/sequence/{invoiceConfigId}'.sub('{' + 'invoiceConfigId' + '}', invoice_config_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'next invoice number'] = opts[:'next_invoice_number'] if !opts[:'next_invoice_number'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'TenantInvoiceConfig')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#update_invoice_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_invoice_with_http_info(number, body, opts = {}) ⇒ Array<(InvoiceJson, Fixnum, Hash)>

Update invoice details Updates the details of the specified invoice.

Parameters:

  • number

    number of the invoice

  • body

    json representing invoice details

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

    the optional parameters

Returns:

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

    InvoiceJson data, response status code and response headers



1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
# File 'lib/swagger_client/api/billing_api.rb', line 1943

def update_invoice_with_http_info(number, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.update_invoice ...'
  end
  # verify the required parameter 'number' is set
  if @api_client.config.client_side_validation && number.nil?
    fail ArgumentError, "Missing the required parameter 'number' when calling BillingApi.update_invoice"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.update_invoice"
  end
  # resource path
  local_var_path = '/invoices/{number}'.sub('{' + 'number' + '}', number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#update_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#void_invoice(number, body, opts = {}) ⇒ InvoiceJson

Mark invoice as voided Marks the specified invoice as voided

Parameters:

  • number

    number of the invoice

  • body

    json representing invoice details

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

    the optional parameters

Returns:



2045
2046
2047
2048
# File 'lib/swagger_client/api/billing_api.rb', line 2045

def void_invoice(number, body, opts = {})
  data, _status_code, _headers = void_invoice_with_http_info(number, body, opts)
  data
end

#void_invoice_with_http_info(number, body, opts = {}) ⇒ Array<(InvoiceJson, Fixnum, Hash)>

Mark invoice as voided Marks the specified invoice as voided

Parameters:

  • number

    number of the invoice

  • body

    json representing invoice details

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

    the optional parameters

Returns:

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

    InvoiceJson data, response status code and response headers



2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
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
# File 'lib/swagger_client/api/billing_api.rb', line 2056

def void_invoice_with_http_info(number, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BillingApi.void_invoice ...'
  end
  # verify the required parameter 'number' is set
  if @api_client.config.client_side_validation && number.nil?
    fail ArgumentError, "Missing the required parameter 'number' when calling BillingApi.void_invoice"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling BillingApi.void_invoice"
  end
  # resource path
  local_var_path = '/invoices/{number}/void'.sub('{' + 'number' + '}', number.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  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 => 'InvoiceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BillingApi#void_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end