Class: UltracartClient::AutoOrderApi

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AutoOrderApi

Returns a new instance of AutoOrderApi.



19
20
21
# File 'lib/ultracart_api/api/auto_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/auto_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/auto_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::AutoOrderApi.new(api_client)
end

Instance Method Details

#establish_auto_order_by_reference_order_id(reference_order_id, opts = {}) ⇒ AutoOrderResponse

Establish an auto order by referencing a regular order id Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.

Parameters:

  • reference_order_id

    The order id to attach this auto order to

  • 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:



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

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

#establish_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts = {}) ⇒ Array<(AutoOrderResponse, Fixnum, Hash)>

Establish an auto order by referencing a regular order id Establish an auto order by referencing a regular order id. The result will be an auto order without any items. You should add the items and perform an update call. Orders must be less than 60 days old and use a credit card payment.

Parameters:

  • reference_order_id

    The order id to attach this auto order to

  • 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<(AutoOrderResponse, Fixnum, Hash)>)

    AutoOrderResponse 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
# File 'lib/ultracart_api/api/auto_order_api.rb', line 52

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

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_order(auto_order_oid, opts = {}) ⇒ AutoOrderResponse

Retrieve an auto order by oid Retrieves a single auto order using the specified auto order oid.

Parameters:

  • auto_order_oid

    The auto order oid 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:



99
100
101
102
# File 'lib/ultracart_api/api/auto_order_api.rb', line 99

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

#get_auto_order_by_code(auto_order_code, opts = {}) ⇒ AutoOrderResponse

Retrieve an auto order by code Retrieves a single auto order using the specified reference (original) order id.

Parameters:

  • auto_order_code

    The auto order oid 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:



157
158
159
160
# File 'lib/ultracart_api/api/auto_order_api.rb', line 157

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

#get_auto_order_by_code_with_http_info(auto_order_code, opts = {}) ⇒ Array<(AutoOrderResponse, Fixnum, Hash)>

Retrieve an auto order by code Retrieves a single auto order using the specified reference (original) order id.

Parameters:

  • auto_order_code

    The auto order oid 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<(AutoOrderResponse, Fixnum, Hash)>)

    AutoOrderResponse data, response status code and response headers



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/ultracart_api/api/auto_order_api.rb', line 168

def get_auto_order_by_code_with_http_info(auto_order_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutoOrderApi.get_auto_order_by_code ...'
  end
  # verify the required parameter 'auto_order_code' is set
  if @api_client.config.client_side_validation && auto_order_code.nil?
    fail ArgumentError, "Missing the required parameter 'auto_order_code' when calling AutoOrderApi.get_auto_order_by_code"
  end
  # resource path
  local_var_path = '/auto_order/auto_orders/code/{auto_order_code}'.sub('{' + 'auto_order_code' + '}', auto_order_code.to_s)

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_order_by_reference_order_id(reference_order_id, opts = {}) ⇒ AutoOrderResponse

Retrieve an auto order by order id Retrieves a single auto order using the specified reference (original) order id.

Parameters:

  • reference_order_id

    The auto order oid 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:



215
216
217
218
# File 'lib/ultracart_api/api/auto_order_api.rb', line 215

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

#get_auto_order_by_reference_order_id_with_http_info(reference_order_id, opts = {}) ⇒ Array<(AutoOrderResponse, Fixnum, Hash)>

Retrieve an auto order by order id Retrieves a single auto order using the specified reference (original) order id.

Parameters:

  • reference_order_id

    The auto order oid 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<(AutoOrderResponse, Fixnum, Hash)>)

    AutoOrderResponse data, response status code and response headers



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

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

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_order_with_http_info(auto_order_oid, opts = {}) ⇒ Array<(AutoOrderResponse, Fixnum, Hash)>

Retrieve an auto order by oid Retrieves a single auto order using the specified auto order oid.

Parameters:

  • auto_order_oid

    The auto order oid 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<(AutoOrderResponse, Fixnum, Hash)>)

    AutoOrderResponse data, response status code and response headers



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/ultracart_api/api/auto_order_api.rb', line 110

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

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_orders(opts = {}) ⇒ AutoOrdersResponse

Retrieve auto orders Retrieves auto orders from the account. If no parameters are specified, all auto orders will be returned. 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):

  • :auto_order_code (String)

    Auto order code

  • :original_order_id (String)

    Original order id

  • :first_name (String)

    First name

  • :last_name (String)

    Last name

  • :company (String)

    Company

  • :city (String)

    City

  • :state (String)

    State

  • :postal_code (String)

    Postal code

  • :country_code (String)

    Country code (ISO-3166 two letter)

  • :phone (String)

    Phone

  • :email (String)

    Email

  • :original_order_date_begin (String)

    Original order date begin

  • :original_order_date_end (String)

    Original order date end

  • :next_shipment_date_begin (String)

    Next shipment date begin

  • :next_shipment_date_end (String)

    Next shipment date end

  • :card_type (String)

    Card type

  • :item_id (String)

    Item ID

  • :status (String)

    Status

  • :_limit (Integer)

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

  • :_offset (Integer)

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

  • :_since (String)

    Fetch auto orders that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the auto 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. See documentation for examples

Returns:



294
295
296
297
# File 'lib/ultracart_api/api/auto_order_api.rb', line 294

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

#get_auto_orders_batch(auto_order_batch, opts = {}) ⇒ AutoOrdersResponse

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

Parameters:

  • auto_order_batch

    Auto order batch

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result.

Returns:



391
392
393
394
# File 'lib/ultracart_api/api/auto_order_api.rb', line 391

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

#get_auto_orders_batch_with_http_info(auto_order_batch, opts = {}) ⇒ Array<(AutoOrdersResponse, Fixnum, Hash)>

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

Parameters:

  • auto_order_batch

    Auto order batch

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result.

Returns:

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

    AutoOrdersResponse data, response status code and response headers



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

def get_auto_orders_batch_with_http_info(auto_order_batch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutoOrderApi.get_auto_orders_batch ...'
  end
  # verify the required parameter 'auto_order_batch' is set
  if @api_client.config.client_side_validation && auto_order_batch.nil?
    fail ArgumentError, "Missing the required parameter 'auto_order_batch' when calling AutoOrderApi.get_auto_orders_batch"
  end
  # resource path
  local_var_path = '/auto_order/auto_orders/batch'

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_orders_by_query(auto_order_query, opts = {}) ⇒ AutoOrdersResponse

Retrieve auto orders by query Retrieves a group of auto orders from the account based on a query object. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • auto_order_query

    Auto 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 auto 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:



452
453
454
455
# File 'lib/ultracart_api/api/auto_order_api.rb', line 452

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

#get_auto_orders_by_query_with_http_info(auto_order_query, opts = {}) ⇒ Array<(AutoOrdersResponse, Fixnum, Hash)>

Retrieve auto orders by query Retrieves a group of auto orders from the account based on a query object. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

  • auto_order_query

    Auto 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)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index.

  • :_sort (String)

    The sort order of the auto 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<(AutoOrdersResponse, Fixnum, Hash)>)

    AutoOrdersResponse data, response status code and response headers



466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/ultracart_api/api/auto_order_api.rb', line 466

def get_auto_orders_by_query_with_http_info(auto_order_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutoOrderApi.get_auto_orders_by_query ...'
  end
  # verify the required parameter 'auto_order_query' is set
  if @api_client.config.client_side_validation && auto_order_query.nil?
    fail ArgumentError, "Missing the required parameter 'auto_order_query' when calling AutoOrderApi.get_auto_orders_by_query"
  end
  # resource path
  local_var_path = '/auto_order/auto_orders/query'

  # query parameters
  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 = {}
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_auto_orders_with_http_info(opts = {}) ⇒ Array<(AutoOrdersResponse, Fixnum, Hash)>

Retrieve auto orders Retrieves auto orders from the account. If no parameters are specified, all auto orders will be returned. 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):

  • :auto_order_code (String)

    Auto order code

  • :original_order_id (String)

    Original order id

  • :first_name (String)

    First name

  • :last_name (String)

    Last name

  • :company (String)

    Company

  • :city (String)

    City

  • :state (String)

    State

  • :postal_code (String)

    Postal code

  • :country_code (String)

    Country code (ISO-3166 two letter)

  • :phone (String)

    Phone

  • :email (String)

    Email

  • :original_order_date_begin (String)

    Original order date begin

  • :original_order_date_end (String)

    Original order date end

  • :next_shipment_date_begin (String)

    Next shipment date begin

  • :next_shipment_date_end (String)

    Next shipment date end

  • :card_type (String)

    Card type

  • :item_id (String)

    Item ID

  • :status (String)

    Status

  • :_limit (Integer)

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

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index.

  • :_since (String)

    Fetch auto orders that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the auto 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. See documentation for examples

Returns:

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

    AutoOrdersResponse data, response status code and response headers



326
327
328
329
330
331
332
333
334
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
383
384
# File 'lib/ultracart_api/api/auto_order_api.rb', line 326

def get_auto_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutoOrderApi.get_auto_orders ...'
  end
  # resource path
  local_var_path = '/auto_order/auto_orders'

  # query parameters
  query_params = {}
  query_params[:'auto_order_code'] = opts[:'auto_order_code'] if !opts[:'auto_order_code'].nil?
  query_params[:'original_order_id'] = opts[:'original_order_id'] if !opts[:'original_order_id'].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[:'company'] = opts[:'company'] if !opts[:'company'].nil?
  query_params[:'city'] = opts[:'city'] if !opts[:'city'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].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[:'original_order_date_begin'] = opts[:'original_order_date_begin'] if !opts[:'original_order_date_begin'].nil?
  query_params[:'original_order_date_end'] = opts[:'original_order_date_end'] if !opts[:'original_order_date_end'].nil?
  query_params[:'next_shipment_date_begin'] = opts[:'next_shipment_date_begin'] if !opts[:'next_shipment_date_begin'].nil?
  query_params[:'next_shipment_date_end'] = opts[:'next_shipment_date_end'] if !opts[:'next_shipment_date_end'].nil?
  query_params[:'card_type'] = opts[:'card_type'] if !opts[:'card_type'].nil?
  query_params[:'item_id'] = opts[:'item_id'] if !opts[:'item_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#update_auto_order(auto_order, auto_order_oid, opts = {}) ⇒ AutoOrderResponse

Update an auto order Update an auto order on the UltraCart account.

Parameters:

  • auto_order

    Auto order to update

  • auto_order_oid

    The auto order oid to update.

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

    the optional parameters

Options Hash (opts):

  • :validate_original_order (String)

    Validate original order before updating

  • :_expand (String)

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

Returns:



518
519
520
521
# File 'lib/ultracart_api/api/auto_order_api.rb', line 518

def update_auto_order(auto_order, auto_order_oid, opts = {})
  data, _status_code, _headers = update_auto_order_with_http_info(auto_order, auto_order_oid, opts)
  data
end

#update_auto_order_with_http_info(auto_order, auto_order_oid, opts = {}) ⇒ Array<(AutoOrderResponse, Fixnum, Hash)>

Update an auto order Update an auto order on the UltraCart account.

Parameters:

  • auto_order

    Auto order to update

  • auto_order_oid

    The auto order oid to update.

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

    the optional parameters

Options Hash (opts):

  • :validate_original_order (String)

    Validate original order before updating

  • :_expand (String)

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

Returns:

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

    AutoOrderResponse data, response status code and response headers



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/ultracart_api/api/auto_order_api.rb', line 531

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

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(auto_order)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AutoOrderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutoOrderApi#update_auto_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_auto_orders_batch(auto_orders_request, opts = {}) ⇒ AutoOrdersResponse

Update multiple auto orders Update multiple auto orders on the UltraCart account.

Parameters:

  • auto_orders_request

    Auto orders to update (synchronous maximum 20 / asynchronous maximum 100)

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (BOOLEAN)

    True if the operation should be run async. No result returned

Returns:



585
586
587
588
# File 'lib/ultracart_api/api/auto_order_api.rb', line 585

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

#update_auto_orders_batch_with_http_info(auto_orders_request, opts = {}) ⇒ Array<(AutoOrdersResponse, Fixnum, Hash)>

Update multiple auto orders Update multiple auto orders on the UltraCart account.

Parameters:

  • auto_orders_request

    Auto orders to update (synchronous maximum 20 / asynchronous maximum 100)

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

  • :_placeholders (BOOLEAN)

    Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.

  • :_async (BOOLEAN)

    True if the operation should be run async. No result returned

Returns:

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

    AutoOrdersResponse data, response status code and response headers



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

def update_auto_orders_batch_with_http_info(auto_orders_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutoOrderApi.update_auto_orders_batch ...'
  end
  # verify the required parameter 'auto_orders_request' is set
  if @api_client.config.client_side_validation && auto_orders_request.nil?
    fail ArgumentError, "Missing the required parameter 'auto_orders_request' when calling AutoOrderApi.update_auto_orders_batch"
  end
  # resource path
  local_var_path = '/auto_order/auto_orders/batch'

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

  # header parameters
  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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(auto_orders_request)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AutoOrdersResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutoOrderApi#update_auto_orders_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end