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,441 +1,567 @@
1
- # UltracartClient::FulfillmentApi
2
-
3
- All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**acknowledge_orders**](FulfillmentApi.md#acknowledge_orders) | **PUT** /fulfillment/distribution_centers/{distribution_center_code}/acknowledgements | Acknowledge receipt of orders. |
8
- | [**generate_packing_slip**](FulfillmentApi.md#generate_packing_slip) | **GET** /fulfillment/distribution_centers/{distribution_center_code}/orders/{order_id} | Generate a packing slip for this order for the given distribution center. |
9
- | [**get_distribution_center_orders**](FulfillmentApi.md#get_distribution_center_orders) | **GET** /fulfillment/distribution_centers/{distribution_center_code}/orders | Retrieve orders queued up for this distribution center. |
10
- | [**get_distribution_centers**](FulfillmentApi.md#get_distribution_centers) | **GET** /fulfillment/distribution_centers | Retrieve distribution centers |
11
- | [**ship_orders**](FulfillmentApi.md#ship_orders) | **POST** /fulfillment/distribution_centers/{distribution_center_code}/shipments | Mark orders as shipped |
12
- | [**update_inventory**](FulfillmentApi.md#update_inventory) | **POST** /fulfillment/distribution_centers/{distribution_center_code}/inventory | Update inventory |
13
-
14
-
15
- ## acknowledge_orders
16
-
17
- > acknowledge_orders(distribution_center_code, order_ids)
18
-
19
- Acknowledge receipt of orders.
20
-
21
- Acknowledge receipt of orders so that they are removed from the fulfillment queue. This method must be called after receiving and order (via webhook) or retrieving (via retrieve orders method).
22
-
23
- ### Examples
24
-
25
- ```ruby
26
- require 'time'
27
- require 'ultracart_api'
28
- require 'json'
29
- require 'yaml'
30
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
31
-
32
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
33
- # As such, this might not be the best way to use this object.
34
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
35
-
36
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
37
- distribution_center_code = 'distribution_center_code_example' # String | Distribution center code
38
- order_ids = ['property_example'] # Array<String> | Orders to acknowledge receipt of (limit 100)
39
-
40
- begin
41
- # Acknowledge receipt of orders.
42
- api_instance.acknowledge_orders(distribution_center_code, order_ids)
43
- rescue UltracartClient::ApiError => e
44
- puts "Error when calling FulfillmentApi->acknowledge_orders: #{e}"
45
- end
46
- ```
47
-
48
- #### Using the acknowledge_orders_with_http_info variant
49
-
50
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
51
-
52
- > <Array(nil, Integer, Hash)> acknowledge_orders_with_http_info(distribution_center_code, order_ids)
53
-
54
- ```ruby
55
- begin
56
- # Acknowledge receipt of orders.
57
- data, status_code, headers = api_instance.acknowledge_orders_with_http_info(distribution_center_code, order_ids)
58
- p status_code # => 2xx
59
- p headers # => { ... }
60
- p data # => nil
61
- rescue UltracartClient::ApiError => e
62
- puts "Error when calling FulfillmentApi->acknowledge_orders_with_http_info: #{e}"
63
- end
64
- ```
65
-
66
- ### Parameters
67
-
68
- | Name | Type | Description | Notes |
69
- | ---- | ---- | ----------- | ----- |
70
- | **distribution_center_code** | **String** | Distribution center code | |
71
- | **order_ids** | [**Array&lt;String&gt;**](String.md) | Orders to acknowledge receipt of (limit 100) | |
72
-
73
- ### Return type
74
-
75
- nil (empty response body)
76
-
77
- ### Authorization
78
-
79
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
80
-
81
- ### HTTP request headers
82
-
83
- - **Content-Type**: application/json
84
- - **Accept**: application/json
85
-
86
-
87
- ## generate_packing_slip
88
-
89
- > <OrderPackingSlipResponse> generate_packing_slip(distribution_center_code, order_id)
90
-
91
- Generate a packing slip for this order for the given distribution center.
92
-
93
- The packing slip PDF that is returned is base 64 encoded
94
-
95
- ### Examples
96
-
97
- ```ruby
98
- require 'time'
99
- require 'ultracart_api'
100
- require 'json'
101
- require 'yaml'
102
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
103
-
104
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
105
- # As such, this might not be the best way to use this object.
106
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
107
-
108
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
109
- distribution_center_code = 'distribution_center_code_example' # String | Distribution center code
110
- order_id = 'order_id_example' # String | Order ID
111
-
112
- begin
113
- # Generate a packing slip for this order for the given distribution center.
114
- result = api_instance.generate_packing_slip(distribution_center_code, order_id)
115
- p result
116
- rescue UltracartClient::ApiError => e
117
- puts "Error when calling FulfillmentApi->generate_packing_slip: #{e}"
118
- end
119
- ```
120
-
121
- #### Using the generate_packing_slip_with_http_info variant
122
-
123
- This returns an Array which contains the response data, status code and headers.
124
-
125
- > <Array(<OrderPackingSlipResponse>, Integer, Hash)> generate_packing_slip_with_http_info(distribution_center_code, order_id)
126
-
127
- ```ruby
128
- begin
129
- # Generate a packing slip for this order for the given distribution center.
130
- data, status_code, headers = api_instance.generate_packing_slip_with_http_info(distribution_center_code, order_id)
131
- p status_code # => 2xx
132
- p headers # => { ... }
133
- p data # => <OrderPackingSlipResponse>
134
- rescue UltracartClient::ApiError => e
135
- puts "Error when calling FulfillmentApi->generate_packing_slip_with_http_info: #{e}"
136
- end
137
- ```
138
-
139
- ### Parameters
140
-
141
- | Name | Type | Description | Notes |
142
- | ---- | ---- | ----------- | ----- |
143
- | **distribution_center_code** | **String** | Distribution center code | |
144
- | **order_id** | **String** | Order ID | |
145
-
146
- ### Return type
147
-
148
- [**OrderPackingSlipResponse**](OrderPackingSlipResponse.md)
149
-
150
- ### Authorization
151
-
152
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
153
-
154
- ### HTTP request headers
155
-
156
- - **Content-Type**: Not defined
157
- - **Accept**: application/json
158
-
159
-
160
- ## get_distribution_center_orders
161
-
162
- > <OrdersResponse> get_distribution_center_orders(distribution_center_code)
163
-
164
- Retrieve orders queued up for this distribution center.
165
-
166
- Retrieves up to 100 orders that are queued up in this distribution center. You must acknowledge them before additional new orders will be returned. There is NO record chunking. You'll get the same 100 records again and again until you acknowledge orders. The orders that are returned contain only items for this distribution center and are by default completely expanded with billing, channel_partner, checkout, coupons, customer_profile, edi, gift, gift_certificate, internal, items, payment, shipping, summary, taxes.
167
-
168
- ### Examples
169
-
170
- ```ruby
171
- require 'time'
172
- require 'ultracart_api'
173
- require 'json'
174
- require 'yaml'
175
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
176
-
177
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
178
- # As such, this might not be the best way to use this object.
179
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
180
-
181
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
182
- distribution_center_code = 'distribution_center_code_example' # String | Distribution center code
183
-
184
- begin
185
- # Retrieve orders queued up for this distribution center.
186
- result = api_instance.get_distribution_center_orders(distribution_center_code)
187
- p result
188
- rescue UltracartClient::ApiError => e
189
- puts "Error when calling FulfillmentApi->get_distribution_center_orders: #{e}"
190
- end
191
- ```
192
-
193
- #### Using the get_distribution_center_orders_with_http_info variant
194
-
195
- This returns an Array which contains the response data, status code and headers.
196
-
197
- > <Array(<OrdersResponse>, Integer, Hash)> get_distribution_center_orders_with_http_info(distribution_center_code)
198
-
199
- ```ruby
200
- begin
201
- # Retrieve orders queued up for this distribution center.
202
- data, status_code, headers = api_instance.get_distribution_center_orders_with_http_info(distribution_center_code)
203
- p status_code # => 2xx
204
- p headers # => { ... }
205
- p data # => <OrdersResponse>
206
- rescue UltracartClient::ApiError => e
207
- puts "Error when calling FulfillmentApi->get_distribution_center_orders_with_http_info: #{e}"
208
- end
209
- ```
210
-
211
- ### Parameters
212
-
213
- | Name | Type | Description | Notes |
214
- | ---- | ---- | ----------- | ----- |
215
- | **distribution_center_code** | **String** | Distribution center code | |
216
-
217
- ### Return type
218
-
219
- [**OrdersResponse**](OrdersResponse.md)
220
-
221
- ### Authorization
222
-
223
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
224
-
225
- ### HTTP request headers
226
-
227
- - **Content-Type**: Not defined
228
- - **Accept**: application/json
229
-
230
-
231
- ## get_distribution_centers
232
-
233
- > <DistributionCentersResponse> get_distribution_centers
234
-
235
- Retrieve distribution centers
236
-
237
- Retrieves the distribution centers that this user has access to.
238
-
239
- ### Examples
240
-
241
- ```ruby
242
- require 'time'
243
- require 'ultracart_api'
244
- require 'json'
245
- require 'yaml'
246
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
247
-
248
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
249
- # As such, this might not be the best way to use this object.
250
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
251
-
252
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
253
-
254
- begin
255
- # Retrieve distribution centers
256
- result = api_instance.get_distribution_centers
257
- p result
258
- rescue UltracartClient::ApiError => e
259
- puts "Error when calling FulfillmentApi->get_distribution_centers: #{e}"
260
- end
261
- ```
262
-
263
- #### Using the get_distribution_centers_with_http_info variant
264
-
265
- This returns an Array which contains the response data, status code and headers.
266
-
267
- > <Array(<DistributionCentersResponse>, Integer, Hash)> get_distribution_centers_with_http_info
268
-
269
- ```ruby
270
- begin
271
- # Retrieve distribution centers
272
- data, status_code, headers = api_instance.get_distribution_centers_with_http_info
273
- p status_code # => 2xx
274
- p headers # => { ... }
275
- p data # => <DistributionCentersResponse>
276
- rescue UltracartClient::ApiError => e
277
- puts "Error when calling FulfillmentApi->get_distribution_centers_with_http_info: #{e}"
278
- end
279
- ```
280
-
281
- ### Parameters
282
-
283
- This endpoint does not need any parameter.
284
-
285
- ### Return type
286
-
287
- [**DistributionCentersResponse**](DistributionCentersResponse.md)
288
-
289
- ### Authorization
290
-
291
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
292
-
293
- ### HTTP request headers
294
-
295
- - **Content-Type**: Not defined
296
- - **Accept**: application/json
297
-
298
-
299
- ## ship_orders
300
-
301
- > ship_orders(distribution_center_code, shipments)
302
-
303
- Mark orders as shipped
304
-
305
- Store the tracking information and mark the order shipped for this distribution center.
306
-
307
- ### Examples
308
-
309
- ```ruby
310
- require 'time'
311
- require 'ultracart_api'
312
- require 'json'
313
- require 'yaml'
314
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
315
-
316
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
317
- # As such, this might not be the best way to use this object.
318
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
319
-
320
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
321
- distribution_center_code = 'distribution_center_code_example' # String | Distribution center code
322
- shipments = [UltracartClient::FulfillmentShipment.new] # Array<FulfillmentShipment> | Orders to mark shipped
323
-
324
- begin
325
- # Mark orders as shipped
326
- api_instance.ship_orders(distribution_center_code, shipments)
327
- rescue UltracartClient::ApiError => e
328
- puts "Error when calling FulfillmentApi->ship_orders: #{e}"
329
- end
330
- ```
331
-
332
- #### Using the ship_orders_with_http_info variant
333
-
334
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
335
-
336
- > <Array(nil, Integer, Hash)> ship_orders_with_http_info(distribution_center_code, shipments)
337
-
338
- ```ruby
339
- begin
340
- # Mark orders as shipped
341
- data, status_code, headers = api_instance.ship_orders_with_http_info(distribution_center_code, shipments)
342
- p status_code # => 2xx
343
- p headers # => { ... }
344
- p data # => nil
345
- rescue UltracartClient::ApiError => e
346
- puts "Error when calling FulfillmentApi->ship_orders_with_http_info: #{e}"
347
- end
348
- ```
349
-
350
- ### Parameters
351
-
352
- | Name | Type | Description | Notes |
353
- | ---- | ---- | ----------- | ----- |
354
- | **distribution_center_code** | **String** | Distribution center code | |
355
- | **shipments** | [**Array&lt;FulfillmentShipment&gt;**](FulfillmentShipment.md) | Orders to mark shipped | |
356
-
357
- ### Return type
358
-
359
- nil (empty response body)
360
-
361
- ### Authorization
362
-
363
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
364
-
365
- ### HTTP request headers
366
-
367
- - **Content-Type**: application/json
368
- - **Accept**: application/json
369
-
370
-
371
- ## update_inventory
372
-
373
- > update_inventory(distribution_center_code, inventories)
374
-
375
- Update inventory
376
-
377
- Update the inventory for items associated with this distribution center
378
-
379
- ### Examples
380
-
381
- ```ruby
382
- require 'time'
383
- require 'ultracart_api'
384
- require 'json'
385
- require 'yaml'
386
- require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
387
-
388
- # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
389
- # As such, this might not be the best way to use this object.
390
- # Please see https://github.com/UltraCart/sdk_samples for working examples.
391
-
392
- api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
393
- distribution_center_code = 'distribution_center_code_example' # String | Distribution center code
394
- inventories = [UltracartClient::FulfillmentInventory.new] # Array<FulfillmentInventory> | Inventory updates (limit 500)
395
-
396
- begin
397
- # Update inventory
398
- api_instance.update_inventory(distribution_center_code, inventories)
399
- rescue UltracartClient::ApiError => e
400
- puts "Error when calling FulfillmentApi->update_inventory: #{e}"
401
- end
402
- ```
403
-
404
- #### Using the update_inventory_with_http_info variant
405
-
406
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
407
-
408
- > <Array(nil, Integer, Hash)> update_inventory_with_http_info(distribution_center_code, inventories)
409
-
410
- ```ruby
411
- begin
412
- # Update inventory
413
- data, status_code, headers = api_instance.update_inventory_with_http_info(distribution_center_code, inventories)
414
- p status_code # => 2xx
415
- p headers # => { ... }
416
- p data # => nil
417
- rescue UltracartClient::ApiError => e
418
- puts "Error when calling FulfillmentApi->update_inventory_with_http_info: #{e}"
419
- end
420
- ```
421
-
422
- ### Parameters
423
-
424
- | Name | Type | Description | Notes |
425
- | ---- | ---- | ----------- | ----- |
426
- | **distribution_center_code** | **String** | Distribution center code | |
427
- | **inventories** | [**Array&lt;FulfillmentInventory&gt;**](FulfillmentInventory.md) | Inventory updates (limit 500) | |
428
-
429
- ### Return type
430
-
431
- nil (empty response body)
432
-
433
- ### Authorization
434
-
435
- [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
436
-
437
- ### HTTP request headers
438
-
439
- - **Content-Type**: application/json
440
- - **Accept**: application/json
441
-
1
+ # UltracartClient::FulfillmentApi
2
+
3
+ All URIs are relative to *https://secure.ultracart.com/rest/v2*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**acknowledge_orders**](FulfillmentApi.md#acknowledge_orders) | **PUT** /fulfillment/distribution_centers/{distribution_center_code}/acknowledgements | Acknowledge receipt of orders. |
8
+ | [**generate_packing_slip**](FulfillmentApi.md#generate_packing_slip) | **GET** /fulfillment/distribution_centers/{distribution_center_code}/orders/{order_id} | Generate a packing slip for this order for the given distribution center. |
9
+ | [**get_distribution_center_orders**](FulfillmentApi.md#get_distribution_center_orders) | **GET** /fulfillment/distribution_centers/{distribution_center_code}/orders | Retrieve orders queued up for this distribution center. |
10
+ | [**get_distribution_centers**](FulfillmentApi.md#get_distribution_centers) | **GET** /fulfillment/distribution_centers | Retrieve distribution centers |
11
+ | [**ship_orders**](FulfillmentApi.md#ship_orders) | **POST** /fulfillment/distribution_centers/{distribution_center_code}/shipments | Mark orders as shipped |
12
+ | [**update_inventory**](FulfillmentApi.md#update_inventory) | **POST** /fulfillment/distribution_centers/{distribution_center_code}/inventory | Update inventory |
13
+
14
+
15
+ ## acknowledge_orders
16
+
17
+ > acknowledge_orders(distribution_center_code, order_ids)
18
+
19
+ Acknowledge receipt of orders.
20
+
21
+ Acknowledge receipt of orders so that they are removed from the fulfillment queue. This method must be called after receiving and order (via webhook) or retrieving (via retrieve orders method).
22
+
23
+
24
+ ### Examples
25
+
26
+ ```ruby
27
+ require 'ultracart_api'
28
+ require_relative '../constants'
29
+
30
+ =begin
31
+ acknowledgeOrders informs UltraCart that you (the fulfillment center) have received an order and have queued it for
32
+ shipping. This method is NOT used to notify an order has shipped, only that it is going to be shipped at some
33
+ point in the future.
34
+
35
+ This method should be called by a fulfillment center after receiving an order either by 1) getDistributionCenterOrders
36
+ or 2) webhook. Webhooks are the most efficient means for receiving orders, but if your fulfillment center lacks
37
+ the ability to consume webhooks, polling by getDistributionCenterOrders is an alternate means.
38
+
39
+ This method is important for notifying UltraCart that a fulfillment center has the action on an order. Until this
40
+ call is made, UltraCart will continue to notify a fulfillment center of an order either by 1) subsequent webhooks or
41
+ 2) continue to include an order in subsequent getDistributionCenterOrders.
42
+
43
+ You will need the distribution center (DC) code. UltraCart allows for multiple DC and the code is a
44
+ unique short string you assign to a DC as an easy mnemonic.
45
+
46
+ For more information about UltraCart distribution centers, please see:
47
+ https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
48
+
49
+ If you do not know your DC code, query a list of all DC and print them out.
50
+ result = fulfillment_api.get_distribution_centers
51
+ puts result.inspect
52
+
53
+ A successful call will receive back a status code 204 (No Content).
54
+
55
+ Possible Errors:
56
+ More than 100 order ids provided -> "order_ids can not contain more than 100 records at a time"
57
+ =end
58
+
59
+ distribution_center_code = 'RAMI'
60
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
61
+
62
+ orders_ids = ['DEMO-12345', 'DEMO-12346', 'DEMO-12347', 'DEMO-12348', 'DEMO-12349']
63
+
64
+ begin
65
+ # limit is 100 acknowledgements at a time.
66
+ fulfillment_api.acknowledge_orders(distribution_center_code, orders_ids)
67
+ puts "done"
68
+ rescue UltracartClient::ApiError => e
69
+ # update inventory failed. examine the reason.
70
+ puts "Exception when calling FulfillmentApi->acknowledge_orders: #{e.message}"
71
+ exit
72
+ end
73
+ ```
74
+
75
+
76
+ #### Using the acknowledge_orders_with_http_info variant
77
+
78
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
79
+
80
+ > <Array(nil, Integer, Hash)> acknowledge_orders_with_http_info(distribution_center_code, order_ids)
81
+
82
+ ```ruby
83
+ begin
84
+ # Acknowledge receipt of orders.
85
+ data, status_code, headers = api_instance.acknowledge_orders_with_http_info(distribution_center_code, order_ids)
86
+ p status_code # => 2xx
87
+ p headers # => { ... }
88
+ p data # => nil
89
+ rescue UltracartClient::ApiError => e
90
+ puts "Error when calling FulfillmentApi->acknowledge_orders_with_http_info: #{e}"
91
+ end
92
+ ```
93
+
94
+ ### Parameters
95
+
96
+ | Name | Type | Description | Notes |
97
+ | ---- | ---- | ----------- | ----- |
98
+ | **distribution_center_code** | **String** | Distribution center code | |
99
+ | **order_ids** | [**Array&lt;String&gt;**](String.md) | Orders to acknowledge receipt of (limit 100) | |
100
+
101
+ ### Return type
102
+
103
+ nil (empty response body)
104
+
105
+ ### Authorization
106
+
107
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
108
+
109
+ ### HTTP request headers
110
+
111
+ - **Content-Type**: application/json
112
+ - **Accept**: application/json
113
+
114
+
115
+ ## generate_packing_slip
116
+
117
+ > <OrderPackingSlipResponse> generate_packing_slip(distribution_center_code, order_id)
118
+
119
+ Generate a packing slip for this order for the given distribution center.
120
+
121
+ The packing slip PDF that is returned is base 64 encoded
122
+
123
+
124
+ ### Examples
125
+
126
+ ```ruby
127
+ require 'ultracart_api'
128
+ require_relative '../constants'
129
+ require 'base64'
130
+
131
+ =begin
132
+ generatePackingSlip accepts a distribution center code and order_id and returns back a base64 encoded byte array pdf.
133
+ Both the dc code and order_id are needed because an order may have multiple items shipping via different DCs.
134
+
135
+ You will need the distribution center (DC) code. UltraCart allows for multiple DC and the code is a
136
+ unique short string you assign to a DC as an easy mnemonic.
137
+
138
+ For more information about UltraCart distribution centers, please see:
139
+ https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
140
+
141
+ If you do not know your DC code, query a list of all DC and print them out.
142
+ result = fulfillment_api.get_distribution_centers
143
+ puts result.inspect
144
+
145
+ =end
146
+
147
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
148
+
149
+ distribution_center_code = 'RAMI'
150
+ orders_id = 'DEMO-12345'
151
+
152
+ begin
153
+ # limit is 500 inventory updates at a time. batch them if you're going large.
154
+ api_response = fulfillment_api.generate_packing_slip(distribution_center_code, orders_id)
155
+ base64_pdf = api_response.pdf_base64
156
+ decoded_pdf = Base64.decode64(base64_pdf)
157
+ File.write('packing_slip.pdf', decoded_pdf)
158
+
159
+ puts "done"
160
+ rescue UltracartClient::ApiError => e
161
+ # update inventory failed. examine the reason.
162
+ puts "Exception when calling FulfillmentApi->generate_packing_slip: #{e.message}"
163
+ exit
164
+ end
165
+ ```
166
+
167
+
168
+ #### Using the generate_packing_slip_with_http_info variant
169
+
170
+ This returns an Array which contains the response data, status code and headers.
171
+
172
+ > <Array(<OrderPackingSlipResponse>, Integer, Hash)> generate_packing_slip_with_http_info(distribution_center_code, order_id)
173
+
174
+ ```ruby
175
+ begin
176
+ # Generate a packing slip for this order for the given distribution center.
177
+ data, status_code, headers = api_instance.generate_packing_slip_with_http_info(distribution_center_code, order_id)
178
+ p status_code # => 2xx
179
+ p headers # => { ... }
180
+ p data # => <OrderPackingSlipResponse>
181
+ rescue UltracartClient::ApiError => e
182
+ puts "Error when calling FulfillmentApi->generate_packing_slip_with_http_info: #{e}"
183
+ end
184
+ ```
185
+
186
+ ### Parameters
187
+
188
+ | Name | Type | Description | Notes |
189
+ | ---- | ---- | ----------- | ----- |
190
+ | **distribution_center_code** | **String** | Distribution center code | |
191
+ | **order_id** | **String** | Order ID | |
192
+
193
+ ### Return type
194
+
195
+ [**OrderPackingSlipResponse**](OrderPackingSlipResponse.md)
196
+
197
+ ### Authorization
198
+
199
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
200
+
201
+ ### HTTP request headers
202
+
203
+ - **Content-Type**: Not defined
204
+ - **Accept**: application/json
205
+
206
+
207
+ ## get_distribution_center_orders
208
+
209
+ > <OrdersResponse> get_distribution_center_orders(distribution_center_code)
210
+
211
+ Retrieve orders queued up for this distribution center.
212
+
213
+ Retrieves up to 100 orders that are queued up in this distribution center. You must acknowledge them before additional new orders will be returned. There is NO record chunking. You'll get the same 100 records again and again until you acknowledge orders. The orders that are returned contain only items for this distribution center and are by default completely expanded with billing, channel_partner, checkout, coupons, customer_profile, edi, gift, gift_certificate, internal, items, payment, shipping, summary, taxes.
214
+
215
+
216
+ ### Examples
217
+
218
+ ```ruby
219
+ require_relative '../constants'
220
+ require 'ultracart_api'
221
+
222
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
223
+
224
+ # getDistributionCenterOrders accepts a distribution center code and returns back up to 100 orders that need shipping.
225
+ # There is NO pagination with this method call. Once you receive the orders, you should insert them into your
226
+ # system, and acknowledge them via the acknowledgeOrders call. After you acknowledge the orders, subsequent calls
227
+ # to getDistributionCenterOrders will return another batch of 100 orders.
228
+ #
229
+ # The orders that are returned contain only items for THIS distribution center and are by default completely expanded
230
+ # with billing, channel_partner, checkout, coupons, customer_profile, edi, gift, gift_certificate, internal,
231
+ # items, payment, shipping, summary, taxes
232
+ #
233
+ # You will need the distribution center (DC) code. UltraCart allows for multiple DC and the code is a
234
+ # unique short string you assign to a DC as an easy mnemonic.
235
+ #
236
+ # For more information about UltraCart distribution centers, please see:
237
+ # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
238
+ #
239
+ # If you do not know your DC code, query a list of all DC and print them out.
240
+ # result = fulfillment_api.get_distribution_centers
241
+ # puts result.inspect
242
+
243
+ begin
244
+ acknowledged_orders = []
245
+ distribution_center_code = 'RAMI'
246
+ result = fulfillment_api.get_distribution_center_orders(distribution_center_code)
247
+ orders = result.orders
248
+ orders.each do |order|
249
+ puts order.inspect
250
+ # TODO: do something useful with this order, like adding it to your shipping queue.
251
+ acknowledged_orders << order.order_id
252
+ end
253
+
254
+ # TODO: once you've securely and completely received it into your system, acknowledge the order.
255
+ fulfillment_api.acknowledge_orders(distribution_center_code, acknowledged_orders)
256
+
257
+ # After acknowledging orders, you should call getDistributionCenterOrders again until you receive zero orders to ship.
258
+
259
+ puts "done"
260
+ rescue UltracartClient::ApiException => e
261
+ # update inventory failed. examine the reason.
262
+ puts "Exception when calling FulfillmentApi->getDistributionCenterOrders: #{e.message}"
263
+ exit
264
+ end
265
+ ```
266
+
267
+
268
+ #### Using the get_distribution_center_orders_with_http_info variant
269
+
270
+ This returns an Array which contains the response data, status code and headers.
271
+
272
+ > <Array(<OrdersResponse>, Integer, Hash)> get_distribution_center_orders_with_http_info(distribution_center_code)
273
+
274
+ ```ruby
275
+ begin
276
+ # Retrieve orders queued up for this distribution center.
277
+ data, status_code, headers = api_instance.get_distribution_center_orders_with_http_info(distribution_center_code)
278
+ p status_code # => 2xx
279
+ p headers # => { ... }
280
+ p data # => <OrdersResponse>
281
+ rescue UltracartClient::ApiError => e
282
+ puts "Error when calling FulfillmentApi->get_distribution_center_orders_with_http_info: #{e}"
283
+ end
284
+ ```
285
+
286
+ ### Parameters
287
+
288
+ | Name | Type | Description | Notes |
289
+ | ---- | ---- | ----------- | ----- |
290
+ | **distribution_center_code** | **String** | Distribution center code | |
291
+
292
+ ### Return type
293
+
294
+ [**OrdersResponse**](OrdersResponse.md)
295
+
296
+ ### Authorization
297
+
298
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
299
+
300
+ ### HTTP request headers
301
+
302
+ - **Content-Type**: Not defined
303
+ - **Accept**: application/json
304
+
305
+
306
+ ## get_distribution_centers
307
+
308
+ > <DistributionCentersResponse> get_distribution_centers
309
+
310
+ Retrieve distribution centers
311
+
312
+ Retrieves the distribution centers that this user has access to.
313
+
314
+
315
+ ### Examples
316
+
317
+ ```ruby
318
+ require_relative '../constants'
319
+ require 'ultracart_api'
320
+
321
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
322
+
323
+ # This method returns back a list of all distribution centers configured for a merchant.
324
+ #
325
+ # You will need the distribution center (DC) code for most operations.
326
+ # UltraCart allows for multiple DC and the code is a unique short string you assign to a DC as an easy mnemonic.
327
+ # This method call is an easy way to determine what a DC code is for a particular distribution center.
328
+ #
329
+ # For more information about UltraCart distribution centers, please see:
330
+ # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
331
+
332
+ begin
333
+ result = fulfillment_api.get_distribution_centers
334
+ puts result.inspect
335
+
336
+ puts "done"
337
+ rescue UltracartClient::ApiException => e
338
+ # update inventory failed. examine the reason.
339
+ puts "Exception when calling FulfillmentApi->getDistributionCenters: #{e.message}"
340
+ exit
341
+ end
342
+ ```
343
+
344
+
345
+ #### Using the get_distribution_centers_with_http_info variant
346
+
347
+ This returns an Array which contains the response data, status code and headers.
348
+
349
+ > <Array(<DistributionCentersResponse>, Integer, Hash)> get_distribution_centers_with_http_info
350
+
351
+ ```ruby
352
+ begin
353
+ # Retrieve distribution centers
354
+ data, status_code, headers = api_instance.get_distribution_centers_with_http_info
355
+ p status_code # => 2xx
356
+ p headers # => { ... }
357
+ p data # => <DistributionCentersResponse>
358
+ rescue UltracartClient::ApiError => e
359
+ puts "Error when calling FulfillmentApi->get_distribution_centers_with_http_info: #{e}"
360
+ end
361
+ ```
362
+
363
+ ### Parameters
364
+
365
+ This endpoint does not need any parameter.
366
+
367
+ ### Return type
368
+
369
+ [**DistributionCentersResponse**](DistributionCentersResponse.md)
370
+
371
+ ### Authorization
372
+
373
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
374
+
375
+ ### HTTP request headers
376
+
377
+ - **Content-Type**: Not defined
378
+ - **Accept**: application/json
379
+
380
+
381
+ ## ship_orders
382
+
383
+ > ship_orders(distribution_center_code, shipments)
384
+
385
+ Mark orders as shipped
386
+
387
+ Store the tracking information and mark the order shipped for this distribution center.
388
+
389
+
390
+ ### Examples
391
+
392
+ ```ruby
393
+ require_relative '../constants'
394
+ require 'ultracart_api'
395
+
396
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
397
+
398
+ # shipOrders informs UltraCart that you (the fulfillment center) have shipped an order and allows you to provide
399
+ # UltraCart with tracking information.
400
+ #
401
+ # You will need the distribution center (DC) code. UltraCart allows for multiple DC and the code is a
402
+ # unique short string you assign to a DC as an easy mnemonic.
403
+ #
404
+ # For more information about UltraCart distribution centers, please see:
405
+ # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
406
+ #
407
+ # If you do not know your DC code, query a list of all DC and print them out.
408
+ # result = fulfillment_api.get_distribution_centers
409
+ # puts result.inspect
410
+ #
411
+ # A successful call will receive back a status code 204 (No Content).
412
+ #
413
+ # Possible Errors:
414
+ # More than 100 order ids provided -> "shipments can not contain more than 100 records at a time"
415
+
416
+ distribution_center_code = 'RAMI'
417
+ shipment = UltracartClient::FulfillmentShipment.new
418
+ shipment.order_id = 'DEMO-12345'
419
+ shipment.tracking_numbers = ['UPS-1234567890', 'USPS-BLAH-BLAH-BLAH'] # this order had two boxes.
420
+ shipment.shipping_cost = 16.99 # the actual cost to ship this order
421
+ shipment.fulfillment_fee = 8.99 # this fulfillment center is kinda pricey.
422
+ shipment.package_cost = 11.99 # 11.99? we use only the finest packaging.
423
+
424
+ shipments = [shipment] # up to 100 shipments per call
425
+
426
+ begin
427
+ # limit is 100 shipments updates at a time.
428
+ fulfillment_api.ship_orders(distribution_center_code, shipments)
429
+ puts "done"
430
+ rescue UltracartClient::ApiException => e
431
+ # update inventory failed. examine the reason.
432
+ puts "Exception when calling FulfillmentApi->shipOrders: #{e.message}"
433
+ exit
434
+ end
435
+ ```
436
+
437
+
438
+ #### Using the ship_orders_with_http_info variant
439
+
440
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
441
+
442
+ > <Array(nil, Integer, Hash)> ship_orders_with_http_info(distribution_center_code, shipments)
443
+
444
+ ```ruby
445
+ begin
446
+ # Mark orders as shipped
447
+ data, status_code, headers = api_instance.ship_orders_with_http_info(distribution_center_code, shipments)
448
+ p status_code # => 2xx
449
+ p headers # => { ... }
450
+ p data # => nil
451
+ rescue UltracartClient::ApiError => e
452
+ puts "Error when calling FulfillmentApi->ship_orders_with_http_info: #{e}"
453
+ end
454
+ ```
455
+
456
+ ### Parameters
457
+
458
+ | Name | Type | Description | Notes |
459
+ | ---- | ---- | ----------- | ----- |
460
+ | **distribution_center_code** | **String** | Distribution center code | |
461
+ | **shipments** | [**Array&lt;FulfillmentShipment&gt;**](FulfillmentShipment.md) | Orders to mark shipped | |
462
+
463
+ ### Return type
464
+
465
+ nil (empty response body)
466
+
467
+ ### Authorization
468
+
469
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
470
+
471
+ ### HTTP request headers
472
+
473
+ - **Content-Type**: application/json
474
+ - **Accept**: application/json
475
+
476
+
477
+ ## update_inventory
478
+
479
+ > update_inventory(distribution_center_code, inventories)
480
+
481
+ Update inventory
482
+
483
+ Update the inventory for items associated with this distribution center
484
+
485
+
486
+ ### Examples
487
+
488
+ ```ruby
489
+ require_relative '../constants'
490
+ require 'ultracart_api'
491
+
492
+ fulfillment_api = UltracartClient::FulfillmentApi.new_using_api_key(Constants::API_KEY)
493
+
494
+ # updateInventory is a simple means of updating UltraCart inventory for one or more items (500 max per call)
495
+ # You will need the distribution center (DC) code. UltraCart allows for multiple DC and the code is a
496
+ # unique short string you assign to a DC as an easy mnemonic.
497
+ #
498
+ # For more information about UltraCart distribution centers, please see:
499
+ # https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/1377114/Distribution+Center
500
+ #
501
+ # If you do not know your DC code, query a list of all DC and print them out.
502
+ # result = fulfillment_api.get_distribution_centers
503
+ # puts result.inspect
504
+ #
505
+ # Possible Errors:
506
+ # More than 500 items provided -> "inventories can not contain more than 500 records at a time"
507
+
508
+ distribution_center_code = 'RAMI'
509
+ sku = '9780982021361'
510
+ quantity = 9
511
+ first_inventory = UltracartClient::FulfillmentInventory.new
512
+ first_inventory.item_id = sku
513
+ first_inventory.quantity = quantity
514
+ inventory_updates = [first_inventory] # for this example, we're only updating one item.
515
+
516
+ puts inventory_updates.inspect
517
+
518
+ begin
519
+ # limit is 500 inventory updates at a time. batch them if you're going large.
520
+ fulfillment_api.update_inventory(distribution_center_code, inventory_updates)
521
+ puts "done"
522
+ rescue UltracartClient::ApiException => e
523
+ # update inventory failed. examine the reason.
524
+ puts "Exception when calling FulfillmentApi->updateInventory: #{e.message}"
525
+ exit
526
+ end
527
+ ```
528
+
529
+
530
+ #### Using the update_inventory_with_http_info variant
531
+
532
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
533
+
534
+ > <Array(nil, Integer, Hash)> update_inventory_with_http_info(distribution_center_code, inventories)
535
+
536
+ ```ruby
537
+ begin
538
+ # Update inventory
539
+ data, status_code, headers = api_instance.update_inventory_with_http_info(distribution_center_code, inventories)
540
+ p status_code # => 2xx
541
+ p headers # => { ... }
542
+ p data # => nil
543
+ rescue UltracartClient::ApiError => e
544
+ puts "Error when calling FulfillmentApi->update_inventory_with_http_info: #{e}"
545
+ end
546
+ ```
547
+
548
+ ### Parameters
549
+
550
+ | Name | Type | Description | Notes |
551
+ | ---- | ---- | ----------- | ----- |
552
+ | **distribution_center_code** | **String** | Distribution center code | |
553
+ | **inventories** | [**Array&lt;FulfillmentInventory&gt;**](FulfillmentInventory.md) | Inventory updates (limit 500) | |
554
+
555
+ ### Return type
556
+
557
+ nil (empty response body)
558
+
559
+ ### Authorization
560
+
561
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
562
+
563
+ ### HTTP request headers
564
+
565
+ - **Content-Type**: application/json
566
+ - **Accept**: application/json
567
+