Class: TripletexRubyClient::OrderApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_ruby_client/api/order_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrderApi

Returns a new instance of OrderApi.



19
20
21
# File 'lib/tripletex_ruby_client/api/order_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/tripletex_ruby_client/api/order_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#approve_subscription_invoice(id, invoice_date, opts = {}) ⇒ ResponseWrapperInvoice

To create a subscription invoice, first create a order with the subscription enabled, then approve it with this method. This approves the order for subscription invoicing.

Parameters:

  • id

    ID of order to approve for subscription invoicing.

  • invoice_date

    The approval date for the subscription.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 28

def approve_subscription_invoice(id, invoice_date, opts = {})
  data, _status_code, _headers = approve_subscription_invoice_with_http_info(id, invoice_date, opts)
  data
end

#approve_subscription_invoice_with_http_info(id, invoice_date, opts = {}) ⇒ Array<(ResponseWrapperInvoice, Fixnum, Hash)>

To create a subscription invoice, first create a order with the subscription enabled, then approve it with this method. This approves the order for subscription invoicing.

Parameters:

  • id

    ID of order to approve for subscription invoicing.

  • invoice_date

    The approval date for the subscription.

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

    the optional parameters

Returns:

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

    ResponseWrapperInvoice data, response status code and response headers



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

def approve_subscription_invoice_with_http_info(id, invoice_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.approve_subscription_invoice ...'
  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 OrderApi.approve_subscription_invoice"
  end
  # verify the required parameter 'invoice_date' is set
  if @api_client.config.client_side_validation && invoice_date.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_date' when calling OrderApi.approve_subscription_invoice"
  end
  # resource path
  local_var_path = '/order/{id}/:approveSubscriptionInvoice'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'invoiceDate'] = invoice_date

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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

#attach(file, id, opts = {}) ⇒ ResponseWrapperDocumentArchive

Attach document to specified order ID.

Parameters:

  • file

    The file

  • id

    Element ID

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

    the optional parameters

Returns:



85
86
87
88
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 85

def attach(file, id, opts = {})
  data, _status_code, _headers = attach_with_http_info(file, id, opts)
  data
end

#attach_with_http_info(file, id, opts = {}) ⇒ Array<(ResponseWrapperDocumentArchive, Fixnum, Hash)>

Attach document to specified order ID.

Parameters:

  • file

    The file

  • id

    Element ID

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

    the optional parameters

Returns:



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
128
129
130
131
132
133
134
135
136
137
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 96

def attach_with_http_info(file, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.attach ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling OrderApi.attach"
  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 OrderApi.attach"
  end
  # resource path
  local_var_path = '/order/{id}/:attach'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file

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

#get(id, opts = {}) ⇒ ResponseWrapperOrder

Get order by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



144
145
146
147
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 144

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

#get_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperOrder, Fixnum, Hash)>

Get order by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:

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

    ResponseWrapperOrder data, response status code and response headers



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
185
186
187
188
189
190
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 155

def get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.get ...'
  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 OrderApi.get"
  end
  # resource path
  local_var_path = '/order/{id}'.sub('{' + 'id' + '}', id.to_s)

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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

#invoice(id, invoice_date, opts = {}) ⇒ ResponseWrapperInvoice

Create new invoice from order.

Parameters:

  • id

    ID of order to invoice.

  • invoice_date

    The invoice date

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

    the optional parameters

Options Hash (opts):

  • :send_to_customer (BOOLEAN)

    Send invoice to customer (default to true)

  • :payment_type_id (Integer)

    Payment type to register prepayment of the invoice. paymentTypeId and paidAmount are optional, but both must be provided if the invoice has already been paid. The payment type must be related to an account with the same currency as the invoice.

  • :paid_amount (Float)

    Paid amount to register prepayment of the invoice, in invoice currency. paymentTypeId and paidAmount are optional, but both must be provided if the invoice has already been paid. This amount is in the invoice currency.

  • :paid_amount_account_currency (Float)

    Amount paid in payment type currency

  • :payment_type_id_rest_amount (Integer)

    Payment type of rest amount. It is possible to have two prepaid payments when invoicing. If paymentTypeIdRestAmount &gt; 0, this second payment will be calculated as invoice amount - paidAmount

  • :paid_amount_account_currency_rest (Float)

    Amount rest in payment type currency

  • :create_on_account (String)

    Create on account(a konto)

  • :amount_on_account (Float)

    Amount on account (default to 0.0)

  • :on_account_comment (String)

    On account comment

  • :create_backorder (BOOLEAN)

    Create a backorder for this order, available only for pilot users (default to false)

Returns:



207
208
209
210
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 207

def invoice(id, invoice_date, opts = {})
  data, _status_code, _headers = invoice_with_http_info(id, invoice_date, opts)
  data
end

#invoice_multiple_orders(id, invoice_date, opts = {}) ⇒ ResponseWrapperInvoice

BETA

Charges a single customer invoice from multiple orders. The orders must be to the same customer, currency, due date, receiver email and attn.

Parameters:

  • id

    List of Order IDs - to the same customer, separated by comma.

  • invoice_date

    The invoice date

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

    the optional parameters

Returns:



287
288
289
290
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 287

def invoice_multiple_orders(id, invoice_date, opts = {})
  data, _status_code, _headers = invoice_multiple_orders_with_http_info(id, invoice_date, opts)
  data
end

#invoice_multiple_orders_with_http_info(id, invoice_date, opts = {}) ⇒ Array<(ResponseWrapperInvoice, Fixnum, Hash)>

BETA

Charges a single customer invoice from multiple orders. The orders must be to the same customer, currency, due date, receiver email and attn.

Parameters:

  • id

    List of Order IDs - to the same customer, separated by comma.

  • invoice_date

    The invoice date

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

    the optional parameters

Returns:

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

    ResponseWrapperInvoice data, response status code and response headers



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 298

def invoice_multiple_orders_with_http_info(id, invoice_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.invoice_multiple_orders ...'
  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 OrderApi.invoice_multiple_orders"
  end
  # verify the required parameter 'invoice_date' is set
  if @api_client.config.client_side_validation && invoice_date.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_date' when calling OrderApi.invoice_multiple_orders"
  end
  # resource path
  local_var_path = '/order/:invoiceMultipleOrders'

  # query parameters
  query_params = {}
  query_params[:'id'] = id
  query_params[:'invoiceDate'] = invoice_date

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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

#invoice_with_http_info(id, invoice_date, opts = {}) ⇒ Array<(ResponseWrapperInvoice, Fixnum, Hash)>

Create new invoice from order.

Parameters:

  • id

    ID of order to invoice.

  • invoice_date

    The invoice date

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

    the optional parameters

Options Hash (opts):

  • :send_to_customer (BOOLEAN)

    Send invoice to customer

  • :payment_type_id (Integer)

    Payment type to register prepayment of the invoice. paymentTypeId and paidAmount are optional, but both must be provided if the invoice has already been paid. The payment type must be related to an account with the same currency as the invoice.

  • :paid_amount (Float)

    Paid amount to register prepayment of the invoice, in invoice currency. paymentTypeId and paidAmount are optional, but both must be provided if the invoice has already been paid. This amount is in the invoice currency.

  • :paid_amount_account_currency (Float)

    Amount paid in payment type currency

  • :payment_type_id_rest_amount (Integer)

    Payment type of rest amount. It is possible to have two prepaid payments when invoicing. If paymentTypeIdRestAmount &gt; 0, this second payment will be calculated as invoice amount - paidAmount

  • :paid_amount_account_currency_rest (Float)

    Amount rest in payment type currency

  • :create_on_account (String)

    Create on account(a konto)

  • :amount_on_account (Float)

    Amount on account

  • :on_account_comment (String)

    On account comment

  • :create_backorder (BOOLEAN)

    Create a backorder for this order, available only for pilot users

Returns:

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

    ResponseWrapperInvoice data, response status code and response headers



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 228

def invoice_with_http_info(id, invoice_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.invoice ...'
  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 OrderApi.invoice"
  end
  # verify the required parameter 'invoice_date' is set
  if @api_client.config.client_side_validation && invoice_date.nil?
    fail ArgumentError, "Missing the required parameter 'invoice_date' when calling OrderApi.invoice"
  end
  if @api_client.config.client_side_validation && opts[:'create_on_account'] && !['NONE', 'WITH_VAT', 'WITHOUT_VAT'].include?(opts[:'create_on_account'])
    fail ArgumentError, 'invalid value for "create_on_account", must be one of NONE, WITH_VAT, WITHOUT_VAT'
  end
  # resource path
  local_var_path = '/order/{id}/:invoice'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'invoiceDate'] = invoice_date
  query_params[:'sendToCustomer'] = opts[:'send_to_customer'] if !opts[:'send_to_customer'].nil?
  query_params[:'paymentTypeId'] = opts[:'payment_type_id'] if !opts[:'payment_type_id'].nil?
  query_params[:'paidAmount'] = opts[:'paid_amount'] if !opts[:'paid_amount'].nil?
  query_params[:'paidAmountAccountCurrency'] = opts[:'paid_amount_account_currency'] if !opts[:'paid_amount_account_currency'].nil?
  query_params[:'paymentTypeIdRestAmount'] = opts[:'payment_type_id_rest_amount'] if !opts[:'payment_type_id_rest_amount'].nil?
  query_params[:'paidAmountAccountCurrencyRest'] = opts[:'paid_amount_account_currency_rest'] if !opts[:'paid_amount_account_currency_rest'].nil?
  query_params[:'createOnAccount'] = opts[:'create_on_account'] if !opts[:'create_on_account'].nil?
  query_params[:'amountOnAccount'] = opts[:'amount_on_account'] if !opts[:'amount_on_account'].nil?
  query_params[:'onAccountComment'] = opts[:'on_account_comment'] if !opts[:'on_account_comment'].nil?
  query_params[:'createBackorder'] = opts[:'create_backorder'] if !opts[:'create_backorder'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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

#post(opts = {}) ⇒ ResponseWrapperOrder

Create order.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Order)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:



344
345
346
347
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 344

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

#post_list(opts = {}) ⇒ ListResponseOrder

BETA

Create multiple Orders with OrderLines. Max 100 at a time.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Array<Order>)

    JSON representing a list of new object to be created. Should not have ID and version set.

Returns:



392
393
394
395
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 392

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

#post_list_with_http_info(opts = {}) ⇒ Array<(ListResponseOrder, Fixnum, Hash)>

BETA

Create multiple Orders with OrderLines. Max 100 at a time.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Array<Order>)

    JSON representing a list of new object to be created. Should not have ID and version set.

Returns:

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

    ListResponseOrder data, response status code and response headers



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 402

def post_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.post_list ...'
  end
  # resource path
  local_var_path = '/order/list'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#post_with_http_info(opts = {}) ⇒ Array<(ResponseWrapperOrder, Fixnum, Hash)>

Create order.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (Order)

    JSON representing the new object to be created. Should not have ID and version set.

Returns:

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

    ResponseWrapperOrder data, response status code and response headers



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 354

def post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.post ...'
  end
  # resource path
  local_var_path = '/order'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#put(id, opts = {}) ⇒ ResponseWrapperOrder

Update order.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :body (Order)

    Partial object describing what should be updated

Returns:



441
442
443
444
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 441

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

#put_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperOrder, Fixnum, Hash)>

Update order.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :body (Order)

    Partial object describing what should be updated

Returns:

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

    ResponseWrapperOrder data, response status code and response headers



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 452

def put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.put ...'
  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 OrderApi.put"
  end
  # resource path
  local_var_path = '/order/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

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

#search(order_date_from, order_date_to, opts = {}) ⇒ ListResponseOrder

Find orders corresponding with sent data.

Parameters:

  • order_date_from

    From and including

  • order_date_to

    To and excluding

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    List of IDs

  • :number (String)

    Equals

  • :customer_id (String)

    List of IDs

  • :is_closed (BOOLEAN)

    Equals

  • :is_subscription (BOOLEAN)

    Equals

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



504
505
506
507
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 504

def search(order_date_from, order_date_to, opts = {})
  data, _status_code, _headers = search_with_http_info(order_date_from, order_date_to, opts)
  data
end

#search_with_http_info(order_date_from, order_date_to, opts = {}) ⇒ Array<(ListResponseOrder, Fixnum, Hash)>

Find orders corresponding with sent data.

Parameters:

  • order_date_from

    From and including

  • order_date_to

    To and excluding

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

    the optional parameters

Options Hash (opts):

  • :id (String)

    List of IDs

  • :number (String)

    Equals

  • :customer_id (String)

    List of IDs

  • :is_closed (BOOLEAN)

    Equals

  • :is_subscription (BOOLEAN)

    Equals

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

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

    ListResponseOrder data, response status code and response headers



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

def search_with_http_info(order_date_from, order_date_to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.search ...'
  end
  # verify the required parameter 'order_date_from' is set
  if @api_client.config.client_side_validation && order_date_from.nil?
    fail ArgumentError, "Missing the required parameter 'order_date_from' when calling OrderApi.search"
  end
  # verify the required parameter 'order_date_to' is set
  if @api_client.config.client_side_validation && order_date_to.nil?
    fail ArgumentError, "Missing the required parameter 'order_date_to' when calling OrderApi.search"
  end
  # resource path
  local_var_path = '/order'

  # query parameters
  query_params = {}
  query_params[:'orderDateFrom'] = order_date_from
  query_params[:'orderDateTo'] = order_date_to
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?
  query_params[:'customerId'] = opts[:'customer_id'] if !opts[:'customer_id'].nil?
  query_params[:'isClosed'] = opts[:'is_closed'] if !opts[:'is_closed'].nil?
  query_params[:'isSubscription'] = opts[:'is_subscription'] if !opts[:'is_subscription'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

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

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

Unapproves the order for subscription invoicing.

Parameters:

  • id

    ID of order to unapprove for subscription invoicing.

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

    the optional parameters

Returns:

  • (nil)


579
580
581
582
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 579

def un_approve_subscription_invoice(id, opts = {})
  un_approve_subscription_invoice_with_http_info(id, opts)
  nil
end

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

Unapproves the order for subscription invoicing.

Parameters:

  • id

    ID of order to unapprove for subscription invoicing.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
615
616
617
618
619
620
621
622
# File 'lib/tripletex_ruby_client/api/order_api.rb', line 589

def un_approve_subscription_invoice_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.un_approve_subscription_invoice ...'
  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 OrderApi.un_approve_subscription_invoice"
  end
  # resource path
  local_var_path = '/order/{id}/:unApproveSubscriptionInvoice'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['tokenAuthScheme']
  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: OrderApi#un_approve_subscription_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end