Class: UltracartClient::OrderApi

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

Instance Attribute Summary collapse

Class Method 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/ultracart_api/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/ultracart_api/api/order_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/order_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::OrderApi.new(api_client)
end

Instance Method Details

#adjust_order_total(order_id, desired_total, opts = {}) ⇒ BaseResponse

Adjusts an order total Adjusts an order total. Adjusts individual items appropriately and considers taxes. Desired total should be provided in the same currency as the order and must be less than the current total and greater than zero. This call will change the order total. It returns true if the desired total is achieved. If the goal seeking algorithm falls short (usually by pennies), this method returns back false. View the merchant notes for the order for further details.

Parameters:

  • order_id (String)

    The order id to cancel.

  • desired_total (String)

    The desired total with no formatting. example 123.45

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

    the optional parameters

Returns:



41
42
43
44
# File 'lib/ultracart_api/api/order_api.rb', line 41

def adjust_order_total(order_id, desired_total, opts = {})
  data, _status_code, _headers = adjust_order_total_with_http_info(order_id, desired_total, opts)
  data
end

#adjust_order_total_with_http_info(order_id, desired_total, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Adjusts an order total Adjusts an order total. Adjusts individual items appropriately and considers taxes. Desired total should be provided in the same currency as the order and must be less than the current total and greater than zero. This call will change the order total. It returns true if the desired total is achieved. If the goal seeking algorithm falls short (usually by pennies), this method returns back false. View the merchant notes for the order for further details.

Parameters:

  • order_id (String)

    The order id to cancel.

  • desired_total (String)

    The desired total with no formatting. example 123.45

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

    the optional parameters

Returns:

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

    BaseResponse data, response status code and response headers



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/ultracart_api/api/order_api.rb', line 52

def adjust_order_total_with_http_info(order_id, desired_total, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.adjust_order_total ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.adjust_order_total"
  end
  # verify the required parameter 'desired_total' is set
  if @api_client.config.client_side_validation && desired_total.nil?
    fail ArgumentError, "Missing the required parameter 'desired_total' when calling OrderApi.adjust_order_total"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/adjust_order_total/{desired_total}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)).sub('{' + 'desired_total' + '}', CGI.escape(desired_total.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.adjust_order_total",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#adjust_order_total\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#assign_to_affiliate(order_id, assign_to_affiliate_request, opts = {}) ⇒ OrderResponse

Assigns an order to an affiliate Assigns an order to an affiliate.

Parameters:

  • order_id (String)

    The order id to assign to the affiliate.

  • assign_to_affiliate_request (OrderAssignToAffiliateRequest)

    Assign to affiliate request

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



112
113
114
115
# File 'lib/ultracart_api/api/order_api.rb', line 112

def assign_to_affiliate(order_id, assign_to_affiliate_request, opts = {})
  data, _status_code, _headers = assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts)
  data
end

#assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Assigns an order to an affiliate Assigns an order to an affiliate.

Parameters:

  • order_id (String)

    The order id to assign to the affiliate.

  • assign_to_affiliate_request (OrderAssignToAffiliateRequest)

    Assign to affiliate request

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/ultracart_api/api/order_api.rb', line 124

def assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.assign_to_affiliate ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.assign_to_affiliate"
  end
  # verify the required parameter 'assign_to_affiliate_request' is set
  if @api_client.config.client_side_validation && assign_to_affiliate_request.nil?
    fail ArgumentError, "Missing the required parameter 'assign_to_affiliate_request' when calling OrderApi.assign_to_affiliate"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/assignToAffiliate'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(assign_to_affiliate_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.assign_to_affiliate",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#assign_to_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#block_refund_on_order(order_id, opts = {}) ⇒ nil

Set a refund block on an order Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.

Parameters:

  • order_id (String)

    The order id to block a refund on.

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

    the optional parameters

Options Hash (opts):

  • :block_reason (String)

    Block reason code (optional)

Returns:

  • (nil)


189
190
191
192
# File 'lib/ultracart_api/api/order_api.rb', line 189

def block_refund_on_order(order_id, opts = {})
  block_refund_on_order_with_http_info(order_id, opts)
  nil
end

#block_refund_on_order_with_http_info(order_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Set a refund block on an order Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.

Parameters:

  • order_id (String)

    The order id to block a refund on.

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

    the optional parameters

Options Hash (opts):

  • :block_reason (String)

    Block reason code (optional)

Returns:

  • (Array<(nil, Integer, 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
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/ultracart_api/api/order_api.rb', line 200

def block_refund_on_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.block_refund_on_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.block_refund_on_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/refund_block'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.block_refund_on_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#block_refund_on_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_order(order_id, opts = {}) ⇒ BaseResponse

Cancel an order Cancel an order on the UltraCart account. If the success flag is false, then consult the error message for why it failed.

Parameters:

  • order_id (String)

    The order id to cancel.

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

    the optional parameters

Options Hash (opts):

  • :lock_self_ship_orders (Boolean)

    Flag to prevent a order shipping during a refund process

  • :skip_refund_and_hold (Boolean)

    Skip refund and move order to Held Orders department

Returns:



257
258
259
260
# File 'lib/ultracart_api/api/order_api.rb', line 257

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

#cancel_order_with_http_info(order_id, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Cancel an order Cancel an order on the UltraCart account. If the success flag is false, then consult the error message for why it failed.

Parameters:

  • order_id (String)

    The order id to cancel.

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

    the optional parameters

Options Hash (opts):

  • :lock_self_ship_orders (Boolean)

    Flag to prevent a order shipping during a refund process

  • :skip_refund_and_hold (Boolean)

    Skip refund and move order to Held Orders department

Returns:

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

    BaseResponse data, response status code and response headers



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/ultracart_api/api/order_api.rb', line 269

def cancel_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.cancel_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.cancel_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/cancel'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.cancel_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#cancel_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_order(order_id, opts = {}) ⇒ nil

Delete an order Delete an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to delete.

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

    the optional parameters

Returns:

  • (nil)


325
326
327
328
# File 'lib/ultracart_api/api/order_api.rb', line 325

def delete_order(order_id, opts = {})
  delete_order_with_http_info(order_id, opts)
  nil
end

#delete_order_with_http_info(order_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an order Delete an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/ultracart_api/api/order_api.rb', line 335

def delete_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.delete_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.delete_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.delete_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#duplicate_order(order_id, opts = {}) ⇒ OrderResponse

Duplicate an order Perform a duplicate of the specified order_id and return a new order located in Accounts Receivable.

Parameters:

  • order_id (String)

    The order id to duplicate.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



390
391
392
393
# File 'lib/ultracart_api/api/order_api.rb', line 390

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

#duplicate_order_with_http_info(order_id, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Duplicate an order Perform a duplicate of the specified order_id and return a new order located in Accounts Receivable.

Parameters:

  • order_id (String)

    The order id to duplicate.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/ultracart_api/api/order_api.rb', line 401

def duplicate_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.duplicate_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.duplicate_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/duplicate'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.duplicate_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#duplicate_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#format(order_id, format_options, opts = {}) ⇒ OrderFormatResponse

Format order Format the order for display at text or html

Parameters:

  • order_id (String)

    The order id to format

  • format_options (OrderFormat)

    Format options

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

    the optional parameters

Returns:



457
458
459
460
# File 'lib/ultracart_api/api/order_api.rb', line 457

def format(order_id, format_options, opts = {})
  data, _status_code, _headers = format_with_http_info(order_id, format_options, opts)
  data
end

#format_with_http_info(order_id, format_options, opts = {}) ⇒ Array<(OrderFormatResponse, Integer, Hash)>

Format order Format the order for display at text or html

Parameters:

  • order_id (String)

    The order id to format

  • format_options (OrderFormat)

    Format options

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

    the optional parameters

Returns:

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

    OrderFormatResponse data, response status code and response headers



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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/ultracart_api/api/order_api.rb', line 468

def format_with_http_info(order_id, format_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.format ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.format"
  end
  # verify the required parameter 'format_options' is set
  if @api_client.config.client_side_validation && format_options.nil?
    fail ArgumentError, "Missing the required parameter 'format_options' when calling OrderApi.format"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/format'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(format_options)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderFormatResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.format",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_invoice(order_id, opts = {}) ⇒ OrderInvoiceResponse

Generate an invoice for this order. The invoice PDF that is returned is base 64 encoded

Parameters:

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:



531
532
533
534
# File 'lib/ultracart_api/api/order_api.rb', line 531

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

#generate_invoice_with_http_info(order_id, opts = {}) ⇒ Array<(OrderInvoiceResponse, Integer, Hash)>

Generate an invoice for this order. The invoice PDF that is returned is base 64 encoded

Parameters:

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:

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

    OrderInvoiceResponse data, response status code and response headers



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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/ultracart_api/api/order_api.rb', line 541

def generate_invoice_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.generate_invoice ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.generate_invoice"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/invoice'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderInvoiceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.generate_invoice",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#generate_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_order_token(order_id, opts = {}) ⇒ OrderTokenResponse

Generate an order token for a given order id Retrieves a single order token for a given order id. The token can be used with the getOrderByToken API.

Parameters:

  • order_id (String)

    The order id to generate a token for.

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

    the optional parameters

Returns:



595
596
597
598
# File 'lib/ultracart_api/api/order_api.rb', line 595

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

#generate_order_token_with_http_info(order_id, opts = {}) ⇒ Array<(OrderTokenResponse, Integer, Hash)>

Generate an order token for a given order id Retrieves a single order token for a given order id. The token can be used with the getOrderByToken API.

Parameters:

  • order_id (String)

    The order id to generate a token for.

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

    the optional parameters

Returns:

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

    OrderTokenResponse data, response status code and response headers



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/ultracart_api/api/order_api.rb', line 605

def generate_order_token_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.generate_order_token ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.generate_order_token"
  end
  # resource path
  local_var_path = '/order/orders/token/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderTokenResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.generate_order_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#generate_order_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_packing_slip_all_dc(order_id, opts = {}) ⇒ OrderPackingSlipResponse

Generate a packing slip for this order across all distribution centers. The packing slip PDF that is returned is base 64 encoded

Parameters:

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:



659
660
661
662
# File 'lib/ultracart_api/api/order_api.rb', line 659

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

#generate_packing_slip_all_dc_with_http_info(order_id, opts = {}) ⇒ Array<(OrderPackingSlipResponse, Integer, Hash)>

Generate a packing slip for this order across all distribution centers. The packing slip PDF that is returned is base 64 encoded

Parameters:

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:

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

    OrderPackingSlipResponse data, response status code and response headers



669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/ultracart_api/api/order_api.rb', line 669

def generate_packing_slip_all_dc_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.generate_packing_slip_all_dc ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.generate_packing_slip_all_dc"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/packing_slip'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderPackingSlipResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.generate_packing_slip_all_dc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#generate_packing_slip_all_dc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_packing_slip_specific_dc(distribution_center_code, order_id, opts = {}) ⇒ OrderPackingSlipResponse

Generate a packing slip for this order for the given distribution center. The packing slip PDF that is returned is base 64 encoded

Parameters:

  • distribution_center_code (String)

    Distribution center code

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:



724
725
726
727
# File 'lib/ultracart_api/api/order_api.rb', line 724

def generate_packing_slip_specific_dc(distribution_center_code, order_id, opts = {})
  data, _status_code, _headers = generate_packing_slip_specific_dc_with_http_info(distribution_center_code, order_id, opts)
  data
end

#generate_packing_slip_specific_dc_with_http_info(distribution_center_code, order_id, opts = {}) ⇒ Array<(OrderPackingSlipResponse, Integer, Hash)>

Generate a packing slip for this order for the given distribution center. The packing slip PDF that is returned is base 64 encoded

Parameters:

  • distribution_center_code (String)

    Distribution center code

  • order_id (String)

    Order ID

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

    the optional parameters

Returns:

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

    OrderPackingSlipResponse data, response status code and response headers



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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/ultracart_api/api/order_api.rb', line 735

def generate_packing_slip_specific_dc_with_http_info(distribution_center_code, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.generate_packing_slip_specific_dc ...'
  end
  # verify the required parameter 'distribution_center_code' is set
  if @api_client.config.client_side_validation && distribution_center_code.nil?
    fail ArgumentError, "Missing the required parameter 'distribution_center_code' when calling OrderApi.generate_packing_slip_specific_dc"
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.generate_packing_slip_specific_dc"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/packing_slip/{distribution_center_code}'.sub('{' + 'distribution_center_code' + '}', CGI.escape(distribution_center_code.to_s)).sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderPackingSlipResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.generate_packing_slip_specific_dc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#generate_packing_slip_specific_dc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_receivable_retry_config(opts = {}) ⇒ AccountsReceivableRetryConfigResponse

Retrieve A/R Retry Configuration Retrieve A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

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

    the optional parameters

Returns:



792
793
794
795
# File 'lib/ultracart_api/api/order_api.rb', line 792

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

#get_accounts_receivable_retry_config_with_http_info(opts = {}) ⇒ Array<(AccountsReceivableRetryConfigResponse, Integer, Hash)>

Retrieve A/R Retry Configuration Retrieve A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

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

    the optional parameters

Returns:



801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/ultracart_api/api/order_api.rb', line 801

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

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AccountsReceivableRetryConfigResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_accounts_receivable_retry_config",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_accounts_receivable_retry_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts_receivable_retry_stats(opts = {}) ⇒ AccountsReceivableRetryStatsResponse

Retrieve A/R Retry Statistics Retrieve A/R Retry Statistics. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)
  • :to (String)

Returns:



852
853
854
855
# File 'lib/ultracart_api/api/order_api.rb', line 852

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

#get_accounts_receivable_retry_stats_with_http_info(opts = {}) ⇒ Array<(AccountsReceivableRetryStatsResponse, Integer, Hash)>

Retrieve A/R Retry Statistics Retrieve A/R Retry Statistics. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)
  • :to (String)

Returns:



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

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AccountsReceivableRetryStatsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_accounts_receivable_retry_stats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_accounts_receivable_retry_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order(order_id, opts = {}) ⇒ OrderResponse

Retrieve an order Retrieves a single order using the specified order id.

Parameters:

  • order_id (String)

    The order id to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



916
917
918
919
# File 'lib/ultracart_api/api/order_api.rb', line 916

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

#get_order_by_token(order_by_token_query, opts = {}) ⇒ OrderResponse

Retrieve an order using a token Retrieves a single order using the specified order token.

Parameters:

  • order_by_token_query (OrderByTokenQuery)

    Order by token query

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



983
984
985
986
# File 'lib/ultracart_api/api/order_api.rb', line 983

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

#get_order_by_token_with_http_info(order_by_token_query, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Retrieve an order using a token Retrieves a single order using the specified order token.

Parameters:

  • order_by_token_query (OrderByTokenQuery)

    Order by token query

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



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
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/ultracart_api/api/order_api.rb', line 994

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order_by_token_query)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_order_by_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_order_by_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order_edi_documents(order_id, opts = {}) ⇒ OrderEdiDocumentsResponse

Retrieve EDI documents associated with this order. Retrieve EDI documents associated with this order.

Parameters:

  • order_id (String)

    The order id to retrieve EDI documents for.

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

    the optional parameters

Returns:



1054
1055
1056
1057
# File 'lib/ultracart_api/api/order_api.rb', line 1054

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

#get_order_edi_documents_with_http_info(order_id, opts = {}) ⇒ Array<(OrderEdiDocumentsResponse, Integer, Hash)>

Retrieve EDI documents associated with this order. Retrieve EDI documents associated with this order.

Parameters:

  • order_id (String)

    The order id to retrieve EDI documents for.

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

    the optional parameters

Returns:

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

    OrderEdiDocumentsResponse data, response status code and response headers



1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
# File 'lib/ultracart_api/api/order_api.rb', line 1064

def get_order_edi_documents_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.get_order_edi_documents ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get_order_edi_documents"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/edi'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderEdiDocumentsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_order_edi_documents",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_order_edi_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order_with_http_info(order_id, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Retrieve an order Retrieves a single order using the specified order id.

Parameters:

  • order_id (String)

    The order id to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



927
928
929
930
931
932
933
934
935
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
973
974
975
# File 'lib/ultracart_api/api/order_api.rb', line 927

def get_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.get_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders(opts = {}) ⇒ OrdersResponse

Retrieve orders Retrieves a group of orders from the account. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    Order Id

  • :payment_method (String)

    Payment Method

  • :company (String)

    Company

  • :first_name (String)

    First Name

  • :last_name (String)

    Last Name

  • :city (String)

    City

  • :state_region (String)

    State/Region

  • :postal_code (String)

    Postal Code

  • :country_code (String)

    Country Code (ISO-3166 two letter)

  • :phone (String)

    Phone

  • :email (String)

    Email

  • :cc_email (String)

    CC Email

  • :total (Float)

    Total

  • :screen_branding_theme_code (String)

    Screen Branding Theme Code

  • :storefront_host_name (String)

    StoreFront Host Name

  • :creation_date_begin (String)

    Creation Date Begin

  • :creation_date_end (String)

    Creation Date End

  • :payment_date_begin (String)

    Payment Date Begin

  • :payment_date_end (String)

    Payment Date End

  • :shipment_date_begin (String)

    Shipment Date Begin

  • :shipment_date_end (String)

    Shipment Date End

  • :rma (String)

    RMA

  • :purchase_order_number (String)

    Purchase Order Number

  • :item_id (String)

    Item Id

  • :current_stage (String)

    Current Stage

  • :channel_partner_code (String)

    Channel Partner Code

  • :channel_partner_order_id (String)

    Channel Partner Order ID

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Maximum 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_sort (String)

    The sort order of the orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result.

Returns:



1148
1149
1150
1151
# File 'lib/ultracart_api/api/order_api.rb', line 1148

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

#get_orders_batch(order_batch, opts = {}) ⇒ OrdersResponse

Retrieve order batch Retrieves a group of orders from the account based on an array of order ids. If more than 500 order ids are specified, the API call will fail with a bad request error.

Parameters:

  • order_batch (OrderQueryBatch)

    Order batch

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result.

Returns:



1270
1271
1272
1273
# File 'lib/ultracart_api/api/order_api.rb', line 1270

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

#get_orders_batch_with_http_info(order_batch, opts = {}) ⇒ Array<(OrdersResponse, Integer, Hash)>

Retrieve order batch Retrieves a group of orders from the account based on an array of order ids. If more than 500 order ids are specified, the API call will fail with a bad request error.

Parameters:

  • order_batch (OrderQueryBatch)

    Order batch

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result.

Returns:

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

    OrdersResponse data, response status code and response headers



1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/ultracart_api/api/order_api.rb', line 1281

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order_batch)

  # return_type
  return_type = opts[:debug_return_type] || 'OrdersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_orders_batch",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_orders_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders_by_query(order_query, opts = {}) ⇒ OrdersResponse

Retrieve orders by query Retrieves a group of orders from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • order_query (OrderQuery)

    Order query

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Maximum 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_sort (String)

    The sort order of the orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result.

Returns:



1345
1346
1347
1348
# File 'lib/ultracart_api/api/order_api.rb', line 1345

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

#get_orders_by_query_with_http_info(order_query, opts = {}) ⇒ Array<(OrdersResponse, Integer, Hash)>

Retrieve orders by query Retrieves a group of orders from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • order_query (OrderQuery)

    Order query

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

    the optional parameters

Options Hash (opts):

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Maximum 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_sort (String)

    The sort order of the orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result.

Returns:

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

    OrdersResponse data, response status code and response headers



1359
1360
1361
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
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
# File 'lib/ultracart_api/api/order_api.rb', line 1359

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order_query)

  # return_type
  return_type = opts[:debug_return_type] || 'OrdersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_orders_by_query",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_orders_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_orders_with_http_info(opts = {}) ⇒ Array<(OrdersResponse, Integer, Hash)>

Retrieve orders Retrieves a group of orders from the account. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    Order Id

  • :payment_method (String)

    Payment Method

  • :company (String)

    Company

  • :first_name (String)

    First Name

  • :last_name (String)

    Last Name

  • :city (String)

    City

  • :state_region (String)

    State/Region

  • :postal_code (String)

    Postal Code

  • :country_code (String)

    Country Code (ISO-3166 two letter)

  • :phone (String)

    Phone

  • :email (String)

    Email

  • :cc_email (String)

    CC Email

  • :total (Float)

    Total

  • :screen_branding_theme_code (String)

    Screen Branding Theme Code

  • :storefront_host_name (String)

    StoreFront Host Name

  • :creation_date_begin (String)

    Creation Date Begin

  • :creation_date_end (String)

    Creation Date End

  • :payment_date_begin (String)

    Payment Date Begin

  • :payment_date_end (String)

    Payment Date End

  • :shipment_date_begin (String)

    Shipment Date Begin

  • :shipment_date_end (String)

    Shipment Date End

  • :rma (String)

    RMA

  • :purchase_order_number (String)

    Purchase Order Number

  • :item_id (String)

    Item Id

  • :current_stage (String)

    Current Stage

  • :channel_partner_code (String)

    Channel Partner Code

  • :channel_partner_order_id (String)

    Channel Partner Order ID

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Maximum 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_sort (String)

    The sort order of the orders. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result.

Returns:

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

    OrdersResponse data, response status code and response headers



1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
# File 'lib/ultracart_api/api/order_api.rb', line 1188

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'order_id'] = opts[:'order_id'] if !opts[:'order_id'].nil?
  query_params[:'payment_method'] = opts[:'payment_method'] if !opts[:'payment_method'].nil?
  query_params[:'company'] = opts[:'company'] if !opts[:'company'].nil?
  query_params[:'first_name'] = opts[:'first_name'] if !opts[:'first_name'].nil?
  query_params[:'last_name'] = opts[:'last_name'] if !opts[:'last_name'].nil?
  query_params[:'city'] = opts[:'city'] if !opts[:'city'].nil?
  query_params[:'state_region'] = opts[:'state_region'] if !opts[:'state_region'].nil?
  query_params[:'postal_code'] = opts[:'postal_code'] if !opts[:'postal_code'].nil?
  query_params[:'country_code'] = opts[:'country_code'] if !opts[:'country_code'].nil?
  query_params[:'phone'] = opts[:'phone'] if !opts[:'phone'].nil?
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'cc_email'] = opts[:'cc_email'] if !opts[:'cc_email'].nil?
  query_params[:'total'] = opts[:'total'] if !opts[:'total'].nil?
  query_params[:'screen_branding_theme_code'] = opts[:'screen_branding_theme_code'] if !opts[:'screen_branding_theme_code'].nil?
  query_params[:'storefront_host_name'] = opts[:'storefront_host_name'] if !opts[:'storefront_host_name'].nil?
  query_params[:'creation_date_begin'] = opts[:'creation_date_begin'] if !opts[:'creation_date_begin'].nil?
  query_params[:'creation_date_end'] = opts[:'creation_date_end'] if !opts[:'creation_date_end'].nil?
  query_params[:'payment_date_begin'] = opts[:'payment_date_begin'] if !opts[:'payment_date_begin'].nil?
  query_params[:'payment_date_end'] = opts[:'payment_date_end'] if !opts[:'payment_date_end'].nil?
  query_params[:'shipment_date_begin'] = opts[:'shipment_date_begin'] if !opts[:'shipment_date_begin'].nil?
  query_params[:'shipment_date_end'] = opts[:'shipment_date_end'] if !opts[:'shipment_date_end'].nil?
  query_params[:'rma'] = opts[:'rma'] if !opts[:'rma'].nil?
  query_params[:'purchase_order_number'] = opts[:'purchase_order_number'] if !opts[:'purchase_order_number'].nil?
  query_params[:'item_id'] = opts[:'item_id'] if !opts[:'item_id'].nil?
  query_params[:'current_stage'] = opts[:'current_stage'] if !opts[:'current_stage'].nil?
  query_params[:'channel_partner_code'] = opts[:'channel_partner_code'] if !opts[:'channel_partner_code'].nil?
  query_params[:'channel_partner_order_id'] = opts[:'channel_partner_order_id'] if !opts[:'channel_partner_order_id'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrdersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.get_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#get_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_order(order, opts = {}) ⇒ OrderResponse

Insert an order Inserts a new order on the UltraCart account. This is probably NOT the method you want. This is for channel orders. For regular orders the customer is entering, use the CheckoutApi. It has many, many more features, checks, and validations.

Parameters:

  • order (Order)

    Order to insert

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



1423
1424
1425
1426
# File 'lib/ultracart_api/api/order_api.rb', line 1423

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

#insert_order_with_http_info(order, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Insert an order Inserts a new order on the UltraCart account. This is probably NOT the method you want. This is for channel orders. For regular orders the customer is entering, use the CheckoutApi. It has many, many more features, checks, and validations.

Parameters:

  • order (Order)

    Order to insert

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/ultracart_api/api/order_api.rb', line 1434

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.insert_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#insert_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#is_refundable_order(order_id, opts = {}) ⇒ OrderRefundableResponse

Determine if an order can be refunded Determine if an order can be refunded based upon payment method and age

Parameters:

  • order_id (String)

    The order id to check for refundable order.

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

    the optional parameters

Returns:



1494
1495
1496
1497
# File 'lib/ultracart_api/api/order_api.rb', line 1494

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

#is_refundable_order_with_http_info(order_id, opts = {}) ⇒ Array<(OrderRefundableResponse, Integer, Hash)>

Determine if an order can be refunded Determine if an order can be refunded based upon payment method and age

Parameters:

  • order_id (String)

    The order id to check for refundable order.

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

    the optional parameters

Returns:

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

    OrderRefundableResponse data, response status code and response headers



1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
# File 'lib/ultracart_api/api/order_api.rb', line 1504

def is_refundable_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.is_refundable_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.is_refundable_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/refundable'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OrderRefundableResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.is_refundable_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#is_refundable_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#process_payment(order_id, process_payment_request, opts = {}) ⇒ OrderProcessPaymentResponse

Process payment Process payment on order

Parameters:

  • order_id (String)

    The order id to process payment on

  • process_payment_request (OrderProcessPaymentRequest)

    Process payment parameters

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

    the optional parameters

Returns:



1559
1560
1561
1562
# File 'lib/ultracart_api/api/order_api.rb', line 1559

def process_payment(order_id, process_payment_request, opts = {})
  data, _status_code, _headers = process_payment_with_http_info(order_id, process_payment_request, opts)
  data
end

#process_payment_with_http_info(order_id, process_payment_request, opts = {}) ⇒ Array<(OrderProcessPaymentResponse, Integer, Hash)>

Process payment Process payment on order

Parameters:

  • order_id (String)

    The order id to process payment on

  • process_payment_request (OrderProcessPaymentRequest)

    Process payment parameters

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

    the optional parameters

Returns:

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

    OrderProcessPaymentResponse data, response status code and response headers



1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/ultracart_api/api/order_api.rb', line 1570

def process_payment_with_http_info(order_id, process_payment_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.process_payment ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.process_payment"
  end
  # verify the required parameter 'process_payment_request' is set
  if @api_client.config.client_side_validation && process_payment_request.nil?
    fail ArgumentError, "Missing the required parameter 'process_payment_request' when calling OrderApi.process_payment"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/process_payment'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(process_payment_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderProcessPaymentResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.process_payment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#process_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#refund_order(order_id, order, opts = {}) ⇒ OrderResponse

Refund an order Perform a refund operation on an order and then update the order if successful. All of the object properties ending in _refunded should be the TOTAL amount that should end up being refunded. UltraCart will calculate the actual amount to refund based upon the prior refunds.

Parameters:

  • order_id (String)

    The order id to refund.

  • order (Order)

    Order to refund

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

    the optional parameters

Options Hash (opts):

  • :reject_after_refund (Boolean)

    Reject order after refund (default to false)

  • :skip_customer_notification (Boolean)

    Skip customer email notification (default to false)

  • :auto_order_cancel (Boolean)

    Cancel associated auto orders (default to false)

  • :manual_refund (Boolean)

    Consider a manual refund done externally (default to false)

  • :reverse_affiliate_transactions (Boolean)

    Reverse affiliate transactions (default to true)

  • :issue_store_credit (Boolean)

    Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account (default to false)

  • :auto_order_cancel_reason (String)

    Reason for auto orders cancellation

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



1642
1643
1644
1645
# File 'lib/ultracart_api/api/order_api.rb', line 1642

def refund_order(order_id, order, opts = {})
  data, _status_code, _headers = refund_order_with_http_info(order_id, order, opts)
  data
end

#refund_order_with_http_info(order_id, order, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Refund an order Perform a refund operation on an order and then update the order if successful. All of the object properties ending in _refunded should be the TOTAL amount that should end up being refunded. UltraCart will calculate the actual amount to refund based upon the prior refunds.

Parameters:

  • order_id (String)

    The order id to refund.

  • order (Order)

    Order to refund

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

    the optional parameters

Options Hash (opts):

  • :reject_after_refund (Boolean)

    Reject order after refund (default to false)

  • :skip_customer_notification (Boolean)

    Skip customer email notification (default to false)

  • :auto_order_cancel (Boolean)

    Cancel associated auto orders (default to false)

  • :manual_refund (Boolean)

    Consider a manual refund done externally (default to false)

  • :reverse_affiliate_transactions (Boolean)

    Reverse affiliate transactions (default to true)

  • :issue_store_credit (Boolean)

    Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account (default to false)

  • :auto_order_cancel_reason (String)

    Reason for auto orders cancellation

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
# File 'lib/ultracart_api/api/order_api.rb', line 1661

def refund_order_with_http_info(order_id, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.refund_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.refund_order"
  end
  # verify the required parameter 'order' is set
  if @api_client.config.client_side_validation && order.nil?
    fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.refund_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/refund'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'reject_after_refund'] = opts[:'reject_after_refund'] if !opts[:'reject_after_refund'].nil?
  query_params[:'skip_customer_notification'] = opts[:'skip_customer_notification'] if !opts[:'skip_customer_notification'].nil?
  query_params[:'auto_order_cancel'] = opts[:'auto_order_cancel'] if !opts[:'auto_order_cancel'].nil?
  query_params[:'manual_refund'] = opts[:'manual_refund'] if !opts[:'manual_refund'].nil?
  query_params[:'reverse_affiliate_transactions'] = opts[:'reverse_affiliate_transactions'] if !opts[:'reverse_affiliate_transactions'].nil?
  query_params[:'issue_store_credit'] = opts[:'issue_store_credit'] if !opts[:'issue_store_credit'].nil?
  query_params[:'auto_order_cancel_reason'] = opts[:'auto_order_cancel_reason'] if !opts[:'auto_order_cancel_reason'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.refund_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#refund_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#replace_order_item_merchant_item_id(order_id, replace_order_item_id_request, opts = {}) ⇒ OrderResponse

Replaces an order item id Replaces a single order item id with another merchant_item_id, leaving all other attributes and properties unchanged. A custom method requested by a merchant to allow for item id updates due to shipping errors. It is doubtful you will ever need this method. The expansion variable affects the returned order object.

Parameters:

  • order_id (String)

    The order id to update.

  • replace_order_item_id_request (ReplaceOrderItemIdRequest)

    Replacement Request

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



1734
1735
1736
1737
# File 'lib/ultracart_api/api/order_api.rb', line 1734

def replace_order_item_merchant_item_id(order_id, replace_order_item_id_request, opts = {})
  data, _status_code, _headers = replace_order_item_merchant_item_id_with_http_info(order_id, replace_order_item_id_request, opts)
  data
end

#replace_order_item_merchant_item_id_with_http_info(order_id, replace_order_item_id_request, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Replaces an order item id Replaces a single order item id with another merchant_item_id, leaving all other attributes and properties unchanged. A custom method requested by a merchant to allow for item id updates due to shipping errors. It is doubtful you will ever need this method. The expansion variable affects the returned order object.

Parameters:

  • order_id (String)

    The order id to update.

  • replace_order_item_id_request (ReplaceOrderItemIdRequest)

    Replacement Request

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
# File 'lib/ultracart_api/api/order_api.rb', line 1746

def replace_order_item_merchant_item_id_with_http_info(order_id, replace_order_item_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.replace_order_item_merchant_item_id ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.replace_order_item_merchant_item_id"
  end
  # verify the required parameter 'replace_order_item_id_request' is set
  if @api_client.config.client_side_validation && replace_order_item_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'replace_order_item_id_request' when calling OrderApi.replace_order_item_merchant_item_id"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/replace_item_id'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(replace_order_item_id_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.replace_order_item_merchant_item_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#replace_order_item_merchant_item_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#replacement(order_id, replacement, opts = {}) ⇒ OrderReplacementResponse

Replacement order Create a replacement order based upon a previous order

Parameters:

  • order_id (String)

    The order id to generate a replacement for.

  • replacement (OrderReplacement)

    Replacement order details

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

    the optional parameters

Returns:



1811
1812
1813
1814
# File 'lib/ultracart_api/api/order_api.rb', line 1811

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

#replacement_with_http_info(order_id, replacement, opts = {}) ⇒ Array<(OrderReplacementResponse, Integer, Hash)>

Replacement order Create a replacement order based upon a previous order

Parameters:

  • order_id (String)

    The order id to generate a replacement for.

  • replacement (OrderReplacement)

    Replacement order details

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

    the optional parameters

Returns:

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

    OrderReplacementResponse data, response status code and response headers



1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
# File 'lib/ultracart_api/api/order_api.rb', line 1822

def replacement_with_http_info(order_id, replacement, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.replacement ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.replacement"
  end
  # verify the required parameter 'replacement' is set
  if @api_client.config.client_side_validation && replacement.nil?
    fail ArgumentError, "Missing the required parameter 'replacement' when calling OrderApi.replacement"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/replacement'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(replacement)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderReplacementResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.replacement",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#replacement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resend_receipt(order_id, opts = {}) ⇒ BaseResponse

Resend receipt Resend the receipt for an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to resend the receipt for.

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

    the optional parameters

Returns:



1885
1886
1887
1888
# File 'lib/ultracart_api/api/order_api.rb', line 1885

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

#resend_receipt_with_http_info(order_id, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Resend receipt Resend the receipt for an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to resend the receipt for.

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

    the optional parameters

Returns:

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

    BaseResponse data, response status code and response headers



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
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
# File 'lib/ultracart_api/api/order_api.rb', line 1895

def resend_receipt_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.resend_receipt ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.resend_receipt"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/resend_receipt'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.resend_receipt",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#resend_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resend_shipment_confirmation(order_id, opts = {}) ⇒ BaseResponse

Resend shipment confirmation Resend shipment confirmation for an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to resend the shipment notification for.

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

    the optional parameters

Returns:



1949
1950
1951
1952
# File 'lib/ultracart_api/api/order_api.rb', line 1949

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

#resend_shipment_confirmation_with_http_info(order_id, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Resend shipment confirmation Resend shipment confirmation for an order on the UltraCart account.

Parameters:

  • order_id (String)

    The order id to resend the shipment notification for.

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

    the optional parameters

Returns:

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

    BaseResponse data, response status code and response headers



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
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
# File 'lib/ultracart_api/api/order_api.rb', line 1959

def resend_shipment_confirmation_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.resend_shipment_confirmation ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.resend_shipment_confirmation"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/resend_shipment_confirmation'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.resend_shipment_confirmation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#resend_shipment_confirmation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unblock_refund_on_order(order_id, opts = {}) ⇒ nil

Remove a refund block on an order Removes a refund block on an order to prevent a user from performing a refund.

Parameters:

  • order_id (String)

    The order id to unblock a refund on.

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

    the optional parameters

Returns:

  • (nil)


2013
2014
2015
2016
# File 'lib/ultracart_api/api/order_api.rb', line 2013

def unblock_refund_on_order(order_id, opts = {})
  unblock_refund_on_order_with_http_info(order_id, opts)
  nil
end

#unblock_refund_on_order_with_http_info(order_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a refund block on an order Removes a refund block on an order to prevent a user from performing a refund.

Parameters:

  • order_id (String)

    The order id to unblock a refund on.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
# File 'lib/ultracart_api/api/order_api.rb', line 2023

def unblock_refund_on_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.unblock_refund_on_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.unblock_refund_on_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}/refund_unblock'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.unblock_refund_on_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#unblock_refund_on_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_accounts_receivable_retry_config(retry_config, opts = {}) ⇒ BaseResponse

Update A/R Retry Configuration Update A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

  • retry_config (AccountsReceivableRetryConfig)

    AccountsReceivableRetryConfig object

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

    the optional parameters

Returns:



2077
2078
2079
2080
# File 'lib/ultracart_api/api/order_api.rb', line 2077

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

#update_accounts_receivable_retry_config_with_http_info(retry_config, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Update A/R Retry Configuration Update A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Parameters:

  • retry_config (AccountsReceivableRetryConfig)

    AccountsReceivableRetryConfig object

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

    the optional parameters

Returns:

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

    BaseResponse data, response status code and response headers



2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
# File 'lib/ultracart_api/api/order_api.rb', line 2087

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

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(retry_config)

  # return_type
  return_type = opts[:debug_return_type] || 'BaseResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.update_accounts_receivable_retry_config",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#update_accounts_receivable_retry_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_order(order_id, order, opts = {}) ⇒ OrderResponse

Update an order Update a new order on the UltraCart account. This is probably NOT the method you want. It is rare to update a completed order. This will not trigger charges, emails, or any other automation.

Parameters:

  • order_id (String)

    The order id to update.

  • order (Order)

    Order to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



2148
2149
2150
2151
# File 'lib/ultracart_api/api/order_api.rb', line 2148

def update_order(order_id, order, opts = {})
  data, _status_code, _headers = update_order_with_http_info(order_id, order, opts)
  data
end

#update_order_with_http_info(order_id, order, opts = {}) ⇒ Array<(OrderResponse, Integer, Hash)>

Update an order Update a new order on the UltraCart account. This is probably NOT the method you want. It is rare to update a completed order. This will not trigger charges, emails, or any other automation.

Parameters:

  • order_id (String)

    The order id to update.

  • order (Order)

    Order to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
# File 'lib/ultracart_api/api/order_api.rb', line 2160

def update_order_with_http_info(order_id, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrderApi.update_order ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.update_order"
  end
  # verify the required parameter 'order' is set
  if @api_client.config.client_side_validation && order.nil?
    fail ArgumentError, "Missing the required parameter 'order' when calling OrderApi.update_order"
  end
  # resource path
  local_var_path = '/order/orders/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(order)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.update_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#update_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_order(validation_request, opts = {}) ⇒ OrderValidationResponse

Validate Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.

Parameters:

  • validation_request (OrderValidationRequest)

    Validation request

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

    the optional parameters

Returns:



2224
2225
2226
2227
# File 'lib/ultracart_api/api/order_api.rb', line 2224

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

#validate_order_with_http_info(validation_request, opts = {}) ⇒ Array<(OrderValidationResponse, Integer, Hash)>

Validate Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.

Parameters:

  • validation_request (OrderValidationRequest)

    Validation request

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

    the optional parameters

Returns:

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

    OrderValidationResponse data, response status code and response headers



2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
# File 'lib/ultracart_api/api/order_api.rb', line 2234

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

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(validation_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OrderValidationResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"OrderApi.validate_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrderApi#validate_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end