ultracart_api 4.1.12 → 4.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1121 +1,1678 @@
1
- # UltracartClient::ChannelPartnerApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**cancel_order_by_channel_partner_order_id**](ChannelPartnerApi.md#cancel_order_by_channel_partner_order_id) | **DELETE** /channel_partner/cancel/by_channel_partner_order_id/{order_id} | Cancel channel partner order by channel partner order id |
8
- | [**cancel_order_by_ultra_cart_order_id**](ChannelPartnerApi.md#cancel_order_by_ultra_cart_order_id) | **DELETE** /channel_partner/cancel/by_ultracart_order_id/{order_id} | Cancel channel partner order by UltraCart order id |
9
- | [**delete_channel_partner_ship_to_preference**](ChannelPartnerApi.md#delete_channel_partner_ship_to_preference) | **DELETE** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Delete a ship to preference record for the channel partner. |
10
- | [**estimate_shipping_for_channel_partner_order**](ChannelPartnerApi.md#estimate_shipping_for_channel_partner_order) | **POST** /channel_partner/estimate_shipping | Estimate shipping for channel partner order |
11
- | [**estimate_tax_for_channel_partner_order**](ChannelPartnerApi.md#estimate_tax_for_channel_partner_order) | **POST** /channel_partner/estimate_tax | Estimate tax for channel partner order |
12
- | [**get_channel_partner_order**](ChannelPartnerApi.md#get_channel_partner_order) | **GET** /channel_partner/orders/{order_id} | Retrieve a channel partner order |
13
- | [**get_channel_partner_order_by_channel_partner_order_id**](ChannelPartnerApi.md#get_channel_partner_order_by_channel_partner_order_id) | **GET** /channel_partner/orders/by_channel_partner_order_id/{order_id} | Retrieve a channel partner order by the channel partner order id |
14
- | [**get_channel_partner_reason_codes**](ChannelPartnerApi.md#get_channel_partner_reason_codes) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/reason_codes | Retrieve reject and refund reason codes. |
15
- | [**get_channel_partner_ship_to_preference**](ChannelPartnerApi.md#get_channel_partner_ship_to_preference) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Retrieve the ship to preference associated with the channel partner and the specific id. |
16
- | [**get_channel_partner_ship_to_preferences**](ChannelPartnerApi.md#get_channel_partner_ship_to_preferences) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences | Retrieve the ship to preferences associated with the channel partner. |
17
- | [**get_channel_partners**](ChannelPartnerApi.md#get_channel_partners) | **GET** /channel_partner/channel_partners | Retrieve the channel partners configured on the account. |
18
- | [**import_channel_partner_order**](ChannelPartnerApi.md#import_channel_partner_order) | **POST** /channel_partner/import | Insert channel partner order |
19
- | [**insert_channel_partner_ship_to_preference**](ChannelPartnerApi.md#insert_channel_partner_ship_to_preference) | **POST** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences | Insert a ship to preference record for the channel partner. |
20
- | [**refund_channel_partner_order**](ChannelPartnerApi.md#refund_channel_partner_order) | **PUT** /channel_partner/orders/{order_id}/refund | Refund a channel partner order |
21
- | [**update_channel_partner_ship_to_preference**](ChannelPartnerApi.md#update_channel_partner_ship_to_preference) | **PUT** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Update a ship to preference record for the channel partner. |
22
-
23
-
24
- ## cancel_order_by_channel_partner_order_id
25
-
26
- > <ChannelPartnerCancelResponse> cancel_order_by_channel_partner_order_id(order_id)
27
-
28
- Cancel channel partner order by channel partner order id
29
-
30
- Cancel channel partner order by channel partner order id
31
-
32
- ### Examples
33
-
34
- ```ruby
35
- require 'time'
36
- require 'ultracart_api'
37
- require 'json'
38
- require 'yaml'
39
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
40
-
41
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
42
- # As such, this might not be the best way to use this object.
43
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
44
-
45
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
46
- order_id = 'order_id_example' # String | The channel partner order id to delete.
47
-
48
- begin
49
- # Cancel channel partner order by channel partner order id
50
- result = api_instance.cancel_order_by_channel_partner_order_id(order_id)
51
- p result
52
- rescue UltracartClient::ApiError => e
53
- puts "Error when calling ChannelPartnerApi->cancel_order_by_channel_partner_order_id: #{e}"
54
- end
55
- ```
56
-
57
- #### Using the cancel_order_by_channel_partner_order_id_with_http_info variant
58
-
59
- This returns an Array which contains the response data, status code and headers.
60
-
61
- > <Array(<ChannelPartnerCancelResponse>, Integer, Hash)> cancel_order_by_channel_partner_order_id_with_http_info(order_id)
62
-
63
- ```ruby
64
- begin
65
- # Cancel channel partner order by channel partner order id
66
- data, status_code, headers = api_instance.cancel_order_by_channel_partner_order_id_with_http_info(order_id)
67
- p status_code # => 2xx
68
- p headers # => { ... }
69
- p data # => <ChannelPartnerCancelResponse>
70
- rescue UltracartClient::ApiError => e
71
- puts "Error when calling ChannelPartnerApi->cancel_order_by_channel_partner_order_id_with_http_info: #{e}"
72
- end
73
- ```
74
-
75
- ### Parameters
76
-
77
- | Name | Type | Description | Notes |
78
- | ---- | ---- | ----------- | ----- |
79
- | **order_id** | **String** | The channel partner order id to delete. | |
80
-
81
- ### Return type
82
-
83
- [**ChannelPartnerCancelResponse**](ChannelPartnerCancelResponse.md)
84
-
85
- ### Authorization
86
-
87
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
88
-
89
- ### HTTP request headers
90
-
91
- - **Content-Type**: Not defined
92
- - **Accept**: application/json
93
-
94
-
95
- ## cancel_order_by_ultra_cart_order_id
96
-
97
- > <ChannelPartnerCancelResponse> cancel_order_by_ultra_cart_order_id(order_id)
98
-
99
- Cancel channel partner order by UltraCart order id
100
-
101
- Cancel channel partner order by UltraCart order id
102
-
103
- ### Examples
104
-
105
- ```ruby
106
- require 'time'
107
- require 'ultracart_api'
108
- require 'json'
109
- require 'yaml'
110
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
111
-
112
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
113
- # As such, this might not be the best way to use this object.
114
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
115
-
116
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
117
- order_id = 'order_id_example' # String | The UltraCart order id to delete.
118
-
119
- begin
120
- # Cancel channel partner order by UltraCart order id
121
- result = api_instance.cancel_order_by_ultra_cart_order_id(order_id)
122
- p result
123
- rescue UltracartClient::ApiError => e
124
- puts "Error when calling ChannelPartnerApi->cancel_order_by_ultra_cart_order_id: #{e}"
125
- end
126
- ```
127
-
128
- #### Using the cancel_order_by_ultra_cart_order_id_with_http_info variant
129
-
130
- This returns an Array which contains the response data, status code and headers.
131
-
132
- > <Array(<ChannelPartnerCancelResponse>, Integer, Hash)> cancel_order_by_ultra_cart_order_id_with_http_info(order_id)
133
-
134
- ```ruby
135
- begin
136
- # Cancel channel partner order by UltraCart order id
137
- data, status_code, headers = api_instance.cancel_order_by_ultra_cart_order_id_with_http_info(order_id)
138
- p status_code # => 2xx
139
- p headers # => { ... }
140
- p data # => <ChannelPartnerCancelResponse>
141
- rescue UltracartClient::ApiError => e
142
- puts "Error when calling ChannelPartnerApi->cancel_order_by_ultra_cart_order_id_with_http_info: #{e}"
143
- end
144
- ```
145
-
146
- ### Parameters
147
-
148
- | Name | Type | Description | Notes |
149
- | ---- | ---- | ----------- | ----- |
150
- | **order_id** | **String** | The UltraCart order id to delete. | |
151
-
152
- ### Return type
153
-
154
- [**ChannelPartnerCancelResponse**](ChannelPartnerCancelResponse.md)
155
-
156
- ### Authorization
157
-
158
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
159
-
160
- ### HTTP request headers
161
-
162
- - **Content-Type**: Not defined
163
- - **Accept**: application/json
164
-
165
-
166
- ## delete_channel_partner_ship_to_preference
167
-
168
- > delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
169
-
170
- Delete a ship to preference record for the channel partner.
171
-
172
- Delete a ship to preference record for the channel partner.
173
-
174
- ### Examples
175
-
176
- ```ruby
177
- require 'time'
178
- require 'ultracart_api'
179
- require 'json'
180
- require 'yaml'
181
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
182
-
183
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
184
- # As such, this might not be the best way to use this object.
185
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
186
-
187
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
188
- channel_partner_oid = 56 # Integer |
189
- channel_partner_ship_to_preference_oid = 56 # Integer |
190
-
191
- begin
192
- # Delete a ship to preference record for the channel partner.
193
- api_instance.delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
194
- rescue UltracartClient::ApiError => e
195
- puts "Error when calling ChannelPartnerApi->delete_channel_partner_ship_to_preference: #{e}"
196
- end
197
- ```
198
-
199
- #### Using the delete_channel_partner_ship_to_preference_with_http_info variant
200
-
201
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
202
-
203
- > <Array(nil, Integer, Hash)> delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
204
-
205
- ```ruby
206
- begin
207
- # Delete a ship to preference record for the channel partner.
208
- data, status_code, headers = api_instance.delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
209
- p status_code # => 2xx
210
- p headers # => { ... }
211
- p data # => nil
212
- rescue UltracartClient::ApiError => e
213
- puts "Error when calling ChannelPartnerApi->delete_channel_partner_ship_to_preference_with_http_info: #{e}"
214
- end
215
- ```
216
-
217
- ### Parameters
218
-
219
- | Name | Type | Description | Notes |
220
- | ---- | ---- | ----------- | ----- |
221
- | **channel_partner_oid** | **Integer** | | |
222
- | **channel_partner_ship_to_preference_oid** | **Integer** | | |
223
-
224
- ### Return type
225
-
226
- nil (empty response body)
227
-
228
- ### Authorization
229
-
230
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
231
-
232
- ### HTTP request headers
233
-
234
- - **Content-Type**: Not defined
235
- - **Accept**: application/json
236
-
237
-
238
- ## estimate_shipping_for_channel_partner_order
239
-
240
- > <ChannelPartnerEstimateShippingResponse> estimate_shipping_for_channel_partner_order(channel_partner_order)
241
-
242
- Estimate shipping for channel partner order
243
-
244
- Estimate shipping for order from a channel partner.
245
-
246
- ### Examples
247
-
248
- ```ruby
249
- require 'time'
250
- require 'ultracart_api'
251
- require 'json'
252
- require 'yaml'
253
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
254
-
255
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
256
- # As such, this might not be the best way to use this object.
257
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
258
-
259
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
260
- channel_partner_order = UltracartClient::ChannelPartnerOrder.new # ChannelPartnerOrder | Order needing shipping estimate
261
-
262
- begin
263
- # Estimate shipping for channel partner order
264
- result = api_instance.estimate_shipping_for_channel_partner_order(channel_partner_order)
265
- p result
266
- rescue UltracartClient::ApiError => e
267
- puts "Error when calling ChannelPartnerApi->estimate_shipping_for_channel_partner_order: #{e}"
268
- end
269
- ```
270
-
271
- #### Using the estimate_shipping_for_channel_partner_order_with_http_info variant
272
-
273
- This returns an Array which contains the response data, status code and headers.
274
-
275
- > <Array(<ChannelPartnerEstimateShippingResponse>, Integer, Hash)> estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order)
276
-
277
- ```ruby
278
- begin
279
- # Estimate shipping for channel partner order
280
- data, status_code, headers = api_instance.estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order)
281
- p status_code # => 2xx
282
- p headers # => { ... }
283
- p data # => <ChannelPartnerEstimateShippingResponse>
284
- rescue UltracartClient::ApiError => e
285
- puts "Error when calling ChannelPartnerApi->estimate_shipping_for_channel_partner_order_with_http_info: #{e}"
286
- end
287
- ```
288
-
289
- ### Parameters
290
-
291
- | Name | Type | Description | Notes |
292
- | ---- | ---- | ----------- | ----- |
293
- | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order needing shipping estimate | |
294
-
295
- ### Return type
296
-
297
- [**ChannelPartnerEstimateShippingResponse**](ChannelPartnerEstimateShippingResponse.md)
298
-
299
- ### Authorization
300
-
301
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
302
-
303
- ### HTTP request headers
304
-
305
- - **Content-Type**: application/json; charset=UTF-8
306
- - **Accept**: application/json
307
-
308
-
309
- ## estimate_tax_for_channel_partner_order
310
-
311
- > <ChannelPartnerEstimateTaxResponse> estimate_tax_for_channel_partner_order(channel_partner_order)
312
-
313
- Estimate tax for channel partner order
314
-
315
- Estimate tax for order from a channel partner.
316
-
317
- ### Examples
318
-
319
- ```ruby
320
- require 'time'
321
- require 'ultracart_api'
322
- require 'json'
323
- require 'yaml'
324
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
325
-
326
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
327
- # As such, this might not be the best way to use this object.
328
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
329
-
330
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
331
- channel_partner_order = UltracartClient::ChannelPartnerOrder.new # ChannelPartnerOrder | Order needing tax estimate
332
-
333
- begin
334
- # Estimate tax for channel partner order
335
- result = api_instance.estimate_tax_for_channel_partner_order(channel_partner_order)
336
- p result
337
- rescue UltracartClient::ApiError => e
338
- puts "Error when calling ChannelPartnerApi->estimate_tax_for_channel_partner_order: #{e}"
339
- end
340
- ```
341
-
342
- #### Using the estimate_tax_for_channel_partner_order_with_http_info variant
343
-
344
- This returns an Array which contains the response data, status code and headers.
345
-
346
- > <Array(<ChannelPartnerEstimateTaxResponse>, Integer, Hash)> estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order)
347
-
348
- ```ruby
349
- begin
350
- # Estimate tax for channel partner order
351
- data, status_code, headers = api_instance.estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order)
352
- p status_code # => 2xx
353
- p headers # => { ... }
354
- p data # => <ChannelPartnerEstimateTaxResponse>
355
- rescue UltracartClient::ApiError => e
356
- puts "Error when calling ChannelPartnerApi->estimate_tax_for_channel_partner_order_with_http_info: #{e}"
357
- end
358
- ```
359
-
360
- ### Parameters
361
-
362
- | Name | Type | Description | Notes |
363
- | ---- | ---- | ----------- | ----- |
364
- | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order needing tax estimate | |
365
-
366
- ### Return type
367
-
368
- [**ChannelPartnerEstimateTaxResponse**](ChannelPartnerEstimateTaxResponse.md)
369
-
370
- ### Authorization
371
-
372
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
373
-
374
- ### HTTP request headers
375
-
376
- - **Content-Type**: application/json; charset=UTF-8
377
- - **Accept**: application/json
378
-
379
-
380
- ## get_channel_partner_order
381
-
382
- > <OrderResponse> get_channel_partner_order(order_id, opts)
383
-
384
- Retrieve a channel partner order
385
-
386
- Retrieves a single order using the specified order id. Only orders belonging to this channel partner may be retrieved.
387
-
388
- ### Examples
389
-
390
- ```ruby
391
- require 'time'
392
- require 'ultracart_api'
393
- require 'json'
394
- require 'yaml'
395
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
396
-
397
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
398
- # As such, this might not be the best way to use this object.
399
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
400
-
401
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
402
- order_id = 'order_id_example' # String | The order id to retrieve.
403
- opts = {
404
- _expand: '_expand_example' # String | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples
405
- }
406
-
407
- begin
408
- # Retrieve a channel partner order
409
- result = api_instance.get_channel_partner_order(order_id, opts)
410
- p result
411
- rescue UltracartClient::ApiError => e
412
- puts "Error when calling ChannelPartnerApi->get_channel_partner_order: #{e}"
413
- end
414
- ```
415
-
416
- #### Using the get_channel_partner_order_with_http_info variant
417
-
418
- This returns an Array which contains the response data, status code and headers.
419
-
420
- > <Array(<OrderResponse>, Integer, Hash)> get_channel_partner_order_with_http_info(order_id, opts)
421
-
422
- ```ruby
423
- begin
424
- # Retrieve a channel partner order
425
- data, status_code, headers = api_instance.get_channel_partner_order_with_http_info(order_id, opts)
426
- p status_code # => 2xx
427
- p headers # => { ... }
428
- p data # => <OrderResponse>
429
- rescue UltracartClient::ApiError => e
430
- puts "Error when calling ChannelPartnerApi->get_channel_partner_order_with_http_info: #{e}"
431
- end
432
- ```
433
-
434
- ### Parameters
435
-
436
- | Name | Type | Description | Notes |
437
- | ---- | ---- | ----------- | ----- |
438
- | **order_id** | **String** | The order id to retrieve. | |
439
- | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples | [optional] |
440
-
441
- ### Return type
442
-
443
- [**OrderResponse**](OrderResponse.md)
444
-
445
- ### Authorization
446
-
447
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
448
-
449
- ### HTTP request headers
450
-
451
- - **Content-Type**: Not defined
452
- - **Accept**: application/json
453
-
454
-
455
- ## get_channel_partner_order_by_channel_partner_order_id
456
-
457
- > <OrderResponse> get_channel_partner_order_by_channel_partner_order_id(order_id, opts)
458
-
459
- Retrieve a channel partner order by the channel partner order id
460
-
461
- 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.
462
-
463
- ### Examples
464
-
465
- ```ruby
466
- require 'time'
467
- require 'ultracart_api'
468
- require 'json'
469
- require 'yaml'
470
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
471
-
472
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
473
- # As such, this might not be the best way to use this object.
474
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
475
-
476
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
477
- order_id = 'order_id_example' # String | The channel partner order id to retrieve.
478
- opts = {
479
- _expand: '_expand_example' # String | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples
480
- }
481
-
482
- begin
483
- # Retrieve a channel partner order by the channel partner order id
484
- result = api_instance.get_channel_partner_order_by_channel_partner_order_id(order_id, opts)
485
- p result
486
- rescue UltracartClient::ApiError => e
487
- puts "Error when calling ChannelPartnerApi->get_channel_partner_order_by_channel_partner_order_id: #{e}"
488
- end
489
- ```
490
-
491
- #### Using the get_channel_partner_order_by_channel_partner_order_id_with_http_info variant
492
-
493
- This returns an Array which contains the response data, status code and headers.
494
-
495
- > <Array(<OrderResponse>, Integer, Hash)> get_channel_partner_order_by_channel_partner_order_id_with_http_info(order_id, opts)
496
-
497
- ```ruby
498
- begin
499
- # Retrieve a channel partner order by the channel partner order id
500
- data, status_code, headers = api_instance.get_channel_partner_order_by_channel_partner_order_id_with_http_info(order_id, opts)
501
- p status_code # => 2xx
502
- p headers # => { ... }
503
- p data # => <OrderResponse>
504
- rescue UltracartClient::ApiError => e
505
- puts "Error when calling ChannelPartnerApi->get_channel_partner_order_by_channel_partner_order_id_with_http_info: #{e}"
506
- end
507
- ```
508
-
509
- ### Parameters
510
-
511
- | Name | Type | Description | Notes |
512
- | ---- | ---- | ----------- | ----- |
513
- | **order_id** | **String** | The channel partner order id to retrieve. | |
514
- | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples | [optional] |
515
-
516
- ### Return type
517
-
518
- [**OrderResponse**](OrderResponse.md)
519
-
520
- ### Authorization
521
-
522
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
523
-
524
- ### HTTP request headers
525
-
526
- - **Content-Type**: Not defined
527
- - **Accept**: application/json
528
-
529
-
530
- ## get_channel_partner_reason_codes
531
-
532
- > <ChanelPartnerReasonCodesResponse> get_channel_partner_reason_codes(channel_partner_oid)
533
-
534
- Retrieve reject and refund reason codes.
535
-
536
- Retrieve reject and refund reason codes.
537
-
538
- ### Examples
539
-
540
- ```ruby
541
- require 'time'
542
- require 'ultracart_api'
543
- require 'json'
544
- require 'yaml'
545
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
546
-
547
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
548
- # As such, this might not be the best way to use this object.
549
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
550
-
551
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
552
- channel_partner_oid = 56 # Integer |
553
-
554
- begin
555
- # Retrieve reject and refund reason codes.
556
- result = api_instance.get_channel_partner_reason_codes(channel_partner_oid)
557
- p result
558
- rescue UltracartClient::ApiError => e
559
- puts "Error when calling ChannelPartnerApi->get_channel_partner_reason_codes: #{e}"
560
- end
561
- ```
562
-
563
- #### Using the get_channel_partner_reason_codes_with_http_info variant
564
-
565
- This returns an Array which contains the response data, status code and headers.
566
-
567
- > <Array(<ChanelPartnerReasonCodesResponse>, Integer, Hash)> get_channel_partner_reason_codes_with_http_info(channel_partner_oid)
568
-
569
- ```ruby
570
- begin
571
- # Retrieve reject and refund reason codes.
572
- data, status_code, headers = api_instance.get_channel_partner_reason_codes_with_http_info(channel_partner_oid)
573
- p status_code # => 2xx
574
- p headers # => { ... }
575
- p data # => <ChanelPartnerReasonCodesResponse>
576
- rescue UltracartClient::ApiError => e
577
- puts "Error when calling ChannelPartnerApi->get_channel_partner_reason_codes_with_http_info: #{e}"
578
- end
579
- ```
580
-
581
- ### Parameters
582
-
583
- | Name | Type | Description | Notes |
584
- | ---- | ---- | ----------- | ----- |
585
- | **channel_partner_oid** | **Integer** | | |
586
-
587
- ### Return type
588
-
589
- [**ChanelPartnerReasonCodesResponse**](ChanelPartnerReasonCodesResponse.md)
590
-
591
- ### Authorization
592
-
593
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
594
-
595
- ### HTTP request headers
596
-
597
- - **Content-Type**: Not defined
598
- - **Accept**: application/json
599
-
600
-
601
- ## get_channel_partner_ship_to_preference
602
-
603
- > <ChannelPartnerShipToPreferenceResponse> get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
604
-
605
- Retrieve the ship to preference associated with the channel partner and the specific id.
606
-
607
- Retrieve the ship to preference associated with the channel partner and the specific id.
608
-
609
- ### Examples
610
-
611
- ```ruby
612
- require 'time'
613
- require 'ultracart_api'
614
- require 'json'
615
- require 'yaml'
616
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
617
-
618
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
619
- # As such, this might not be the best way to use this object.
620
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
621
-
622
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
623
- channel_partner_oid = 56 # Integer |
624
- channel_partner_ship_to_preference_oid = 56 # Integer |
625
-
626
- begin
627
- # Retrieve the ship to preference associated with the channel partner and the specific id.
628
- result = api_instance.get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
629
- p result
630
- rescue UltracartClient::ApiError => e
631
- puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preference: #{e}"
632
- end
633
- ```
634
-
635
- #### Using the get_channel_partner_ship_to_preference_with_http_info variant
636
-
637
- This returns an Array which contains the response data, status code and headers.
638
-
639
- > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
640
-
641
- ```ruby
642
- begin
643
- # Retrieve the ship to preference associated with the channel partner and the specific id.
644
- data, status_code, headers = api_instance.get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
645
- p status_code # => 2xx
646
- p headers # => { ... }
647
- p data # => <ChannelPartnerShipToPreferenceResponse>
648
- rescue UltracartClient::ApiError => e
649
- puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preference_with_http_info: #{e}"
650
- end
651
- ```
652
-
653
- ### Parameters
654
-
655
- | Name | Type | Description | Notes |
656
- | ---- | ---- | ----------- | ----- |
657
- | **channel_partner_oid** | **Integer** | | |
658
- | **channel_partner_ship_to_preference_oid** | **Integer** | | |
659
-
660
- ### Return type
661
-
662
- [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
663
-
664
- ### Authorization
665
-
666
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
667
-
668
- ### HTTP request headers
669
-
670
- - **Content-Type**: Not defined
671
- - **Accept**: application/json
672
-
673
-
674
- ## get_channel_partner_ship_to_preferences
675
-
676
- > <ChannelPartnerShipToPreferencesResponse> get_channel_partner_ship_to_preferences(channel_partner_oid)
677
-
678
- Retrieve the ship to preferences associated with the channel partner.
679
-
680
- Retrieve the ship to preferences associated with the channel partner.
681
-
682
- ### Examples
683
-
684
- ```ruby
685
- require 'time'
686
- require 'ultracart_api'
687
- require 'json'
688
- require 'yaml'
689
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
690
-
691
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
692
- # As such, this might not be the best way to use this object.
693
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
694
-
695
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
696
- channel_partner_oid = 56 # Integer |
697
-
698
- begin
699
- # Retrieve the ship to preferences associated with the channel partner.
700
- result = api_instance.get_channel_partner_ship_to_preferences(channel_partner_oid)
701
- p result
702
- rescue UltracartClient::ApiError => e
703
- puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preferences: #{e}"
704
- end
705
- ```
706
-
707
- #### Using the get_channel_partner_ship_to_preferences_with_http_info variant
708
-
709
- This returns an Array which contains the response data, status code and headers.
710
-
711
- > <Array(<ChannelPartnerShipToPreferencesResponse>, Integer, Hash)> get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid)
712
-
713
- ```ruby
714
- begin
715
- # Retrieve the ship to preferences associated with the channel partner.
716
- data, status_code, headers = api_instance.get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid)
717
- p status_code # => 2xx
718
- p headers # => { ... }
719
- p data # => <ChannelPartnerShipToPreferencesResponse>
720
- rescue UltracartClient::ApiError => e
721
- puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preferences_with_http_info: #{e}"
722
- end
723
- ```
724
-
725
- ### Parameters
726
-
727
- | Name | Type | Description | Notes |
728
- | ---- | ---- | ----------- | ----- |
729
- | **channel_partner_oid** | **Integer** | | |
730
-
731
- ### Return type
732
-
733
- [**ChannelPartnerShipToPreferencesResponse**](ChannelPartnerShipToPreferencesResponse.md)
734
-
735
- ### Authorization
736
-
737
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
738
-
739
- ### HTTP request headers
740
-
741
- - **Content-Type**: Not defined
742
- - **Accept**: application/json
743
-
744
-
745
- ## get_channel_partners
746
-
747
- > <ChannelPartnersResponse> get_channel_partners
748
-
749
- Retrieve the channel partners configured on the account.
750
-
751
- Retrieve the channel partners configured on the account.
752
-
753
- ### Examples
754
-
755
- ```ruby
756
- require 'time'
757
- require 'ultracart_api'
758
- require 'json'
759
- require 'yaml'
760
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
761
-
762
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
763
- # As such, this might not be the best way to use this object.
764
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
765
-
766
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
767
-
768
- begin
769
- # Retrieve the channel partners configured on the account.
770
- result = api_instance.get_channel_partners
771
- p result
772
- rescue UltracartClient::ApiError => e
773
- puts "Error when calling ChannelPartnerApi->get_channel_partners: #{e}"
774
- end
775
- ```
776
-
777
- #### Using the get_channel_partners_with_http_info variant
778
-
779
- This returns an Array which contains the response data, status code and headers.
780
-
781
- > <Array(<ChannelPartnersResponse>, Integer, Hash)> get_channel_partners_with_http_info
782
-
783
- ```ruby
784
- begin
785
- # Retrieve the channel partners configured on the account.
786
- data, status_code, headers = api_instance.get_channel_partners_with_http_info
787
- p status_code # => 2xx
788
- p headers # => { ... }
789
- p data # => <ChannelPartnersResponse>
790
- rescue UltracartClient::ApiError => e
791
- puts "Error when calling ChannelPartnerApi->get_channel_partners_with_http_info: #{e}"
792
- end
793
- ```
794
-
795
- ### Parameters
796
-
797
- This endpoint does not need any parameter.
798
-
799
- ### Return type
800
-
801
- [**ChannelPartnersResponse**](ChannelPartnersResponse.md)
802
-
803
- ### Authorization
804
-
805
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
806
-
807
- ### HTTP request headers
808
-
809
- - **Content-Type**: Not defined
810
- - **Accept**: application/json
811
-
812
-
813
- ## import_channel_partner_order
814
-
815
- > <ChannelPartnerImportResponse> import_channel_partner_order(channel_partner_order)
816
-
817
- Insert channel partner order
818
-
819
- Insert order from a channel partner.
820
-
821
- ### Examples
822
-
823
- ```ruby
824
- require 'time'
825
- require 'ultracart_api'
826
- require 'json'
827
- require 'yaml'
828
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
829
-
830
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
831
- # As such, this might not be the best way to use this object.
832
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
833
-
834
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
835
- channel_partner_order = UltracartClient::ChannelPartnerOrder.new # ChannelPartnerOrder | Order to insert
836
-
837
- begin
838
- # Insert channel partner order
839
- result = api_instance.import_channel_partner_order(channel_partner_order)
840
- p result
841
- rescue UltracartClient::ApiError => e
842
- puts "Error when calling ChannelPartnerApi->import_channel_partner_order: #{e}"
843
- end
844
- ```
845
-
846
- #### Using the import_channel_partner_order_with_http_info variant
847
-
848
- This returns an Array which contains the response data, status code and headers.
849
-
850
- > <Array(<ChannelPartnerImportResponse>, Integer, Hash)> import_channel_partner_order_with_http_info(channel_partner_order)
851
-
852
- ```ruby
853
- begin
854
- # Insert channel partner order
855
- data, status_code, headers = api_instance.import_channel_partner_order_with_http_info(channel_partner_order)
856
- p status_code # => 2xx
857
- p headers # => { ... }
858
- p data # => <ChannelPartnerImportResponse>
859
- rescue UltracartClient::ApiError => e
860
- puts "Error when calling ChannelPartnerApi->import_channel_partner_order_with_http_info: #{e}"
861
- end
862
- ```
863
-
864
- ### Parameters
865
-
866
- | Name | Type | Description | Notes |
867
- | ---- | ---- | ----------- | ----- |
868
- | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order to insert | |
869
-
870
- ### Return type
871
-
872
- [**ChannelPartnerImportResponse**](ChannelPartnerImportResponse.md)
873
-
874
- ### Authorization
875
-
876
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
877
-
878
- ### HTTP request headers
879
-
880
- - **Content-Type**: application/json; charset=UTF-8
881
- - **Accept**: application/json
882
-
883
-
884
- ## insert_channel_partner_ship_to_preference
885
-
886
- > <ChannelPartnerShipToPreferenceResponse> insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference)
887
-
888
- Insert a ship to preference record for the channel partner.
889
-
890
- Insert a ship to preference record for the channel partner.
891
-
892
- ### Examples
893
-
894
- ```ruby
895
- require 'time'
896
- require 'ultracart_api'
897
- require 'json'
898
- require 'yaml'
899
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
900
-
901
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
902
- # As such, this might not be the best way to use this object.
903
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
904
-
905
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
906
- channel_partner_oid = 56 # Integer |
907
- ship_to_preference = UltracartClient::ChannelPartnerShipToPreference.new # ChannelPartnerShipToPreference | Ship to preference to create
908
-
909
- begin
910
- # Insert a ship to preference record for the channel partner.
911
- result = api_instance.insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference)
912
- p result
913
- rescue UltracartClient::ApiError => e
914
- puts "Error when calling ChannelPartnerApi->insert_channel_partner_ship_to_preference: #{e}"
915
- end
916
- ```
917
-
918
- #### Using the insert_channel_partner_ship_to_preference_with_http_info variant
919
-
920
- This returns an Array which contains the response data, status code and headers.
921
-
922
- > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference)
923
-
924
- ```ruby
925
- begin
926
- # Insert a ship to preference record for the channel partner.
927
- data, status_code, headers = api_instance.insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference)
928
- p status_code # => 2xx
929
- p headers # => { ... }
930
- p data # => <ChannelPartnerShipToPreferenceResponse>
931
- rescue UltracartClient::ApiError => e
932
- puts "Error when calling ChannelPartnerApi->insert_channel_partner_ship_to_preference_with_http_info: #{e}"
933
- end
934
- ```
935
-
936
- ### Parameters
937
-
938
- | Name | Type | Description | Notes |
939
- | ---- | ---- | ----------- | ----- |
940
- | **channel_partner_oid** | **Integer** | | |
941
- | **ship_to_preference** | [**ChannelPartnerShipToPreference**](ChannelPartnerShipToPreference.md) | Ship to preference to create | |
942
-
943
- ### Return type
944
-
945
- [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
946
-
947
- ### Authorization
948
-
949
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
950
-
951
- ### HTTP request headers
952
-
953
- - **Content-Type**: application/json
954
- - **Accept**: application/json
955
-
956
-
957
- ## refund_channel_partner_order
958
-
959
- > <OrderResponse> refund_channel_partner_order(order_id, order, opts)
960
-
961
- Refund a channel partner order
962
-
963
- 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.
964
-
965
- ### Examples
966
-
967
- ```ruby
968
- require 'time'
969
- require 'ultracart_api'
970
- require 'json'
971
- require 'yaml'
972
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
973
-
974
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
975
- # As such, this might not be the best way to use this object.
976
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
977
-
978
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
979
- order_id = 'order_id_example' # String | The order id to refund.
980
- order = UltracartClient::Order.new # Order | Order to refund
981
- opts = {
982
- reject_after_refund: true, # Boolean | Reject order after refund
983
- skip_customer_notification: true, # Boolean | Skip customer email notification
984
- auto_order_cancel: true, # Boolean | Cancel associated auto orders
985
- manual_refund: true, # Boolean | Consider a manual refund done externally
986
- reverse_affiliate_transactions: true, # Boolean | Reverse affiliate transactions
987
- issue_store_credit: true, # Boolean | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account
988
- auto_order_cancel_reason: 'auto_order_cancel_reason_example', # String | Reason for auto orders cancellation
989
- _expand: '_expand_example' # String | The object expansion to perform on the result. See OrderApi.refundOrder documentation for examples
990
- }
991
-
992
- begin
993
- # Refund a channel partner order
994
- result = api_instance.refund_channel_partner_order(order_id, order, opts)
995
- p result
996
- rescue UltracartClient::ApiError => e
997
- puts "Error when calling ChannelPartnerApi->refund_channel_partner_order: #{e}"
998
- end
999
- ```
1000
-
1001
- #### Using the refund_channel_partner_order_with_http_info variant
1002
-
1003
- This returns an Array which contains the response data, status code and headers.
1004
-
1005
- > <Array(<OrderResponse>, Integer, Hash)> refund_channel_partner_order_with_http_info(order_id, order, opts)
1006
-
1007
- ```ruby
1008
- begin
1009
- # Refund a channel partner order
1010
- data, status_code, headers = api_instance.refund_channel_partner_order_with_http_info(order_id, order, opts)
1011
- p status_code # => 2xx
1012
- p headers # => { ... }
1013
- p data # => <OrderResponse>
1014
- rescue UltracartClient::ApiError => e
1015
- puts "Error when calling ChannelPartnerApi->refund_channel_partner_order_with_http_info: #{e}"
1016
- end
1017
- ```
1018
-
1019
- ### Parameters
1020
-
1021
- | Name | Type | Description | Notes |
1022
- | ---- | ---- | ----------- | ----- |
1023
- | **order_id** | **String** | The order id to refund. | |
1024
- | **order** | [**Order**](Order.md) | Order to refund | |
1025
- | **reject_after_refund** | **Boolean** | Reject order after refund | [optional][default to false] |
1026
- | **skip_customer_notification** | **Boolean** | Skip customer email notification | [optional][default to false] |
1027
- | **auto_order_cancel** | **Boolean** | Cancel associated auto orders | [optional][default to false] |
1028
- | **manual_refund** | **Boolean** | Consider a manual refund done externally | [optional][default to false] |
1029
- | **reverse_affiliate_transactions** | **Boolean** | Reverse affiliate transactions | [optional][default to true] |
1030
- | **issue_store_credit** | **Boolean** | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account | [optional][default to false] |
1031
- | **auto_order_cancel_reason** | **String** | Reason for auto orders cancellation | [optional] |
1032
- | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.refundOrder documentation for examples | [optional] |
1033
-
1034
- ### Return type
1035
-
1036
- [**OrderResponse**](OrderResponse.md)
1037
-
1038
- ### Authorization
1039
-
1040
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1041
-
1042
- ### HTTP request headers
1043
-
1044
- - **Content-Type**: application/json; charset=UTF-8
1045
- - **Accept**: application/json
1046
-
1047
-
1048
- ## update_channel_partner_ship_to_preference
1049
-
1050
- > <ChannelPartnerShipToPreferenceResponse> update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1051
-
1052
- Update a ship to preference record for the channel partner.
1053
-
1054
- Update a ship to preference record for the channel partner.
1055
-
1056
- ### Examples
1057
-
1058
- ```ruby
1059
- require 'time'
1060
- require 'ultracart_api'
1061
- require 'json'
1062
- require 'yaml'
1063
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1064
-
1065
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1066
- # As such, this might not be the best way to use this object.
1067
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
1068
-
1069
- api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1070
- channel_partner_oid = 56 # Integer |
1071
- channel_partner_ship_to_preference_oid = 56 # Integer |
1072
- ship_to_preference = UltracartClient::ChannelPartnerShipToPreference.new # ChannelPartnerShipToPreference | Ship to preference to create
1073
-
1074
- begin
1075
- # Update a ship to preference record for the channel partner.
1076
- result = api_instance.update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1077
- p result
1078
- rescue UltracartClient::ApiError => e
1079
- puts "Error when calling ChannelPartnerApi->update_channel_partner_ship_to_preference: #{e}"
1080
- end
1081
- ```
1082
-
1083
- #### Using the update_channel_partner_ship_to_preference_with_http_info variant
1084
-
1085
- This returns an Array which contains the response data, status code and headers.
1086
-
1087
- > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1088
-
1089
- ```ruby
1090
- begin
1091
- # Update a ship to preference record for the channel partner.
1092
- data, status_code, headers = api_instance.update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1093
- p status_code # => 2xx
1094
- p headers # => { ... }
1095
- p data # => <ChannelPartnerShipToPreferenceResponse>
1096
- rescue UltracartClient::ApiError => e
1097
- puts "Error when calling ChannelPartnerApi->update_channel_partner_ship_to_preference_with_http_info: #{e}"
1098
- end
1099
- ```
1100
-
1101
- ### Parameters
1102
-
1103
- | Name | Type | Description | Notes |
1104
- | ---- | ---- | ----------- | ----- |
1105
- | **channel_partner_oid** | **Integer** | | |
1106
- | **channel_partner_ship_to_preference_oid** | **Integer** | | |
1107
- | **ship_to_preference** | [**ChannelPartnerShipToPreference**](ChannelPartnerShipToPreference.md) | Ship to preference to create | |
1108
-
1109
- ### Return type
1110
-
1111
- [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
1112
-
1113
- ### Authorization
1114
-
1115
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1116
-
1117
- ### HTTP request headers
1118
-
1119
- - **Content-Type**: application/json
1120
- - **Accept**: application/json
1121
-
1
+ # UltracartClient::ChannelPartnerApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**cancel_order_by_channel_partner_order_id**](ChannelPartnerApi.md#cancel_order_by_channel_partner_order_id) | **DELETE** /channel_partner/cancel/by_channel_partner_order_id/{order_id} | Cancel channel partner order by channel partner order id |
8
+ | [**cancel_order_by_ultra_cart_order_id**](ChannelPartnerApi.md#cancel_order_by_ultra_cart_order_id) | **DELETE** /channel_partner/cancel/by_ultracart_order_id/{order_id} | Cancel channel partner order by UltraCart order id |
9
+ | [**delete_channel_partner_ship_to_preference**](ChannelPartnerApi.md#delete_channel_partner_ship_to_preference) | **DELETE** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Delete a ship to preference record for the channel partner. |
10
+ | [**estimate_shipping_for_channel_partner_order**](ChannelPartnerApi.md#estimate_shipping_for_channel_partner_order) | **POST** /channel_partner/estimate_shipping | Estimate shipping for channel partner order |
11
+ | [**estimate_tax_for_channel_partner_order**](ChannelPartnerApi.md#estimate_tax_for_channel_partner_order) | **POST** /channel_partner/estimate_tax | Estimate tax for channel partner order |
12
+ | [**get_channel_partner_order**](ChannelPartnerApi.md#get_channel_partner_order) | **GET** /channel_partner/orders/{order_id} | Retrieve a channel partner order |
13
+ | [**get_channel_partner_order_by_channel_partner_order_id**](ChannelPartnerApi.md#get_channel_partner_order_by_channel_partner_order_id) | **GET** /channel_partner/orders/by_channel_partner_order_id/{order_id} | Retrieve a channel partner order by the channel partner order id |
14
+ | [**get_channel_partner_reason_codes**](ChannelPartnerApi.md#get_channel_partner_reason_codes) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/reason_codes | Retrieve reject and refund reason codes. |
15
+ | [**get_channel_partner_ship_to_preference**](ChannelPartnerApi.md#get_channel_partner_ship_to_preference) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Retrieve the ship to preference associated with the channel partner and the specific id. |
16
+ | [**get_channel_partner_ship_to_preferences**](ChannelPartnerApi.md#get_channel_partner_ship_to_preferences) | **GET** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences | Retrieve the ship to preferences associated with the channel partner. |
17
+ | [**get_channel_partners**](ChannelPartnerApi.md#get_channel_partners) | **GET** /channel_partner/channel_partners | Retrieve the channel partners configured on the account. |
18
+ | [**import_channel_partner_order**](ChannelPartnerApi.md#import_channel_partner_order) | **POST** /channel_partner/import | Insert channel partner order |
19
+ | [**insert_channel_partner_ship_to_preference**](ChannelPartnerApi.md#insert_channel_partner_ship_to_preference) | **POST** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences | Insert a ship to preference record for the channel partner. |
20
+ | [**refund_channel_partner_order**](ChannelPartnerApi.md#refund_channel_partner_order) | **PUT** /channel_partner/orders/{order_id}/refund | Refund a channel partner order |
21
+ | [**update_channel_partner_ship_to_preference**](ChannelPartnerApi.md#update_channel_partner_ship_to_preference) | **PUT** /channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid} | Update a ship to preference record for the channel partner. |
22
+
23
+
24
+ ## cancel_order_by_channel_partner_order_id
25
+
26
+ > <ChannelPartnerCancelResponse> cancel_order_by_channel_partner_order_id(order_id)
27
+
28
+ Cancel channel partner order by channel partner order id
29
+
30
+ Cancel channel partner order by channel partner order id
31
+
32
+
33
+ ### Examples
34
+
35
+ ```ruby
36
+ require 'ultracart_api'
37
+ require_relative '../constants'
38
+
39
+ # cancelOrderByChannelPartnerOrderId takes a channel partner order id, which is the external order id, and attempts
40
+ # to 'cancel' the order. UltraCart doesn't have a cancel order state, so this needs some explanation of what happens.
41
+ #
42
+ # Here is the logic of the cancel process:
43
+ # If the Order stage is [this] then do [that]:
44
+ # 'Completed Order' -> Error: "Order has already been completed."
45
+ # 'Rejected' -> Error: "Order has already been rejected."
46
+ # 'Accounts Receivable' -> Success: order is rejected.
47
+ # 'Preordered' -> Success: order is rejected.
48
+ # 'Quote Sent' -> Success: order is rejected.
49
+ # 'Quote Requested' -> Success: order is rejected.
50
+ #
51
+ # The remaining stages are Fraud Review and Shipping Department. Orders in these stages have already completed payment.
52
+ # From this point, complex logic determines if the order has already shipped, or is queued to ship in a way that cannot be canceled.
53
+ # Here is the logic for those stages, but the gist of it all is this: If you receive any of the errors below, the order has progressed past a point where it can be canceled.
54
+ # SHIPPING LOGIC:
55
+ # Iterate through each item and consider it's shipping status:
56
+ # Item has already been transmitted to fulfillment center (contains a transmitted dts) -> Error: "The order has already had an item that has been transmitted to the distribution center."
57
+ # Does item DC (distribution center) have a transmission mechanism configured?
58
+ # YES -> Does the transmission have schedules? If NO -> Error: "The distribution center does not have any schedules so it would be an immediate transmission."
59
+ # NO -> Error: "Cant tell if we can cancel because the DC doesnt have a transport configured."
60
+ #
61
+ # If the above logic completes without errors, the following conditions must be met:
62
+ # Order has DC activity records. If NO -> Error: "There is no activity in the DC queue when there should be."
63
+ # There must be at least 5 minutes before the next DC transmission. If NO -> Error: "Activity record is not at least 5 minutes away so we need to bail."
64
+ #
65
+ # At this point, the order will be canceled with the following activity:
66
+ # 1) Distribution Center activity is cleared
67
+ # 2) The order is refunded. If the order is less than 24 hours old, a void is attempted instead.
68
+ #
69
+ #
70
+ # Other Possible Errors:
71
+ # System errors -> "Internal error. Please contact UltraCart Support."
72
+ # Order does not exist -> "Invalid order ID specified."
73
+ # During refunding, original transaction could not be found -> "Unable to find original transaction on the order."
74
+ # During refunding, original transaction was found, but transaction id could not be found -> "Unable to locate original transaction reference number."
75
+ # During refunding, PayPal was used by no longer configured -> "PayPal is no longer configured on your account to refund against."
76
+ # Gateway does not support refunds -> [GatewayName] does not support refunds at this time.
77
+
78
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
79
+
80
+ channel_partner_order_id = 'BLAH-BLAH-123'
81
+ begin
82
+ cancel_result = channel_partner_api.cancel_order_by_channel_partner_order_id(channel_partner_order_id)
83
+ unless cancel_result.success
84
+ cancel_result.cancel_errors.each do |error|
85
+ puts error
86
+ end
87
+ end
88
+ rescue UltracartClient::ApiError => e
89
+ puts e.inspect # Dumps all exception information
90
+ end
91
+ ```
92
+
93
+
94
+ #### Using the cancel_order_by_channel_partner_order_id_with_http_info variant
95
+
96
+ This returns an Array which contains the response data, status code and headers.
97
+
98
+ > <Array(<ChannelPartnerCancelResponse>, Integer, Hash)> cancel_order_by_channel_partner_order_id_with_http_info(order_id)
99
+
100
+ ```ruby
101
+ begin
102
+ # Cancel channel partner order by channel partner order id
103
+ data, status_code, headers = api_instance.cancel_order_by_channel_partner_order_id_with_http_info(order_id)
104
+ p status_code # => 2xx
105
+ p headers # => { ... }
106
+ p data # => <ChannelPartnerCancelResponse>
107
+ rescue UltracartClient::ApiError => e
108
+ puts "Error when calling ChannelPartnerApi->cancel_order_by_channel_partner_order_id_with_http_info: #{e}"
109
+ end
110
+ ```
111
+
112
+ ### Parameters
113
+
114
+ | Name | Type | Description | Notes |
115
+ | ---- | ---- | ----------- | ----- |
116
+ | **order_id** | **String** | The channel partner order id to delete. | |
117
+
118
+ ### Return type
119
+
120
+ [**ChannelPartnerCancelResponse**](ChannelPartnerCancelResponse.md)
121
+
122
+ ### Authorization
123
+
124
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
125
+
126
+ ### HTTP request headers
127
+
128
+ - **Content-Type**: Not defined
129
+ - **Accept**: application/json
130
+
131
+
132
+ ## cancel_order_by_ultra_cart_order_id
133
+
134
+ > <ChannelPartnerCancelResponse> cancel_order_by_ultra_cart_order_id(order_id)
135
+
136
+ Cancel channel partner order by UltraCart order id
137
+
138
+ Cancel channel partner order by UltraCart order id
139
+
140
+
141
+ ### Examples
142
+
143
+ ```ruby
144
+ require 'ultracart_api'
145
+ require_relative '../constants'
146
+
147
+ # cancelOrderByUltraCartOrderId takes an UltraCart order id and attempts to 'cancel' the order.
148
+ # UltraCart doesn't have a cancel order state, so this needs some explanation of what happens.
149
+ #
150
+ # Here is the logic of the cancel process:
151
+ # If the Order stage is [this] then do [that]:
152
+ # 'Completed Order' -> Error: "Order has already been completed."
153
+ # 'Rejected' -> Error: "Order has already been rejected."
154
+ # 'Accounts Receivable' -> Success: order is rejected.
155
+ # 'Preordered' -> Success: order is rejected.
156
+ # 'Quote Sent' -> Success: order is rejected.
157
+ # 'Quote Requested' -> Success: order is rejected.
158
+ #
159
+ # The remaining stages are Fraud Review and Shipping Department. Orders in these stages have already completed payment.
160
+ # From this point, complex logic determines if the order has already shipped, or is queued to ship in a way that cannot be canceled.
161
+ # Here is the logic for those stages, but the gist of it all is this: If you receive any of the errors below, the order has progressed past a point where it can be canceled.
162
+ # SHIPPING LOGIC:
163
+ # Iterate through each item and consider it's shipping status:
164
+ # Item has already been transmitted to fulfillment center (contains a transmitted dts) -> Error: "The order has already had an item that has been transmitted to the distribution center."
165
+ # Does item DC (distribution center) have a transmission mechanism configured?
166
+ # YES -> Does the transmission have schedules? If NO -> Error: "The distribution center does not have any schedules so it would be an immediate transmission."
167
+ # NO -> Error: "Cant tell if we can cancel because the DC doesnt have a transport configured."
168
+ #
169
+ # If the above logic completes without errors, the following conditions must be met:
170
+ # Order has DC activity records. If NO -> Error: "There is no activity in the DC queue when there should be."
171
+ # There must be at least 5 minutes before the next DC transmission. If NO -> Error: "Activity record is not at least 5 minutes away so we need to bail."
172
+ #
173
+ # At this point, the order will be canceled with the following activity:
174
+ # 1) Distribution Center activity is cleared
175
+ # 2) The order is refunded. If the order is less than 24 hours old, a void is attempted instead.
176
+ #
177
+ #
178
+ # Other Possible Errors:
179
+ # System errors -> "Internal error. Please contact UltraCart Support."
180
+ # Order does not exist -> "Invalid order ID specified."
181
+ # During refunding, original transaction could not be found -> "Unable to find original transaction on the order."
182
+ # During refunding, original transaction was found, but transaction id could not be found -> "Unable to locate original transaction reference number."
183
+ # During refunding, PayPal was used by no longer configured -> "PayPal is no longer configured on your account to refund against."
184
+ # Gateway does not support refunds -> [GatewayName] does not support refunds at this time.
185
+
186
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
187
+
188
+ ultracart_order_id = 'DEMO-12345678980'
189
+ begin
190
+ cancel_result = channel_partner_api.cancel_order_by_ultra_cart_order_id(ultracart_order_id)
191
+ unless cancel_result.success
192
+ cancel_result.cancel_errors.each do |error|
193
+ puts error
194
+ end
195
+ end
196
+ rescue UltracartClient::ApiError => e
197
+ puts e.inspect # Dumps all exception information
198
+ end
199
+ ```
200
+
201
+
202
+ #### Using the cancel_order_by_ultra_cart_order_id_with_http_info variant
203
+
204
+ This returns an Array which contains the response data, status code and headers.
205
+
206
+ > <Array(<ChannelPartnerCancelResponse>, Integer, Hash)> cancel_order_by_ultra_cart_order_id_with_http_info(order_id)
207
+
208
+ ```ruby
209
+ begin
210
+ # Cancel channel partner order by UltraCart order id
211
+ data, status_code, headers = api_instance.cancel_order_by_ultra_cart_order_id_with_http_info(order_id)
212
+ p status_code # => 2xx
213
+ p headers # => { ... }
214
+ p data # => <ChannelPartnerCancelResponse>
215
+ rescue UltracartClient::ApiError => e
216
+ puts "Error when calling ChannelPartnerApi->cancel_order_by_ultra_cart_order_id_with_http_info: #{e}"
217
+ end
218
+ ```
219
+
220
+ ### Parameters
221
+
222
+ | Name | Type | Description | Notes |
223
+ | ---- | ---- | ----------- | ----- |
224
+ | **order_id** | **String** | The UltraCart order id to delete. | |
225
+
226
+ ### Return type
227
+
228
+ [**ChannelPartnerCancelResponse**](ChannelPartnerCancelResponse.md)
229
+
230
+ ### Authorization
231
+
232
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
233
+
234
+ ### HTTP request headers
235
+
236
+ - **Content-Type**: Not defined
237
+ - **Accept**: application/json
238
+
239
+
240
+ ## delete_channel_partner_ship_to_preference
241
+
242
+ > delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
243
+
244
+ Delete a ship to preference record for the channel partner.
245
+
246
+ Delete a ship to preference record for the channel partner.
247
+
248
+
249
+ ### Examples
250
+
251
+ ```ruby
252
+ require 'ultracart_api'
253
+ require_relative '../constants'
254
+
255
+ # Deletes a ChannelPartnerShiptoPreference. These preferences are used by EDI channel partners to automatically
256
+ # apply return policies and add additional free items to EDI orders based on the EDI code that is present.
257
+ #
258
+ # Success will return a status code 204 (No content)
259
+ #
260
+ # Possible Errors:
261
+ # Attempting to interact with a channel partner other than the one tied to your API Key:
262
+ # "Invalid channel_partner_oid specified. Your REST API key may only interact with channel_partner_oid: 12345"
263
+ # Supply a bad preference oid: "Invalid channel_partner_ship_to_preference_oid specified."
264
+
265
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
266
+
267
+ # you will usually get this by calling get_channel_partner_ship_to_preferences()
268
+ channel_partner_shipto_preference_oid = 67890
269
+ channel_partner_oid = 12345
270
+
271
+ channel_partner_api.delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_shipto_preference_oid)
272
+ ```
273
+
274
+
275
+ #### Using the delete_channel_partner_ship_to_preference_with_http_info variant
276
+
277
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
278
+
279
+ > <Array(nil, Integer, Hash)> delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
280
+
281
+ ```ruby
282
+ begin
283
+ # Delete a ship to preference record for the channel partner.
284
+ data, status_code, headers = api_instance.delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
285
+ p status_code # => 2xx
286
+ p headers # => { ... }
287
+ p data # => nil
288
+ rescue UltracartClient::ApiError => e
289
+ puts "Error when calling ChannelPartnerApi->delete_channel_partner_ship_to_preference_with_http_info: #{e}"
290
+ end
291
+ ```
292
+
293
+ ### Parameters
294
+
295
+ | Name | Type | Description | Notes |
296
+ | ---- | ---- | ----------- | ----- |
297
+ | **channel_partner_oid** | **Integer** | | |
298
+ | **channel_partner_ship_to_preference_oid** | **Integer** | | |
299
+
300
+ ### Return type
301
+
302
+ nil (empty response body)
303
+
304
+ ### Authorization
305
+
306
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
307
+
308
+ ### HTTP request headers
309
+
310
+ - **Content-Type**: Not defined
311
+ - **Accept**: application/json
312
+
313
+
314
+ ## estimate_shipping_for_channel_partner_order
315
+
316
+ > <ChannelPartnerEstimateShippingResponse> estimate_shipping_for_channel_partner_order(channel_partner_order)
317
+
318
+ Estimate shipping for channel partner order
319
+
320
+ Estimate shipping for order from a channel partner.
321
+
322
+
323
+ ### Examples
324
+
325
+ ```ruby
326
+ require 'ultracart_api'
327
+ require_relative '../constants'
328
+
329
+ # This is a helper function for call centers to calculate the shipping cost on an order. In a typical flow, the call center
330
+ # will collect all the shipping information and items being purchased into a ChannelPartnerOrder object.
331
+ # They will then call this method, passing in the order object. The response will contain the shipping estimates
332
+ # that the call center can present to the customer. Once the customer selects a particulate estimate,
333
+ # they can then plug that cost into their call center application and complete the order.
334
+ #
335
+ # Possible Errors:
336
+ # Using an API key that is not tied to a channel partner: "This API Key does not have permission to interact with channel partner orders. Please review your Channel Partner configuration."
337
+ # Order has invalid channel partner code: "Invalid channel partner code"
338
+ # Order has no items: "null order.items passed." or "order.items array contains a null entry."
339
+ # Order has no channel partner order id: "order.channelPartnerOrderId must be specified."
340
+ # Order channel partner order id is a duplicate: "order.channelPartnerOrderId [XYZ] already used."
341
+ # Channel Partner is inactive: "partner is inactive."
342
+
343
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
344
+
345
+ order = UltracartClient::ChannelPartnerOrder.new
346
+ order.channel_partner_order_id = "widget-1245-abc-1"
347
+ order.coupons = ["10OFF"]
348
+ # DeliveryDate will impact shipping estimates if there is a delivery deadline.
349
+ # order.delivery_date = (Time.now + (14 * 24 * 60 * 60)).iso8601
350
+
351
+ item = UltracartClient::ChannelPartnerOrderItem.new
352
+ # item.arbitrary_unit_cost = 9.99
353
+ # item.auto_order_last_rebill_dts = (Time.now - (30 * 24 * 60 * 60)).iso8601
354
+ # item.auto_order_schedule = "Weekly"
355
+ item.merchant_item_id = "shirt"
356
+
357
+ size_option = UltracartClient::ChannelPartnerOrderItemOption.new
358
+ size_option.name = "Size"
359
+ size_option.value = "Small"
360
+
361
+ color_option = UltracartClient::ChannelPartnerOrderItemOption.new
362
+ color_option.name = "Color"
363
+ color_option.value = "Orange"
364
+
365
+ item.options = [size_option, color_option]
366
+ item.quantity = 1
367
+ item.upsell = false
368
+
369
+ order.items = [item]
370
+
371
+ # order.ship_on_date = (Time.now + (7 * 24 * 60 * 60)).iso8601
372
+ order.ship_to_residential = true
373
+ order.ship_to_address1 = "55 Main Street"
374
+ order.ship_to_address2 = "Suite 202"
375
+ order.ship_to_city = "Duluth"
376
+ order.ship_to_company = "Widgets Inc"
377
+ order.ship_to_country_code = "US"
378
+ order.ship_to_day_phone = "6785552323"
379
+ order.ship_to_evening_phone = "7703334444"
380
+ order.ship_to_first_name = "Sally"
381
+ order.ship_to_last_name = "McGonkyDee"
382
+ order.ship_to_postal_code = "30097"
383
+ order.ship_to_state_region = "GA"
384
+ order.ship_to_title = "Director"
385
+
386
+ api_response = channel_partner_api.estimate_shipping_for_channel_partner_order(order)
387
+ estimates = api_response.estimates
388
+
389
+ # TODO: Apply one estimate shipping method (name) and cost to your channel partner order.
390
+
391
+ estimates.each do |estimate|
392
+ p estimate
393
+ end
394
+ ```
395
+
396
+
397
+ #### Using the estimate_shipping_for_channel_partner_order_with_http_info variant
398
+
399
+ This returns an Array which contains the response data, status code and headers.
400
+
401
+ > <Array(<ChannelPartnerEstimateShippingResponse>, Integer, Hash)> estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order)
402
+
403
+ ```ruby
404
+ begin
405
+ # Estimate shipping for channel partner order
406
+ data, status_code, headers = api_instance.estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order)
407
+ p status_code # => 2xx
408
+ p headers # => { ... }
409
+ p data # => <ChannelPartnerEstimateShippingResponse>
410
+ rescue UltracartClient::ApiError => e
411
+ puts "Error when calling ChannelPartnerApi->estimate_shipping_for_channel_partner_order_with_http_info: #{e}"
412
+ end
413
+ ```
414
+
415
+ ### Parameters
416
+
417
+ | Name | Type | Description | Notes |
418
+ | ---- | ---- | ----------- | ----- |
419
+ | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order needing shipping estimate | |
420
+
421
+ ### Return type
422
+
423
+ [**ChannelPartnerEstimateShippingResponse**](ChannelPartnerEstimateShippingResponse.md)
424
+
425
+ ### Authorization
426
+
427
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
428
+
429
+ ### HTTP request headers
430
+
431
+ - **Content-Type**: application/json; charset=UTF-8
432
+ - **Accept**: application/json
433
+
434
+
435
+ ## estimate_tax_for_channel_partner_order
436
+
437
+ > <ChannelPartnerEstimateTaxResponse> estimate_tax_for_channel_partner_order(channel_partner_order)
438
+
439
+ Estimate tax for channel partner order
440
+
441
+ Estimate tax for order from a channel partner.
442
+
443
+
444
+ ### Examples
445
+
446
+ ```ruby
447
+ require 'ultracart_api'
448
+ require_relative '../constants'
449
+
450
+ # This is a helper function for call centers to calculate the tax on an order. In a typical flow, the call center
451
+ # will collect all the shipping information and items being purchased into a ChannelPartnerOrder object.
452
+ # They will then call this method, passing in the order object. The response will contain the tax that should be
453
+ # collected. They can then plug that tax into their call center application and complete the order.
454
+ #
455
+ # Possible Errors:
456
+ # Using an API key that is not tied to a channel partner: "This API Key does not have permission to interact with channel partner orders. Please review your Channel Partner configuration."
457
+ # Order has invalid channel partner code: "Invalid channel partner code"
458
+ # Order has no items: "null order.items passed." or "order.items array contains a null entry."
459
+ # Order has no channel partner order id: "order.channelPartnerOrderId must be specified."
460
+ # Order channel partner order id is a duplicate: "order.channelPartnerOrderId [XYZ] already used."
461
+ # Channel Partner is inactive: "partner is inactive."
462
+
463
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
464
+
465
+ order = UltracartClient::ChannelPartnerOrder.new
466
+ order.channel_partner_order_id = "widget-1245-abc-1"
467
+ order.coupons = ["10OFF"]
468
+ # DeliveryDate will impact shipping estimates if there is a delivery deadline.
469
+ # order.delivery_date = (Time.now + (14 * 24 * 60 * 60)).iso8601
470
+
471
+ item = UltracartClient::ChannelPartnerOrderItem.new
472
+ # item.arbitrary_unit_cost = 9.99
473
+ # item.auto_order_last_rebill_dts = (Time.now - (30 * 24 * 60 * 60)).iso8601
474
+ # item.auto_order_schedule = "Weekly"
475
+ item.merchant_item_id = "shirt"
476
+
477
+ size_option = UltracartClient::ChannelPartnerOrderItemOption.new
478
+ size_option.name = "Size"
479
+ size_option.value = "Small"
480
+
481
+ color_option = UltracartClient::ChannelPartnerOrderItemOption.new
482
+ color_option.name = "Color"
483
+ color_option.value = "Orange"
484
+
485
+ item.options = [size_option, color_option]
486
+ item.quantity = 1
487
+ item.upsell = false
488
+
489
+ order.items = [item]
490
+
491
+ # order.ship_on_date = (Time.now + (7 * 24 * 60 * 60)).iso8601
492
+ order.ship_to_residential = true
493
+ order.ship_to_address1 = "55 Main Street"
494
+ order.ship_to_address2 = "Suite 202"
495
+ order.ship_to_city = "Duluth"
496
+ order.ship_to_company = "Widgets Inc"
497
+ order.ship_to_country_code = "US"
498
+ order.ship_to_day_phone = "6785552323"
499
+ order.ship_to_evening_phone = "7703334444"
500
+ order.ship_to_first_name = "Sally"
501
+ order.ship_to_last_name = "McGonkyDee"
502
+ order.ship_to_postal_code = "30097"
503
+ order.ship_to_state_region = "GA"
504
+ order.ship_to_title = "Director"
505
+
506
+ api_response = channel_partner_api.estimate_tax_for_channel_partner_order(order)
507
+ arbitrary_tax = api_response.arbitrary_tax
508
+ # TODO: Apply this tax to your channel partner order.
509
+
510
+ p arbitrary_tax
511
+ ```
512
+
513
+
514
+ #### Using the estimate_tax_for_channel_partner_order_with_http_info variant
515
+
516
+ This returns an Array which contains the response data, status code and headers.
517
+
518
+ > <Array(<ChannelPartnerEstimateTaxResponse>, Integer, Hash)> estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order)
519
+
520
+ ```ruby
521
+ begin
522
+ # Estimate tax for channel partner order
523
+ data, status_code, headers = api_instance.estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order)
524
+ p status_code # => 2xx
525
+ p headers # => { ... }
526
+ p data # => <ChannelPartnerEstimateTaxResponse>
527
+ rescue UltracartClient::ApiError => e
528
+ puts "Error when calling ChannelPartnerApi->estimate_tax_for_channel_partner_order_with_http_info: #{e}"
529
+ end
530
+ ```
531
+
532
+ ### Parameters
533
+
534
+ | Name | Type | Description | Notes |
535
+ | ---- | ---- | ----------- | ----- |
536
+ | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order needing tax estimate | |
537
+
538
+ ### Return type
539
+
540
+ [**ChannelPartnerEstimateTaxResponse**](ChannelPartnerEstimateTaxResponse.md)
541
+
542
+ ### Authorization
543
+
544
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
545
+
546
+ ### HTTP request headers
547
+
548
+ - **Content-Type**: application/json; charset=UTF-8
549
+ - **Accept**: application/json
550
+
551
+
552
+ ## get_channel_partner_order
553
+
554
+ > <OrderResponse> get_channel_partner_order(order_id, opts)
555
+
556
+ Retrieve a channel partner order
557
+
558
+ Retrieves a single order using the specified order id. Only orders belonging to this channel partner may be retrieved.
559
+
560
+
561
+ ### Examples
562
+
563
+ ```ruby
564
+ require 'ultracart_api'
565
+ require_relative '../constants'
566
+
567
+ # ChannelPartnerApi.get_channel_partner_order() retrieves a single order for a given order_id. It is identical to the
568
+ # OrderApi.get_order() call, but allows for a restricted permission set. The channel partner api assumes
569
+ # a tie to a Channel Partner and only allows retrieval of orders created by that Channel Partner.
570
+
571
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
572
+
573
+ # The expansion variable instructs UltraCart how much information to return. The order object is large and
574
+ # while it's easily manageable for a single order, when querying thousands of orders, is useful to reduce
575
+ # payload size.
576
+ # see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
577
+ #
578
+ # Possible Order Expansions:
579
+ # affiliate affiliate.ledger auto_order
580
+ # billing channel_partner checkout
581
+ # coupon customer_profile digital_order
582
+ # edi fraud_score gift
583
+ # gift_certificate internal item
584
+ # linked_shipment marketing payment
585
+ # payment.transaction quote salesforce
586
+ # shipping shipping.tracking_number_details summary
587
+ # taxes
588
+
589
+ # A channel partner will almost always query an order for the purpose of turning around and submitting it to a refund call.
590
+ # As such, the expansion most likely needed is listed below.
591
+ _expand = "item,summary,shipping"
592
+
593
+ # This order MUST be an order associated with this channel partner or you will receive a 400 Bad Request.
594
+ order_id = 'DEMO-0009110366'
595
+ api_response = channel_partner_api.get_channel_partner_order(order_id, { '_expand' => _expand })
596
+
597
+ if api_response.error
598
+ STDERR.puts api_response.error.developer_message
599
+ STDERR.puts api_response.error.user_message
600
+ exit
601
+ end
602
+
603
+ order = api_response.order
604
+
605
+ p order
606
+ ```
607
+
608
+
609
+ #### Using the get_channel_partner_order_with_http_info variant
610
+
611
+ This returns an Array which contains the response data, status code and headers.
612
+
613
+ > <Array(<OrderResponse>, Integer, Hash)> get_channel_partner_order_with_http_info(order_id, opts)
614
+
615
+ ```ruby
616
+ begin
617
+ # Retrieve a channel partner order
618
+ data, status_code, headers = api_instance.get_channel_partner_order_with_http_info(order_id, opts)
619
+ p status_code # => 2xx
620
+ p headers # => { ... }
621
+ p data # => <OrderResponse>
622
+ rescue UltracartClient::ApiError => e
623
+ puts "Error when calling ChannelPartnerApi->get_channel_partner_order_with_http_info: #{e}"
624
+ end
625
+ ```
626
+
627
+ ### Parameters
628
+
629
+ | Name | Type | Description | Notes |
630
+ | ---- | ---- | ----------- | ----- |
631
+ | **order_id** | **String** | The order id to retrieve. | |
632
+ | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples | [optional] |
633
+
634
+ ### Return type
635
+
636
+ [**OrderResponse**](OrderResponse.md)
637
+
638
+ ### Authorization
639
+
640
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
641
+
642
+ ### HTTP request headers
643
+
644
+ - **Content-Type**: Not defined
645
+ - **Accept**: application/json
646
+
647
+
648
+ ## get_channel_partner_order_by_channel_partner_order_id
649
+
650
+ > <OrderResponse> get_channel_partner_order_by_channel_partner_order_id(order_id, opts)
651
+
652
+ Retrieve a channel partner order by the channel partner order id
653
+
654
+ 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.
655
+
656
+
657
+ ### Examples
658
+
659
+ ```ruby
660
+ require 'ultracart_api'
661
+ require_relative '../constants'
662
+
663
+ # ChannelPartnerApi.get_channel_partner_order_by_channel_partner_order_id() retrieves a single order for a given
664
+ # channel partner order_id. This might be useful for call centers which only have their order ids and not UltraCart's.
665
+ # It is identical to the OrderApi.get_order() call in functionality and result,
666
+ # but allows for a restricted permission set. The channel partner api assumes a tie to a Channel Partner and
667
+ # only allows retrieval of orders created by that Channel Partner.
668
+
669
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
670
+
671
+ # The expansion variable instructs UltraCart how much information to return. The order object is large and
672
+ # while it's easily manageable for a single order, when querying thousands of orders, is useful to reduce
673
+ # payload size.
674
+ # see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
675
+ #
676
+ # Possible Order Expansions:
677
+ # affiliate affiliate.ledger auto_order
678
+ # billing channel_partner checkout
679
+ # coupon customer_profile digital_order
680
+ # edi fraud_score gift
681
+ # gift_certificate internal item
682
+ # linked_shipment marketing payment
683
+ # payment.transaction quote salesforce
684
+ # shipping shipping.tracking_number_details summary
685
+ # taxes
686
+
687
+ # A channel partner will almost always query an order for the purpose of turning around and submitting it to a refund call.
688
+ # As such, the expansion most likely needed is listed below.
689
+ _expand = "item,summary,shipping"
690
+
691
+ # This order MUST be an order associated with this channel partner or you will receive a 400 Bad Request.
692
+ channel_partner_order_id = 'MY-CALL-CENTER-BLAH-BLAH'
693
+ api_response = channel_partner_api.get_channel_partner_order_by_channel_partner_order_id(channel_partner_order_id, { '_expand' => _expand })
694
+
695
+ if api_response.error
696
+ STDERR.puts api_response.error.developer_message
697
+ STDERR.puts api_response.error.user_message
698
+ exit
699
+ end
700
+
701
+ order = api_response.order
702
+
703
+ p order
704
+ ```
705
+
706
+
707
+ #### Using the get_channel_partner_order_by_channel_partner_order_id_with_http_info variant
708
+
709
+ This returns an Array which contains the response data, status code and headers.
710
+
711
+ > <Array(<OrderResponse>, Integer, Hash)> get_channel_partner_order_by_channel_partner_order_id_with_http_info(order_id, opts)
712
+
713
+ ```ruby
714
+ begin
715
+ # Retrieve a channel partner order by the channel partner order id
716
+ data, status_code, headers = api_instance.get_channel_partner_order_by_channel_partner_order_id_with_http_info(order_id, opts)
717
+ p status_code # => 2xx
718
+ p headers # => { ... }
719
+ p data # => <OrderResponse>
720
+ rescue UltracartClient::ApiError => e
721
+ puts "Error when calling ChannelPartnerApi->get_channel_partner_order_by_channel_partner_order_id_with_http_info: #{e}"
722
+ end
723
+ ```
724
+
725
+ ### Parameters
726
+
727
+ | Name | Type | Description | Notes |
728
+ | ---- | ---- | ----------- | ----- |
729
+ | **order_id** | **String** | The channel partner order id to retrieve. | |
730
+ | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.getOrder documentation for examples | [optional] |
731
+
732
+ ### Return type
733
+
734
+ [**OrderResponse**](OrderResponse.md)
735
+
736
+ ### Authorization
737
+
738
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
739
+
740
+ ### HTTP request headers
741
+
742
+ - **Content-Type**: Not defined
743
+ - **Accept**: application/json
744
+
745
+
746
+ ## get_channel_partner_reason_codes
747
+
748
+ > <ChanelPartnerReasonCodesResponse> get_channel_partner_reason_codes(channel_partner_oid)
749
+
750
+ Retrieve reject and refund reason codes.
751
+
752
+ Retrieve reject and refund reason codes.
753
+
754
+
755
+ ### Examples
756
+
757
+ ```ruby
758
+ # Retrieves a list of all channel partners reject and refund reason codes needed (maybe) when doing a refund order
759
+
760
+ require 'ultracart_api'
761
+ require_relative '../constants'
762
+
763
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
764
+ api_response = channel_partner_api.get_channel_partner_reason_codes(18_413)
765
+
766
+ if api_response.error
767
+ STDERR.puts api_response.error.developer_message
768
+ STDERR.puts api_response.error.user_message
769
+ exit
770
+ end
771
+
772
+ p api_response
773
+ ```
774
+
775
+
776
+ #### Using the get_channel_partner_reason_codes_with_http_info variant
777
+
778
+ This returns an Array which contains the response data, status code and headers.
779
+
780
+ > <Array(<ChanelPartnerReasonCodesResponse>, Integer, Hash)> get_channel_partner_reason_codes_with_http_info(channel_partner_oid)
781
+
782
+ ```ruby
783
+ begin
784
+ # Retrieve reject and refund reason codes.
785
+ data, status_code, headers = api_instance.get_channel_partner_reason_codes_with_http_info(channel_partner_oid)
786
+ p status_code # => 2xx
787
+ p headers # => { ... }
788
+ p data # => <ChanelPartnerReasonCodesResponse>
789
+ rescue UltracartClient::ApiError => e
790
+ puts "Error when calling ChannelPartnerApi->get_channel_partner_reason_codes_with_http_info: #{e}"
791
+ end
792
+ ```
793
+
794
+ ### Parameters
795
+
796
+ | Name | Type | Description | Notes |
797
+ | ---- | ---- | ----------- | ----- |
798
+ | **channel_partner_oid** | **Integer** | | |
799
+
800
+ ### Return type
801
+
802
+ [**ChanelPartnerReasonCodesResponse**](ChanelPartnerReasonCodesResponse.md)
803
+
804
+ ### Authorization
805
+
806
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
807
+
808
+ ### HTTP request headers
809
+
810
+ - **Content-Type**: Not defined
811
+ - **Accept**: application/json
812
+
813
+
814
+ ## get_channel_partner_ship_to_preference
815
+
816
+ > <ChannelPartnerShipToPreferenceResponse> get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
817
+
818
+ Retrieve the ship to preference associated with the channel partner and the specific id.
819
+
820
+ Retrieve the ship to preference associated with the channel partner and the specific id.
821
+
822
+
823
+ ### Examples
824
+
825
+ ```ruby
826
+ require 'ultracart_api'
827
+ require_relative '../constants'
828
+
829
+ # Retrieves a shipto preference for a channel partner.
830
+ # These preferences are used by EDI channel partners to automatically
831
+ # apply return policies and add additional free items to EDI orders based on the EDI code that is present.
832
+ #
833
+ # Possible Errors:
834
+ # Attempting to interact with a channel partner other than the one tied to your API Key:
835
+ # "Invalid channel_partner_oid specified. Your REST API key may only interact with channel_partner_oid: 12345"
836
+ # Supplying a bad channel partner oid: "Invalid channel_partner_oid specified."
837
+ # Supplying a bad channel partner shipto preference oid: "Invalid channel_partner_ship_to_preference_oid specified."
838
+
839
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
840
+ channel_partner_oid = 12345
841
+ channel_partner_shipto_preference_oid = 67890
842
+ api_response = channel_partner_api.get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_shipto_preference_oid)
843
+
844
+ if api_response.error
845
+ STDERR.puts api_response.error.developer_message
846
+ STDERR.puts api_response.error.user_message
847
+ exit
848
+ end
849
+
850
+ preference = api_response.ship_to_preference
851
+
852
+ p preference
853
+ ```
854
+
855
+
856
+ #### Using the get_channel_partner_ship_to_preference_with_http_info variant
857
+
858
+ This returns an Array which contains the response data, status code and headers.
859
+
860
+ > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
861
+
862
+ ```ruby
863
+ begin
864
+ # Retrieve the ship to preference associated with the channel partner and the specific id.
865
+ data, status_code, headers = api_instance.get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid)
866
+ p status_code # => 2xx
867
+ p headers # => { ... }
868
+ p data # => <ChannelPartnerShipToPreferenceResponse>
869
+ rescue UltracartClient::ApiError => e
870
+ puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preference_with_http_info: #{e}"
871
+ end
872
+ ```
873
+
874
+ ### Parameters
875
+
876
+ | Name | Type | Description | Notes |
877
+ | ---- | ---- | ----------- | ----- |
878
+ | **channel_partner_oid** | **Integer** | | |
879
+ | **channel_partner_ship_to_preference_oid** | **Integer** | | |
880
+
881
+ ### Return type
882
+
883
+ [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
884
+
885
+ ### Authorization
886
+
887
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
888
+
889
+ ### HTTP request headers
890
+
891
+ - **Content-Type**: Not defined
892
+ - **Accept**: application/json
893
+
894
+
895
+ ## get_channel_partner_ship_to_preferences
896
+
897
+ > <ChannelPartnerShipToPreferencesResponse> get_channel_partner_ship_to_preferences(channel_partner_oid)
898
+
899
+ Retrieve the ship to preferences associated with the channel partner.
900
+
901
+ Retrieve the ship to preferences associated with the channel partner.
902
+
903
+
904
+ ### Examples
905
+
906
+ ```ruby
907
+ require 'ultracart_api'
908
+ require_relative '../constants'
909
+
910
+ # Retrieves all shipto preferences for a channel partner.
911
+ # These preferences are used by EDI channel partners to automatically
912
+ # apply return policies and add additional free items to EDI orders based on the EDI code that is present.
913
+ #
914
+ # Possible Errors:
915
+ # Attempting to interact with a channel partner other than the one tied to your API Key:
916
+ # "Invalid channel_partner_oid specified. Your REST API key may only interact with channel_partner_oid: 12345"
917
+ # Supplying a bad channel partner oid: "Invalid channel_partner_oid specified."
918
+
919
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
920
+ channel_partner_oid = 12345
921
+ api_response = channel_partner_api.get_channel_partner_ship_to_preferences(channel_partner_oid)
922
+
923
+ if api_response.error
924
+ STDERR.puts api_response.error.developer_message
925
+ STDERR.puts api_response.error.user_message
926
+ exit
927
+ end
928
+
929
+ preferences = api_response.ship_to_preferences
930
+
931
+ preferences.each do |preference|
932
+ p preference
933
+ end
934
+ ```
935
+
936
+
937
+ #### Using the get_channel_partner_ship_to_preferences_with_http_info variant
938
+
939
+ This returns an Array which contains the response data, status code and headers.
940
+
941
+ > <Array(<ChannelPartnerShipToPreferencesResponse>, Integer, Hash)> get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid)
942
+
943
+ ```ruby
944
+ begin
945
+ # Retrieve the ship to preferences associated with the channel partner.
946
+ data, status_code, headers = api_instance.get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid)
947
+ p status_code # => 2xx
948
+ p headers # => { ... }
949
+ p data # => <ChannelPartnerShipToPreferencesResponse>
950
+ rescue UltracartClient::ApiError => e
951
+ puts "Error when calling ChannelPartnerApi->get_channel_partner_ship_to_preferences_with_http_info: #{e}"
952
+ end
953
+ ```
954
+
955
+ ### Parameters
956
+
957
+ | Name | Type | Description | Notes |
958
+ | ---- | ---- | ----------- | ----- |
959
+ | **channel_partner_oid** | **Integer** | | |
960
+
961
+ ### Return type
962
+
963
+ [**ChannelPartnerShipToPreferencesResponse**](ChannelPartnerShipToPreferencesResponse.md)
964
+
965
+ ### Authorization
966
+
967
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
968
+
969
+ ### HTTP request headers
970
+
971
+ - **Content-Type**: Not defined
972
+ - **Accept**: application/json
973
+
974
+
975
+ ## get_channel_partners
976
+
977
+ > <ChannelPartnersResponse> get_channel_partners
978
+
979
+ Retrieve the channel partners configured on the account.
980
+
981
+ Retrieve the channel partners configured on the account.
982
+
983
+
984
+ ### Examples
985
+
986
+ ```ruby
987
+ # Retrieves a list of all channel partners configured for this merchant. If the API KEY used is tied to a specific
988
+ # Channel Partner, then the results will contain only that Channel Partner.
989
+
990
+ require 'ultracart_api'
991
+ require_relative '../constants'
992
+
993
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
994
+ api_response = channel_partner_api.get_channel_partners
995
+
996
+ if api_response.error
997
+ STDERR.puts api_response.error.developer_message
998
+ STDERR.puts api_response.error.user_message
999
+ exit
1000
+ end
1001
+
1002
+ channel_partners = api_response.channel_partners
1003
+
1004
+ channel_partners.each do |channel_partner|
1005
+ p channel_partner
1006
+ end
1007
+ ```
1008
+
1009
+
1010
+ #### Using the get_channel_partners_with_http_info variant
1011
+
1012
+ This returns an Array which contains the response data, status code and headers.
1013
+
1014
+ > <Array(<ChannelPartnersResponse>, Integer, Hash)> get_channel_partners_with_http_info
1015
+
1016
+ ```ruby
1017
+ begin
1018
+ # Retrieve the channel partners configured on the account.
1019
+ data, status_code, headers = api_instance.get_channel_partners_with_http_info
1020
+ p status_code # => 2xx
1021
+ p headers # => { ... }
1022
+ p data # => <ChannelPartnersResponse>
1023
+ rescue UltracartClient::ApiError => e
1024
+ puts "Error when calling ChannelPartnerApi->get_channel_partners_with_http_info: #{e}"
1025
+ end
1026
+ ```
1027
+
1028
+ ### Parameters
1029
+
1030
+ This endpoint does not need any parameter.
1031
+
1032
+ ### Return type
1033
+
1034
+ [**ChannelPartnersResponse**](ChannelPartnersResponse.md)
1035
+
1036
+ ### Authorization
1037
+
1038
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1039
+
1040
+ ### HTTP request headers
1041
+
1042
+ - **Content-Type**: Not defined
1043
+ - **Accept**: application/json
1044
+
1045
+
1046
+ ## import_channel_partner_order
1047
+
1048
+ > <ChannelPartnerImportResponse> import_channel_partner_order(channel_partner_order)
1049
+
1050
+ Insert channel partner order
1051
+
1052
+ Insert order from a channel partner.
1053
+
1054
+
1055
+ ### Examples
1056
+
1057
+ ```ruby
1058
+ # To run channel partner examples, you will need:
1059
+ # 1) An API Key: https://secure.ultracart.com/merchant/configuration/apiManagementApp.do
1060
+ # 2) That API Key must be assigned to a channel partner: https://secure.ultracart.com/merchant/configuration/customChannelPartnerListLoad.do
1061
+ #
1062
+ # The spreadsheet import docs will serve you well here. They describe many fields
1063
+ # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377246/Channel+Partner+API+-+Spreadsheet+Import
1064
+
1065
+ require 'ultracart_api'
1066
+ require_relative '../constants'
1067
+
1068
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
1069
+
1070
+ # NOTICE:
1071
+ # The real difficulty with using this API is the hosted fields requirement for credit card information.
1072
+ # You will need to incorporate UltraCart hosted fields in your Customer Service UI and capture credit card
1073
+ # information through the hosted fields and then provide the tokens here. You CANNOT provide raw credit
1074
+ # card information via this interface.
1075
+ # The two fields in this API are hostedFieldsCardToken and hostedFieldsCvvToken
1076
+ # Within this sdk_samples github project, review the /hosted_fields/hosted_fields.html file for an example
1077
+
1078
+ # ---------------------------------------------
1079
+ # ---------------------------------------------
1080
+ # Example 1 - Order needs payment processing
1081
+ # ---------------------------------------------
1082
+ # ---------------------------------------------
1083
+
1084
+ order = UltracartClient::ChannelPartnerOrder.new
1085
+
1086
+ # order.advertising_source = "Friend" # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377001/Advertising+Sources
1087
+ # order.affiliate_id = 856234 # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377727/Affiliates
1088
+ # order.affiliate_sub_id = 1234 # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1376754/Allowing+Affiliates+to+use+Sub-IDs
1089
+ # order.arbitrary_shipping_handling_total = 9.99
1090
+ # order.arbitrary_tax = 2.50
1091
+ # order.arbitrary_tax_rate = 7.0
1092
+ # order.arbitrary_taxable_subtotal = 69.99
1093
+
1094
+ order.associate_with_customer_profile_if_present = true
1095
+ order.auto_approve_purchase_order = true
1096
+ order.billto_address1 = "11460 Johns Creek Parkway"
1097
+ order.billto_address2 = "Suite 101"
1098
+ order.billto_city = "Duluth"
1099
+ order.billto_company = "Widgets Inc"
1100
+ order.billto_country_code = "US"
1101
+ order.billto_day_phone = "6784153823"
1102
+ order.billto_evening_phone = "6784154019"
1103
+ order.billto_first_name = "John"
1104
+ order.billto_last_name = "Smith"
1105
+ order.billto_postal_code = "30097"
1106
+ order.billto_state_region = "GA"
1107
+ order.billto_title = "Sir"
1108
+ order.cc_email = "orders@widgets.com"
1109
+ order.channel_partner_order_id = "widget-1245-abc"
1110
+ order.consider_recurring = false
1111
+ order.coupons = ["10OFF", "BUY1GET1"]
1112
+
1113
+ order.credit_card_expiration_month = 5
1114
+ order.credit_card_expiration_year = 2032
1115
+ order.credit_card_type = "VISA" # see the hosted fields below for the card number and cvv tokens
1116
+ order.custom_field1 = "Whatever"
1117
+ order.custom_field2 = "You"
1118
+ order.custom_field3 = "Want"
1119
+ order.custom_field4 = "Can"
1120
+ order.custom_field5 = "Go"
1121
+ order.custom_field6 = "In"
1122
+ order.custom_field7 = "CustomFields"
1123
+ order.delivery_date = Time.now.strftime('%Y-%m-%dT00:00:00+00:00')
1124
+ order.email = "ceo@widgets.com"
1125
+ order.gift = false
1126
+
1127
+ order.gift_email = "sally@aol.com"
1128
+ order.gift_message = "Congratulations on your promotion!"
1129
+
1130
+ order.hosted_fields_card_token = "7C97B0AAA26AB10180B4B29F00380101"
1131
+ order.hosted_fields_cvv_token = "C684AB4336787F0180B4B51971380101"
1132
+
1133
+ order.ip_address = "34.125.95.217"
1134
+
1135
+ # -- Items start ---
1136
+ item = UltracartClient::ChannelPartnerOrderItem.new
1137
+ # item.arbitrary_unit_cost = 9.99
1138
+ # item.auto_order_last_rebill_dts = Time.now.strftime('%Y-%m-%dT00:00:00+00:00')
1139
+ # item.auto_order_schedule = "Weekly"
1140
+
1141
+ item.merchant_item_id = "shirt"
1142
+ item.quantity = 1
1143
+ item.upsell = false
1144
+
1145
+ item_option1 = UltracartClient::ChannelPartnerOrderItemOption.new
1146
+ item_option1.name = "Size"
1147
+ item_option1.value = "Small"
1148
+
1149
+ item_option2 = UltracartClient::ChannelPartnerOrderItemOption.new
1150
+ item_option2.name = "Color"
1151
+ item_option2.value = "Orange"
1152
+
1153
+ item.options = [item_option1, item_option2]
1154
+
1155
+ order.items = [item]
1156
+ # -- Items End ---
1157
+
1158
+ order.least_cost_route = true # Give me the lowest cost shipping
1159
+ order.least_cost_route_shipping_methods = ["FedEx: Ground", "UPS: Ground", "USPS: Priority"]
1160
+ order.mailing_list_opt_in = true # Yes, I confirmed with the customer personally they wish to be on my mailing lists.
1161
+ order.no_realtime_payment_processing = false
1162
+ order.payment_method = "Credit Card"
1163
+ order.rotating_transaction_gateway_code = "MyStripe" # We wish this to be charged against our Stripe gateway
1164
+ order.screen_branding_theme_code = "SF1986" # Theme codes predated StoreFronts. Each StoreFront still has a theme code under the hood
1165
+ order.ship_on_date = Time.now.strftime('%Y-%m-%dT00:00:00+00:00')
1166
+ order.ship_to_residential = true
1167
+ order.shipto_address1 = "55 Main Street"
1168
+ order.shipto_address2 = "Suite 202"
1169
+ order.shipto_city = "Duluth"
1170
+ order.shipto_company = "Widgets Inc"
1171
+ order.shipto_country_code = "US"
1172
+ order.shipto_day_phone = "6785552323"
1173
+ order.shipto_evening_phone = "7703334444"
1174
+ order.shipto_first_name = "Sally"
1175
+ order.shipto_last_name = "McGonkyDee"
1176
+ order.shipto_postal_code = "30097"
1177
+ order.shipto_state_region = "GA"
1178
+ order.shipto_title = "Director"
1179
+ order.skip_payment_processing = false
1180
+ order.special_instructions = "Please wrap this in bubble wrap because my FedEx delivery guy is abusive to packages"
1181
+ order.store_completed = false # this will bypass everything, including shipping. useful only for importing old orders long completed
1182
+ order.storefront_host_name = 'store.mysite.com'
1183
+ order.store_if_payment_declines = false # if payment fails, this can send it to Accounts Receivable. Do not want that. Fail if payment fails.
1184
+ order.tax_county = "Gwinnett"
1185
+ order.tax_exempt = false
1186
+
1187
+ order_transaction = UltracartClient::ChannelPartnerOrderTransaction.new
1188
+ order_transaction.successful = false # we haven't charged the card yet, so this is false
1189
+ order_transaction.details = [] # we haven't charged the card yet, so this is empty
1190
+ order.transaction = order_transaction
1191
+ order.treat_warnings_as_errors = true
1192
+
1193
+ api_response = channel_partner_api.import_channel_partner_order(order)
1194
+
1195
+ # ---------------------------------------------
1196
+ # ---------------------------------------------
1197
+ # Example 2 - Order already processed
1198
+ # ---------------------------------------------
1199
+ # ---------------------------------------------
1200
+
1201
+ order = UltracartClient::ChannelPartnerOrder.new
1202
+
1203
+ order.associate_with_customer_profile_if_present = true
1204
+ order.auto_approve_purchase_order = true
1205
+ order.billto_address1 = "11460 Johns Creek Parkway"
1206
+ order.billto_address2 = "Suite 101"
1207
+ order.billto_city = "Duluth"
1208
+ order.billto_company = "Widgets Inc"
1209
+ order.billto_country_code = "US"
1210
+ order.billto_day_phone = "6784153823"
1211
+ order.billto_evening_phone = "6784154019"
1212
+ order.billto_first_name = "John"
1213
+ order.billto_last_name = "Smith"
1214
+ order.billto_postal_code = "30097"
1215
+ order.billto_state_region = "GA"
1216
+ order.billto_title = "Sir"
1217
+ order.cc_email = "orders@widgets.com"
1218
+ order.channel_partner_order_id = "widget-1245-abc"
1219
+ order.consider_recurring = false
1220
+ order.coupons = ["10OFF", "BUY1GET1"]
1221
+
1222
+ order.credit_card_expiration_month = 5
1223
+ order.credit_card_expiration_year = 2032
1224
+ order.credit_card_type = "VISA"
1225
+ order.custom_field1 = "Whatever"
1226
+ order.custom_field2 = "You"
1227
+ order.custom_field3 = "Want"
1228
+ order.custom_field4 = "Can"
1229
+ order.custom_field5 = "Go"
1230
+ order.custom_field6 = "In"
1231
+ order.custom_field7 = "CustomFields"
1232
+ order.delivery_date = Time.now.strftime('%Y-%m-%dT00:00:00+00:00')
1233
+ order.email = "ceo@widgets.com"
1234
+ order.gift = false
1235
+
1236
+ order.gift_email = "sally@aol.com"
1237
+ order.gift_message = "Congratulations on your promotion!"
1238
+
1239
+ order.ip_address = "34.125.95.217"
1240
+
1241
+ # -- Items start ---
1242
+ item = UltracartClient::ChannelPartnerOrderItem.new
1243
+
1244
+ item.merchant_item_id = "shirt"
1245
+ item.quantity = 1
1246
+ item.upsell = false
1247
+
1248
+ item_option1 = UltracartClient::ChannelPartnerOrderItemOption.new
1249
+ item_option1.name = "Size"
1250
+ item_option1.value = "Small"
1251
+
1252
+ item_option2 = UltracartClient::ChannelPartnerOrderItemOption.new
1253
+ item_option2.name = "Color"
1254
+ item_option2.value = "Orange"
1255
+
1256
+ item.options = [item_option1, item_option2]
1257
+
1258
+ order.items = [item]
1259
+ # -- Items End ---
1260
+
1261
+ order.mailing_list_opt_in = true # Yes, I confirmed with the customer personally they wish to be on my mailing lists.
1262
+ order.no_realtime_payment_processing = true # nothing to charge, payment was already collected
1263
+ order.payment_method = "Credit Card"
1264
+ order.rotating_transaction_gateway_code = "MyStripe" # We wish this to be charged against our Stripe gateway
1265
+ order.screen_branding_theme_code = "SF1986" # Theme codes predated StoreFronts. Each StoreFront still has a theme code under the hood
1266
+ order.ship_on_date = Time.now.strftime('%Y-%m-%dT00:00:00+00:00')
1267
+ order.ship_to_residential = true
1268
+ order.shipping_method = "FedEx: Ground"
1269
+ order.shipto_address1 = "55 Main Street"
1270
+ order.shipto_address2 = "Suite 202"
1271
+ order.shipto_city = "Duluth"
1272
+ order.shipto_company = "Widgets Inc"
1273
+ order.shipto_country_code = "US"
1274
+ order.shipto_day_phone = "6785552323"
1275
+ order.shipto_evening_phone = "7703334444"
1276
+ order.shipto_first_name = "Sally"
1277
+ order.shipto_last_name = "McGonkyDee"
1278
+ order.shipto_postal_code = "30097"
1279
+ order.shipto_state_region = "GA"
1280
+ order.shipto_title = "Director"
1281
+ order.skip_payment_processing = true # bypass payment
1282
+ order.special_instructions = "Please wrap this in bubble wrap because my FedEx delivery guy is abusive to packages"
1283
+ order.store_completed = true # this is an old order or an order handled completely outside UltraCart, so do not do anything to it. Just store it.
1284
+ order.storefront_host_name = 'store.mysite.com'
1285
+ order.store_if_payment_declines = false # if payment fails, this can send it to Accounts Receivable. Do not want that. Fail if payment fails.
1286
+ order.tax_county = "Gwinnett"
1287
+ order.tax_exempt = false
1288
+
1289
+ order_transaction = UltracartClient::ChannelPartnerOrderTransaction.new
1290
+ order_transaction.successful = true
1291
+
1292
+ td1 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1293
+ td1.name = "AVS Code"
1294
+ td1.value = "X"
1295
+
1296
+ td2 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1297
+ td2.name = "Authorization Code"
1298
+ td2.value = "123456"
1299
+
1300
+ td3 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1301
+ td3.name = "CVV Code"
1302
+ td3.value = "M"
1303
+
1304
+ td4 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1305
+ td4.name = "Response Code"
1306
+ td4.value = "Authorized"
1307
+
1308
+ td5 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1309
+ td5.name = "Reason Code"
1310
+ td5.value = "1"
1311
+
1312
+ td6 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1313
+ td6.name = "Response Subcode"
1314
+ td6.value = "1"
1315
+
1316
+ td7 = UltracartClient::ChannelPartnerOrderTransactionDetail.new
1317
+ td7.name = "Transaction ID"
1318
+ td7.value = "1234567890"
1319
+
1320
+ order_transaction.details = [td1, td2, td3, td4, td5, td6, td7]
1321
+ order.transaction = order_transaction
1322
+ order.treat_warnings_as_errors = true
1323
+
1324
+ api_response = channel_partner_api.import_channel_partner_order(order)
1325
+ ```
1326
+
1327
+
1328
+ #### Using the import_channel_partner_order_with_http_info variant
1329
+
1330
+ This returns an Array which contains the response data, status code and headers.
1331
+
1332
+ > <Array(<ChannelPartnerImportResponse>, Integer, Hash)> import_channel_partner_order_with_http_info(channel_partner_order)
1333
+
1334
+ ```ruby
1335
+ begin
1336
+ # Insert channel partner order
1337
+ data, status_code, headers = api_instance.import_channel_partner_order_with_http_info(channel_partner_order)
1338
+ p status_code # => 2xx
1339
+ p headers # => { ... }
1340
+ p data # => <ChannelPartnerImportResponse>
1341
+ rescue UltracartClient::ApiError => e
1342
+ puts "Error when calling ChannelPartnerApi->import_channel_partner_order_with_http_info: #{e}"
1343
+ end
1344
+ ```
1345
+
1346
+ ### Parameters
1347
+
1348
+ | Name | Type | Description | Notes |
1349
+ | ---- | ---- | ----------- | ----- |
1350
+ | **channel_partner_order** | [**ChannelPartnerOrder**](ChannelPartnerOrder.md) | Order to insert | |
1351
+
1352
+ ### Return type
1353
+
1354
+ [**ChannelPartnerImportResponse**](ChannelPartnerImportResponse.md)
1355
+
1356
+ ### Authorization
1357
+
1358
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1359
+
1360
+ ### HTTP request headers
1361
+
1362
+ - **Content-Type**: application/json; charset=UTF-8
1363
+ - **Accept**: application/json
1364
+
1365
+
1366
+ ## insert_channel_partner_ship_to_preference
1367
+
1368
+ > <ChannelPartnerShipToPreferenceResponse> insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference)
1369
+
1370
+ Insert a ship to preference record for the channel partner.
1371
+
1372
+ Insert a ship to preference record for the channel partner.
1373
+
1374
+
1375
+ ### Examples
1376
+
1377
+ ```ruby
1378
+ # Inserts a channel partner shipto preference for a channel partner.
1379
+ # These preferences are used by EDI channel partners to automatically
1380
+ # apply return policies and add additional free items to EDI orders based on the EDI code that is present.
1381
+ #
1382
+ # Possible Errors:
1383
+ # Attempting to interact with a channel partner other than the one tied to your API Key:
1384
+ # "Invalid channel_partner_oid specified. Your REST API key may only interact with channel_partner_oid: 12345"
1385
+ # Supplying a bad channel partner oid: "Invalid channel_partner_oid specified."
1386
+
1387
+ require 'ultracart_api'
1388
+ require_relative '../constants'
1389
+
1390
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
1391
+ channel_partner_oid = 12345
1392
+
1393
+ preference = UltracartClient::ChannelPartnerShipToPreference.new
1394
+ preference.channel_partner_oid = channel_partner_oid
1395
+ preference.ship_to_edi_code = 'EDI_CODE_HERE'
1396
+ preference.return_policy = "This is some return policy text that will be printed on the packing slip."
1397
+ preference.additional_kit_component_item_ids = ['ITEM_ID1', 'ITEM_ID2', 'ITEM_ID3']
1398
+ preference.description = "This is a merchant friendly description to help me remember what the above setting are."
1399
+
1400
+ api_response = channel_partner_api.insert_channel_partner_ship_to_preference(channel_partner_oid, preference)
1401
+
1402
+ if api_response.error
1403
+ STDERR.puts api_response.error.developer_message
1404
+ STDERR.puts api_response.error.user_message
1405
+ exit
1406
+ end
1407
+
1408
+ inserted_preference = api_response.ship_to_preference
1409
+
1410
+ # This should equal what you submitted.
1411
+ p inserted_preference
1412
+ ```
1413
+
1414
+
1415
+ #### Using the insert_channel_partner_ship_to_preference_with_http_info variant
1416
+
1417
+ This returns an Array which contains the response data, status code and headers.
1418
+
1419
+ > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference)
1420
+
1421
+ ```ruby
1422
+ begin
1423
+ # Insert a ship to preference record for the channel partner.
1424
+ data, status_code, headers = api_instance.insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference)
1425
+ p status_code # => 2xx
1426
+ p headers # => { ... }
1427
+ p data # => <ChannelPartnerShipToPreferenceResponse>
1428
+ rescue UltracartClient::ApiError => e
1429
+ puts "Error when calling ChannelPartnerApi->insert_channel_partner_ship_to_preference_with_http_info: #{e}"
1430
+ end
1431
+ ```
1432
+
1433
+ ### Parameters
1434
+
1435
+ | Name | Type | Description | Notes |
1436
+ | ---- | ---- | ----------- | ----- |
1437
+ | **channel_partner_oid** | **Integer** | | |
1438
+ | **ship_to_preference** | [**ChannelPartnerShipToPreference**](ChannelPartnerShipToPreference.md) | Ship to preference to create | |
1439
+
1440
+ ### Return type
1441
+
1442
+ [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
1443
+
1444
+ ### Authorization
1445
+
1446
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1447
+
1448
+ ### HTTP request headers
1449
+
1450
+ - **Content-Type**: application/json
1451
+ - **Accept**: application/json
1452
+
1453
+
1454
+ ## refund_channel_partner_order
1455
+
1456
+ > <OrderResponse> refund_channel_partner_order(order_id, order, opts)
1457
+
1458
+ Refund a channel partner order
1459
+
1460
+ 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.
1461
+
1462
+
1463
+ ### Examples
1464
+
1465
+ ```ruby
1466
+ # IMPORTANT: Do NOT construct the refunded order. This method does a refund but also update the entire object, so start with an order query.
1467
+ # ALWAYS start with an order retrieved from the system.
1468
+ # 1. Call getChannelPartnerOrder or getChannelPartnerOrderByChannelPartnerOrderId to retrieve the order being refunded
1469
+ # 2. For a full refund, reverse the following:
1470
+ # A. Set the refunded qty and refunded amount for each item.
1471
+ # B. Set the refunded tax (if any)
1472
+ # C. Set the refunded shipping
1473
+ # NOTE: refund amounts are positive numbers. If any item total cost is $20.00, a full refunded amount would also be positive $20.00
1474
+ # See the ChannelPartnerApi.getChannelPartnerOrder() sample for details on that method.
1475
+
1476
+ require 'ultracart_api'
1477
+ require_relative '../constants'
1478
+
1479
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
1480
+ # for a comment on this expansion, see getChannelPartnerOrder sample.
1481
+ expansion = "item,summary,shipping"
1482
+
1483
+ # This order MUST be an order associated with this channel partner, or you will receive a 400 Bad Request.
1484
+ order_id = 'DEMO-0009106820'
1485
+ api_response = channel_partner_api.get_channel_partner_order(order_id, _expand: expansion)
1486
+
1487
+ if api_response.error
1488
+ STDERR.puts api_response.error.developer_message
1489
+ STDERR.puts api_response.error.user_message
1490
+ exit
1491
+ end
1492
+
1493
+ order = api_response.order
1494
+
1495
+ # RefundReason may be required, but is optional by default.
1496
+ # RefundReason may be a set list, or may be freeform. This is configured on the backend (secure.ultracart.com)
1497
+ # by Navigating to Home -> Configuration -> Order Management -> Refund/Reject Reasons
1498
+ # Warning: If this is a 2nd refund after an initial partial refund, be sure you account for the units and amount already refunded.
1499
+ order.refund_reason = 'Damage Product'
1500
+ order.summary.tax_refunded = order.summary.tax_refunded
1501
+ order.summary.shipping_handling_refunded = order.summary.shipping_handling_total
1502
+
1503
+ order.items.each do |item|
1504
+ # item level refund reasons are optional, but may be required. See the above breadcrumb trail for refund reason config.
1505
+ item.refund_reason = 'DifferentItem'
1506
+ item.quantity_refunded = item.quantity
1507
+ item.total_refunded = item.total_cost_with_discount
1508
+ end
1509
+
1510
+ reject_after_refund = false
1511
+ skip_customer_notifications = true
1512
+ auto_order_cancel = false # if this was an auto order, and they wanted to cancel it, set this flag to true.
1513
+ # set manual_refund to true if the actual refund happened outside the system, and you just want a record of it.
1514
+ # If UltraCart did not process this refund, manual_refund should be true.
1515
+ manual_refund = false
1516
+ reverse_affiliate_transactions = true # for a full refund, the affiliate should not get credit, or should they?
1517
+ issue_store_credit = false # if true, the customer would receive store credit instead of a return on their credit card.
1518
+ auto_order_cancel_reason = nil
1519
+
1520
+ api_response = channel_partner_api.refund_channel_partner_order(order_id, order,
1521
+ reject_after_refund: reject_after_refund,
1522
+ skip_customer_notifications: skip_customer_notifications,
1523
+ auto_order_cancel: auto_order_cancel,
1524
+ manual_refund: manual_refund,
1525
+ reverse_affiliate_transactions: reverse_affiliate_transactions,
1526
+ issue_store_credit: issue_store_credit,
1527
+ auto_order_cancel_reason: auto_order_cancel_reason,
1528
+ _expand: expansion)
1529
+
1530
+ error = api_response.error
1531
+ updated_order = api_response.order
1532
+ # verify the updated order contains all the desired refunds. verify that refunded total is equal to total.
1533
+
1534
+ # Note: The error 'Request to refund an invalid amount.' means you requested a total refund amount less than or equal to zero.
1535
+ p error
1536
+ puts "\n\n-----------------\n\n"
1537
+ p updated_order
1538
+ ```
1539
+
1540
+
1541
+ #### Using the refund_channel_partner_order_with_http_info variant
1542
+
1543
+ This returns an Array which contains the response data, status code and headers.
1544
+
1545
+ > <Array(<OrderResponse>, Integer, Hash)> refund_channel_partner_order_with_http_info(order_id, order, opts)
1546
+
1547
+ ```ruby
1548
+ begin
1549
+ # Refund a channel partner order
1550
+ data, status_code, headers = api_instance.refund_channel_partner_order_with_http_info(order_id, order, opts)
1551
+ p status_code # => 2xx
1552
+ p headers # => { ... }
1553
+ p data # => <OrderResponse>
1554
+ rescue UltracartClient::ApiError => e
1555
+ puts "Error when calling ChannelPartnerApi->refund_channel_partner_order_with_http_info: #{e}"
1556
+ end
1557
+ ```
1558
+
1559
+ ### Parameters
1560
+
1561
+ | Name | Type | Description | Notes |
1562
+ | ---- | ---- | ----------- | ----- |
1563
+ | **order_id** | **String** | The order id to refund. | |
1564
+ | **order** | [**Order**](Order.md) | Order to refund | |
1565
+ | **reject_after_refund** | **Boolean** | Reject order after refund | [optional][default to false] |
1566
+ | **skip_customer_notification** | **Boolean** | Skip customer email notification | [optional][default to false] |
1567
+ | **auto_order_cancel** | **Boolean** | Cancel associated auto orders | [optional][default to false] |
1568
+ | **manual_refund** | **Boolean** | Consider a manual refund done externally | [optional][default to false] |
1569
+ | **reverse_affiliate_transactions** | **Boolean** | Reverse affiliate transactions | [optional][default to true] |
1570
+ | **issue_store_credit** | **Boolean** | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account | [optional][default to false] |
1571
+ | **auto_order_cancel_reason** | **String** | Reason for auto orders cancellation | [optional] |
1572
+ | **_expand** | **String** | The object expansion to perform on the result. See OrderApi.refundOrder documentation for examples | [optional] |
1573
+
1574
+ ### Return type
1575
+
1576
+ [**OrderResponse**](OrderResponse.md)
1577
+
1578
+ ### Authorization
1579
+
1580
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1581
+
1582
+ ### HTTP request headers
1583
+
1584
+ - **Content-Type**: application/json; charset=UTF-8
1585
+ - **Accept**: application/json
1586
+
1587
+
1588
+ ## update_channel_partner_ship_to_preference
1589
+
1590
+ > <ChannelPartnerShipToPreferenceResponse> update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1591
+
1592
+ Update a ship to preference record for the channel partner.
1593
+
1594
+ Update a ship to preference record for the channel partner.
1595
+
1596
+
1597
+ ### Examples
1598
+
1599
+ ```ruby
1600
+ # Updates a channel partner shipto preference for a channel partner.
1601
+ # These preferences are used by EDI channel partners to automatically
1602
+ # apply return policies and add additional free items to EDI orders based on the EDI code that is present.
1603
+ #
1604
+ # Possible Errors:
1605
+ # Attempting to interact with a channel partner other than the one tied to your API Key:
1606
+ # "Invalid channel_partner_oid specified. Your REST API key may only interact with channel_partner_oid: 12345"
1607
+ # Supplying a bad channel partner oid: "Invalid channel_partner_oid specified."
1608
+
1609
+ require 'ultracart_api'
1610
+ require_relative '../constants'
1611
+
1612
+ channel_partner_api = UltracartClient::ChannelPartnerApi.new_using_api_key(Constants::CHANNEL_PARTNER_API_KEY)
1613
+ channel_partner_oid = 12345
1614
+ channel_partner_ship_to_preference_oid = 67890
1615
+
1616
+ api_response = channel_partner_api.get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid)
1617
+
1618
+ preference = api_response.ship_to_preference
1619
+ # Update some fields.
1620
+ preference.ship_to_edi_code = 'EDI_CODE_HERE'
1621
+ preference.return_policy = "This is some return policy text that will be printed on the packing slip."
1622
+ preference.additional_kit_component_item_ids = ['ITEM_ID1', 'ITEM_ID2', 'ITEM_ID3']
1623
+ preference.description = "This is a merchant friendly description to help me remember what the above setting are."
1624
+
1625
+ api_response = channel_partner_api.update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, preference)
1626
+
1627
+ if api_response.error
1628
+ STDERR.puts api_response.error.developer_message
1629
+ STDERR.puts api_response.error.user_message
1630
+ exit
1631
+ end
1632
+
1633
+ updated_preference = api_response.ship_to_preference
1634
+
1635
+ # This should equal what you submitted.
1636
+ p updated_preference
1637
+ ```
1638
+
1639
+
1640
+ #### Using the update_channel_partner_ship_to_preference_with_http_info variant
1641
+
1642
+ This returns an Array which contains the response data, status code and headers.
1643
+
1644
+ > <Array(<ChannelPartnerShipToPreferenceResponse>, Integer, Hash)> update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1645
+
1646
+ ```ruby
1647
+ begin
1648
+ # Update a ship to preference record for the channel partner.
1649
+ data, status_code, headers = api_instance.update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference)
1650
+ p status_code # => 2xx
1651
+ p headers # => { ... }
1652
+ p data # => <ChannelPartnerShipToPreferenceResponse>
1653
+ rescue UltracartClient::ApiError => e
1654
+ puts "Error when calling ChannelPartnerApi->update_channel_partner_ship_to_preference_with_http_info: #{e}"
1655
+ end
1656
+ ```
1657
+
1658
+ ### Parameters
1659
+
1660
+ | Name | Type | Description | Notes |
1661
+ | ---- | ---- | ----------- | ----- |
1662
+ | **channel_partner_oid** | **Integer** | | |
1663
+ | **channel_partner_ship_to_preference_oid** | **Integer** | | |
1664
+ | **ship_to_preference** | [**ChannelPartnerShipToPreference**](ChannelPartnerShipToPreference.md) | Ship to preference to create | |
1665
+
1666
+ ### Return type
1667
+
1668
+ [**ChannelPartnerShipToPreferenceResponse**](ChannelPartnerShipToPreferenceResponse.md)
1669
+
1670
+ ### Authorization
1671
+
1672
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1673
+
1674
+ ### HTTP request headers
1675
+
1676
+ - **Content-Type**: application/json
1677
+ - **Accept**: application/json
1678
+