Class: UltracartClient::ChannelPartnerApi

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ChannelPartnerApi

Returns a new instance of ChannelPartnerApi.



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

Instance Method Details

#cancel_order_by_channel_partner_order_id(order_id, opts = {}) ⇒ ChannelPartnerCancelResponse

Cancel channel partner order by channel partner order id Cancel channel partner order by channel partner order id

Parameters:

  • order_id (String)

    The channel partner order id to delete.

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

    the optional parameters

Returns:



40
41
42
43
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 40

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

#cancel_order_by_channel_partner_order_id_with_http_info(order_id, opts = {}) ⇒ Array<(ChannelPartnerCancelResponse, Integer, Hash)>

Cancel channel partner order by channel partner order id Cancel channel partner order by channel partner order id

Parameters:

  • order_id (String)

    The channel partner order id to delete.

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

    the optional parameters

Returns:



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

def cancel_order_by_channel_partner_order_id_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.cancel_order_by_channel_partner_order_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 ChannelPartnerApi.cancel_order_by_channel_partner_order_id"
  end
  # resource path
  local_var_path = '/channel_partner/cancel/by_channel_partner_order_id/{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] || 'ChannelPartnerCancelResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.cancel_order_by_channel_partner_order_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChannelPartnerApi#cancel_order_by_channel_partner_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_order_by_ultra_cart_order_id(order_id, opts = {}) ⇒ ChannelPartnerCancelResponse

Cancel channel partner order by UltraCart order id Cancel channel partner order by UltraCart order id

Parameters:

  • order_id (String)

    The UltraCart order id to delete.

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

    the optional parameters

Returns:



104
105
106
107
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 104

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

#cancel_order_by_ultra_cart_order_id_with_http_info(order_id, opts = {}) ⇒ Array<(ChannelPartnerCancelResponse, Integer, Hash)>

Cancel channel partner order by UltraCart order id Cancel channel partner order by UltraCart order id

Parameters:

  • order_id (String)

    The UltraCart order id to delete.

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

    the optional parameters

Returns:



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
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 114

def cancel_order_by_ultra_cart_order_id_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.cancel_order_by_ultra_cart_order_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 ChannelPartnerApi.cancel_order_by_ultra_cart_order_id"
  end
  # resource path
  local_var_path = '/channel_partner/cancel/by_ultracart_order_id/{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] || 'ChannelPartnerCancelResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.cancel_order_by_ultra_cart_order_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChannelPartnerApi#cancel_order_by_ultra_cart_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) ⇒ nil

Delete a ship to preference record for the channel partner. Delete a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


169
170
171
172
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 169

def delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
  delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts)
  nil
end

#delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a ship to preference record for the channel partner. Delete a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 180

def delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.delete_channel_partner_ship_to_preference ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference"
  end
  # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
  if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.to_s)).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', CGI.escape(channel_partner_ship_to_preference_oid.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 => :"ChannelPartnerApi.delete_channel_partner_ship_to_preference",
    :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: ChannelPartnerApi#delete_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#estimate_shipping_for_channel_partner_order(channel_partner_order, opts = {}) ⇒ ChannelPartnerEstimateShippingResponse

Estimate shipping for channel partner order Estimate shipping for order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order needing shipping estimate

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

    the optional parameters

Returns:



238
239
240
241
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 238

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

#estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order, opts = {}) ⇒ Array<(ChannelPartnerEstimateShippingResponse, Integer, Hash)>

Estimate shipping for channel partner order Estimate shipping for order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order needing shipping estimate

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

    the optional parameters

Returns:



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 248

def estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.estimate_shipping_for_channel_partner_order ...'
  end
  # verify the required parameter 'channel_partner_order' is set
  if @api_client.config.client_side_validation && channel_partner_order.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_order' when calling ChannelPartnerApi.estimate_shipping_for_channel_partner_order"
  end
  # resource path
  local_var_path = '/channel_partner/estimate_shipping'

  # 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; 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(channel_partner_order)

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

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.estimate_shipping_for_channel_partner_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: ChannelPartnerApi#estimate_shipping_for_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#estimate_tax_for_channel_partner_order(channel_partner_order, opts = {}) ⇒ ChannelPartnerEstimateTaxResponse

Estimate tax for channel partner order Estimate tax for order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order needing tax estimate

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

    the optional parameters

Returns:



307
308
309
310
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 307

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

#estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order, opts = {}) ⇒ Array<(ChannelPartnerEstimateTaxResponse, Integer, Hash)>

Estimate tax for channel partner order Estimate tax for order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order needing tax estimate

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

    the optional parameters

Returns:



317
318
319
320
321
322
323
324
325
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
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 317

def estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.estimate_tax_for_channel_partner_order ...'
  end
  # verify the required parameter 'channel_partner_order' is set
  if @api_client.config.client_side_validation && channel_partner_order.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_order' when calling ChannelPartnerApi.estimate_tax_for_channel_partner_order"
  end
  # resource path
  local_var_path = '/channel_partner/estimate_tax'

  # 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; 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(channel_partner_order)

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

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.estimate_tax_for_channel_partner_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: ChannelPartnerApi#estimate_tax_for_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Retrieve a channel partner order Retrieves a single order using the specified order id. Only orders belonging to this channel partner may be retrieved.

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 OrderApi.getOrder documentation for examples

Returns:



377
378
379
380
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 377

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

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

Retrieve a channel partner order by the channel partner order id Retrieves a single order using the channel partner order id, not the ultracart order id. Only orders belonging to this channel partner may be retrieved.

Parameters:

  • order_id (String)

    The channel partner 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 OrderApi.getOrder documentation for examples

Returns:



444
445
446
447
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 444

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

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

Retrieve a channel partner order by the channel partner order id Retrieves a single order using the channel partner order id, not the ultracart order id. Only orders belonging to this channel partner may be retrieved.

Parameters:

  • order_id (String)

    The channel partner 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 OrderApi.getOrder documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 455

def get_channel_partner_order_by_channel_partner_order_id_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_order_by_channel_partner_order_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 ChannelPartnerApi.get_channel_partner_order_by_channel_partner_order_id"
  end
  # resource path
  local_var_path = '/channel_partner/orders/by_channel_partner_order_id/{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 => :"ChannelPartnerApi.get_channel_partner_order_by_channel_partner_order_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partner_order_by_channel_partner_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Retrieve a channel partner order Retrieves a single order using the specified order id. Only orders belonging to this channel partner may be retrieved.

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 OrderApi.getOrder documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 388

def get_channel_partner_order_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_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 ChannelPartnerApi.get_channel_partner_order"
  end
  # resource path
  local_var_path = '/channel_partner/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 => :"ChannelPartnerApi.get_channel_partner_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: ChannelPartnerApi#get_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_channel_partner_reason_codes(channel_partner_oid, opts = {}) ⇒ ChanelPartnerReasonCodesResponse

Retrieve reject and refund reason codes. Retrieve reject and refund reason codes.

Parameters:

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

    the optional parameters

Returns:



510
511
512
513
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 510

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

#get_channel_partner_reason_codes_with_http_info(channel_partner_oid, opts = {}) ⇒ Array<(ChanelPartnerReasonCodesResponse, Integer, Hash)>

Retrieve reject and refund reason codes. Retrieve reject and refund reason codes.

Parameters:

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

    the optional parameters

Returns:



520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 520

def get_channel_partner_reason_codes_with_http_info(channel_partner_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_reason_codes ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_reason_codes"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/reason_codes'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.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] || 'ChanelPartnerReasonCodesResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.get_channel_partner_reason_codes",
    :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: ChannelPartnerApi#get_channel_partner_reason_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) ⇒ ChannelPartnerShipToPreferenceResponse

Retrieve the ship to preference associated with the channel partner and the specific id. Retrieve the ship to preference associated with the channel partner and the specific id.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



575
576
577
578
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 575

def get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
  data, _status_code, _headers = get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts)
  data
end

#get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) ⇒ Array<(ChannelPartnerShipToPreferenceResponse, Integer, Hash)>

Retrieve the ship to preference associated with the channel partner and the specific id. Retrieve the ship to preference associated with the channel partner and the specific id.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 586

def get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preference ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference"
  end
  # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
  if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.to_s)).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', CGI.escape(channel_partner_ship_to_preference_oid.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] || 'ChannelPartnerShipToPreferenceResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.get_channel_partner_ship_to_preference",
    :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: ChannelPartnerApi#get_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_channel_partner_ship_to_preferences(channel_partner_oid, opts = {}) ⇒ ChannelPartnerShipToPreferencesResponse

Retrieve the ship to preferences associated with the channel partner. Retrieve the ship to preferences associated with the channel partner.

Parameters:

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

    the optional parameters

Returns:



644
645
646
647
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 644

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

#get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts = {}) ⇒ Array<(ChannelPartnerShipToPreferencesResponse, Integer, Hash)>

Retrieve the ship to preferences associated with the channel partner. Retrieve the ship to preferences associated with the channel partner.

Parameters:

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

    the optional parameters

Returns:



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
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
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 654

def get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preferences ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preferences"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.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] || 'ChannelPartnerShipToPreferencesResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.get_channel_partner_ship_to_preferences",
    :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: ChannelPartnerApi#get_channel_partner_ship_to_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_channel_partners(opts = {}) ⇒ ChannelPartnersResponse

Retrieve the channel partners configured on the account. Retrieve the channel partners configured on the account.

Parameters:

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

    the optional parameters

Returns:



707
708
709
710
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 707

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

#get_channel_partners_with_http_info(opts = {}) ⇒ Array<(ChannelPartnersResponse, Integer, Hash)>

Retrieve the channel partners configured on the account. Retrieve the channel partners configured on the account.

Parameters:

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

    the optional parameters

Returns:

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

    ChannelPartnersResponse data, response status code and response headers



716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 716

def get_channel_partners_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partners ...'
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners'

  # 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] || 'ChannelPartnersResponse'

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.get_channel_partners",
    :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: ChannelPartnerApi#get_channel_partners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_channel_partner_order(channel_partner_order, opts = {}) ⇒ ChannelPartnerImportResponse

Insert channel partner order Insert order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order to insert

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

    the optional parameters

Returns:



766
767
768
769
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 766

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

#import_channel_partner_order_with_http_info(channel_partner_order, opts = {}) ⇒ Array<(ChannelPartnerImportResponse, Integer, Hash)>

Insert channel partner order Insert order from a channel partner.

Parameters:

  • channel_partner_order (ChannelPartnerOrder)

    Order to insert

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

    the optional parameters

Returns:



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 776

def import_channel_partner_order_with_http_info(channel_partner_order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.import_channel_partner_order ...'
  end
  # verify the required parameter 'channel_partner_order' is set
  if @api_client.config.client_side_validation && channel_partner_order.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_order' when calling ChannelPartnerApi.import_channel_partner_order"
  end
  # resource path
  local_var_path = '/channel_partner/import'

  # 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; 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(channel_partner_order)

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

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.import_channel_partner_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: ChannelPartnerApi#import_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference, opts = {}) ⇒ ChannelPartnerShipToPreferenceResponse

Insert a ship to preference record for the channel partner. Insert a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • ship_to_preference (ChannelPartnerShipToPreference)

    Ship to preference to create

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

    the optional parameters

Returns:



836
837
838
839
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 836

def insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference, opts = {})
  data, _status_code, _headers = insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts)
  data
end

#insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts = {}) ⇒ Array<(ChannelPartnerShipToPreferenceResponse, Integer, Hash)>

Insert a ship to preference record for the channel partner. Insert a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • ship_to_preference (ChannelPartnerShipToPreference)

    Ship to preference to create

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

    the optional parameters

Returns:



847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
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
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 847

def insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.insert_channel_partner_ship_to_preference ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference"
  end
  # verify the required parameter 'ship_to_preference' is set
  if @api_client.config.client_side_validation && ship_to_preference.nil?
    fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.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(ship_to_preference)

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

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.insert_channel_partner_ship_to_preference",
    :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: ChannelPartnerApi#insert_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Refund a channel partner order Perform a refund operation on a channel partner 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 OrderApi.refundOrder documentation for examples

Returns:



919
920
921
922
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 919

def refund_channel_partner_order(order_id, order, opts = {})
  data, _status_code, _headers = refund_channel_partner_order_with_http_info(order_id, order, opts)
  data
end

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

Refund a channel partner order Perform a refund operation on a channel partner 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 OrderApi.refundOrder documentation for examples

Returns:

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

    OrderResponse data, response status code and response headers



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
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 938

def refund_channel_partner_order_with_http_info(order_id, order, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.refund_channel_partner_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 ChannelPartnerApi.refund_channel_partner_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 ChannelPartnerApi.refund_channel_partner_order"
  end
  # resource path
  local_var_path = '/channel_partner/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 => :"ChannelPartnerApi.refund_channel_partner_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: ChannelPartnerApi#refund_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {}) ⇒ ChannelPartnerShipToPreferenceResponse

Update a ship to preference record for the channel partner. Update a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • ship_to_preference (ChannelPartnerShipToPreference)

    Ship to preference to create

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

    the optional parameters

Returns:



1011
1012
1013
1014
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 1011

def update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {})
  data, _status_code, _headers = update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts)
  data
end

#update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {}) ⇒ Array<(ChannelPartnerShipToPreferenceResponse, Integer, Hash)>

Update a ship to preference record for the channel partner. Update a ship to preference record for the channel partner.

Parameters:

  • channel_partner_oid (Integer)
  • channel_partner_ship_to_preference_oid (Integer)
  • ship_to_preference (ChannelPartnerShipToPreference)

    Ship to preference to create

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

    the optional parameters

Returns:



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
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
# File 'lib/ultracart_api/api/channel_partner_api.rb', line 1023

def update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.update_channel_partner_ship_to_preference ...'
  end
  # verify the required parameter 'channel_partner_oid' is set
  if @api_client.config.client_side_validation && channel_partner_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
  end
  # verify the required parameter 'channel_partner_ship_to_preference_oid' is set
  if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil?
    fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
  end
  # verify the required parameter 'ship_to_preference' is set
  if @api_client.config.client_side_validation && ship_to_preference.nil?
    fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference"
  end
  # resource path
  local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', CGI.escape(channel_partner_oid.to_s)).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', CGI.escape(channel_partner_ship_to_preference_oid.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(ship_to_preference)

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

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

  new_options = opts.merge(
    :operation => :"ChannelPartnerApi.update_channel_partner_ship_to_preference",
    :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: ChannelPartnerApi#update_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end