Class: SwaggerClient::CreditMemoApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CreditMemoApi

Returns a new instance of CreditMemoApi.



19
20
21
# File 'lib/swagger_client/api/credit_memo_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/credit_memo_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#convert_negative_draft_invoice(invoice_number, opts = {}) ⇒ CreditMemoJson

Convert invoice to credit memo Converts the specified invoice to a credit memo. Note the invoice must be in DRAFT status and have a negative balance.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:



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

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

#convert_negative_draft_invoice_with_http_info(invoice_number, opts = {}) ⇒ Array<(CreditMemoJson, Fixnum, Hash)>

Convert invoice to credit memo Converts the specified invoice to a credit memo. Note the invoice must be in DRAFT status and have a negative balance.

Parameters:

  • invoice_number

    number of the invoice

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

    the optional parameters

Returns:

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

    CreditMemoJson 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
# File 'lib/swagger_client/api/credit_memo_api.rb', line 37

def convert_negative_draft_invoice_with_http_info(invoice_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.convert_negative_draft_invoice ...'
  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 CreditMemoApi.convert_negative_draft_invoice"
  end
  # resource path
  local_var_path = '/creditmemos/convert/{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'])

  # 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,
    :return_type => 'CreditMemoJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#convert_negative_draft_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_credit_memo_document(credit_memo_number, opts = {}) ⇒ nil

Create a credit memo document Creates a pdf version of the credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

  • (nil)


79
80
81
82
# File 'lib/swagger_client/api/credit_memo_api.rb', line 79

def create_credit_memo_document(credit_memo_number, opts = {})
  create_credit_memo_document_with_http_info(credit_memo_number, opts)
  nil
end

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

Create a credit memo document Creates a pdf version of the credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



89
90
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
# File 'lib/swagger_client/api/credit_memo_api.rb', line 89

def create_credit_memo_document_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.create_credit_memo_document ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.create_credit_memo_document"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}/pdf'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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: CreditMemoApi#create_credit_memo_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_standalone_credit_memo(opts = {}) ⇒ String

Create a standalone credit memo Creates a standalone credit memo for a specified account. On success the number of the new memo is returned

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (String)


130
131
132
133
# File 'lib/swagger_client/api/credit_memo_api.rb', line 130

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

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

Create a standalone credit memo Creates a standalone credit memo for a specified account. On success the number of the new memo is returned

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    String data, response status code and response headers



140
141
142
143
144
145
146
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
# File 'lib/swagger_client/api/credit_memo_api.rb', line 140

def create_standalone_credit_memo_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.create_standalone_credit_memo ...'
  end
  # resource path
  local_var_path = '/creditmemos'

  # 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(: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: CreditMemoApi#create_standalone_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_credit_memo(credit_memo_number, opts = {}) ⇒ CreditMemoJson

Delete a credit memo Deletes the specified credit memo. The credit memo must be in DRAFT status

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:



178
179
180
181
# File 'lib/swagger_client/api/credit_memo_api.rb', line 178

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

#delete_credit_memo_with_http_info(credit_memo_number, opts = {}) ⇒ Array<(CreditMemoJson, Fixnum, Hash)>

Delete a credit memo Deletes the specified credit memo. The credit memo must be in DRAFT status

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    CreditMemoJson data, response status code and response headers



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/swagger_client/api/credit_memo_api.rb', line 188

def delete_credit_memo_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.delete_credit_memo ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.delete_credit_memo"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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 => 'CreditMemoJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#delete_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_balance(credit_memo_number, opts = {}) ⇒ CreditMemoBalanceJson

Get credit memo balance Gets the balance of the specified credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:



230
231
232
233
# File 'lib/swagger_client/api/credit_memo_api.rb', line 230

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

#get_credit_balance_with_http_info(credit_memo_number, opts = {}) ⇒ Array<(CreditMemoBalanceJson, Fixnum, Hash)>

Get credit memo balance Gets the balance of the specified credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    CreditMemoBalanceJson data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/swagger_client/api/credit_memo_api.rb', line 240

def get_credit_balance_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.get_credit_balance ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.get_credit_balance"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}/balance'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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 => 'CreditMemoBalanceJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#get_credit_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_memo(credit_memo_number, opts = {}) ⇒ CreditMemoJson

Get credit memo details Returns the details of the specified credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:



282
283
284
285
# File 'lib/swagger_client/api/credit_memo_api.rb', line 282

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

#get_credit_memo_configuration(opts = {}) ⇒ TenantCreditMemoConfigurationJson

Get credit memo configuration for the tenant Returns the credit memo configuration for your tenant

Parameters:

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

    the optional parameters

Returns:



333
334
335
336
# File 'lib/swagger_client/api/credit_memo_api.rb', line 333

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

#get_credit_memo_configuration_with_http_info(opts = {}) ⇒ Array<(TenantCreditMemoConfigurationJson, Fixnum, Hash)>

Get credit memo configuration for the tenant Returns the credit memo configuration for your tenant

Parameters:

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

    the optional parameters

Returns:



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/swagger_client/api/credit_memo_api.rb', line 342

def get_credit_memo_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.get_credit_memo_configuration ...'
  end
  # resource path
  local_var_path = '/creditmemos/configuration'

  # 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 => 'TenantCreditMemoConfigurationJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#get_credit_memo_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_memo_document_pdf(credit_memo_number, opts = {}) ⇒ nil

Download credit memo pdf Downloads the pdf version of the credit memo. Note the credit memo must already have been created. If the credit memo is still in the process of being created, HTTP 202 is returned.

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

  • (nil)


380
381
382
383
# File 'lib/swagger_client/api/credit_memo_api.rb', line 380

def get_credit_memo_document_pdf(credit_memo_number, opts = {})
  get_credit_memo_document_pdf_with_http_info(credit_memo_number, opts)
  nil
end

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

Download credit memo pdf Downloads the pdf version of the credit memo. Note the credit memo must already have been created. If the credit memo is still in the process of being created, HTTP 202 is returned.

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/swagger_client/api/credit_memo_api.rb', line 390

def get_credit_memo_document_pdf_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.get_credit_memo_document_pdf ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.get_credit_memo_document_pdf"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}/pdf'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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: CreditMemoApi#get_credit_memo_document_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_memo_for_account(opts = {}) ⇒ CreditMemoPaginationResponseJson

Get credit memos for an account Returns a paginated list of credit memos for the specified account. Pass the cursor returned to subsequent calls to retrieve all data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    id of the account

  • :cursor (String)

    cursor used to move the pages

  • :limit (Integer)

    number of results per page

Returns:



433
434
435
436
# File 'lib/swagger_client/api/credit_memo_api.rb', line 433

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

#get_credit_memo_for_account_with_http_info(opts = {}) ⇒ Array<(CreditMemoPaginationResponseJson, Fixnum, Hash)>

Get credit memos for an account Returns a paginated list of credit memos for the specified account. Pass the cursor returned to subsequent calls to retrieve all data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    id of the account

  • :cursor (String)

    cursor used to move the pages

  • :limit (Integer)

    number of results per page

Returns:



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

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

  # query parameters
  query_params = {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].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 => 'CreditMemoPaginationResponseJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#get_credit_memo_for_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credit_memo_with_http_info(credit_memo_number, opts = {}) ⇒ Array<(CreditMemoJson, Fixnum, Hash)>

Get credit memo details Returns the details of the specified credit memo

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    CreditMemoJson data, response status code and response headers



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/swagger_client/api/credit_memo_api.rb', line 292

def get_credit_memo_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.get_credit_memo ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.get_credit_memo"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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 => 'CreditMemoJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#get_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_credit_memo(credit_memo_number, opts = {}) ⇒ CreditMemoJson

Post a credit memo Sets the status of the specified credit memo to POSTED

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:



486
487
488
489
# File 'lib/swagger_client/api/credit_memo_api.rb', line 486

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

#post_credit_memo_with_http_info(credit_memo_number, opts = {}) ⇒ Array<(CreditMemoJson, Fixnum, Hash)>

Post a credit memo Sets the status of the specified credit memo to POSTED

Parameters:

  • credit_memo_number

    number of the credit memo

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

    the optional parameters

Returns:

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

    CreditMemoJson data, response status code and response headers



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/swagger_client/api/credit_memo_api.rb', line 496

def post_credit_memo_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.post_credit_memo ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.post_credit_memo"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}/post'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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 => 'CreditMemoJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#post_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_credit_memo_configuration(opts = {}) ⇒ TenantCreditMemoConfigurationJson

Update credit memo configuration Updates the credit memo configuration for you tenant.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



538
539
540
541
# File 'lib/swagger_client/api/credit_memo_api.rb', line 538

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

#update_credit_memo_configuration_with_http_info(opts = {}) ⇒ Array<(TenantCreditMemoConfigurationJson, Fixnum, Hash)>

Update credit memo configuration Updates the credit memo configuration for you tenant.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/swagger_client/api/credit_memo_api.rb', line 548

def update_credit_memo_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.update_credit_memo_configuration ...'
  end
  # resource path
  local_var_path = '/creditmemos/configuration'

  # 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(: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 => 'TenantCreditMemoConfigurationJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#update_credit_memo_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_draft_credit_memo(credit_memo_number, opts = {}) ⇒ CreditMemoJson

Update a credit memo Updates the details of a credit memo in DRAFT status

Parameters:

  • credit_memo_number

    credit memo number

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

    the optional parameters

Options Hash (opts):

Returns:



587
588
589
590
# File 'lib/swagger_client/api/credit_memo_api.rb', line 587

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

#update_draft_credit_memo_with_http_info(credit_memo_number, opts = {}) ⇒ Array<(CreditMemoJson, Fixnum, Hash)>

Update a credit memo Updates the details of a credit memo in DRAFT status

Parameters:

  • credit_memo_number

    credit memo number

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

    the optional parameters

Options Hash (opts):

Returns:

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

    CreditMemoJson data, response status code and response headers



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

def update_draft_credit_memo_with_http_info(credit_memo_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CreditMemoApi.update_draft_credit_memo ...'
  end
  # verify the required parameter 'credit_memo_number' is set
  if @api_client.config.client_side_validation && credit_memo_number.nil?
    fail ArgumentError, "Missing the required parameter 'credit_memo_number' when calling CreditMemoApi.update_draft_credit_memo"
  end
  # resource path
  local_var_path = '/creditmemos/{creditMemoNumber}'.sub('{' + 'creditMemoNumber' + '}', credit_memo_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(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 => 'CreditMemoJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CreditMemoApi#update_draft_credit_memo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end