Class: Zippendo::ShipmentsApi
- Inherits:
-
Object
- Object
- Zippendo::ShipmentsApi
- Defined in:
- lib/zippendo/api/shipments_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#batch_send_shipments(org_id, batch_send_shipments_request, opts = {}) ⇒ BatchSendShipments200Response
Batch send shipments Book multiple pending/error shipments with their carriers in one request.
-
#batch_send_shipments_with_http_info(org_id, batch_send_shipments_request, opts = {}) ⇒ Array<(BatchSendShipments200Response, Integer, Hash)>
Batch send shipments Book multiple pending/error shipments with their carriers in one request.
-
#batch_split_shipment(org_id, shipment_id, batch_split_shipment_request, opts = {}) ⇒ BatchSplitShipment201Response
Batch split shipment Split a parcel into multiple new shipments with per-line quantities in a single atomic operation.
-
#batch_split_shipment_with_http_info(org_id, shipment_id, batch_split_shipment_request, opts = {}) ⇒ Array<(BatchSplitShipment201Response, Integer, Hash)>
Batch split shipment Split a parcel into multiple new shipments with per-line quantities in a single atomic operation.
-
#create_return_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Create return shipment Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver.
-
#create_return_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Create return shipment Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver.
-
#create_shipment(org_id, create_shipment_request, opts = {}) ⇒ CreateShipment201Response
Create shipment Create a new shipment for an organization.
-
#create_shipment_with_http_info(org_id, create_shipment_request, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Create shipment Create a new shipment for an organization.
-
#delete_shipment(org_id, shipment_id, opts = {}) ⇒ RevokeApiToken200Response
Delete shipment Delete a shipment.
-
#delete_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(RevokeApiToken200Response, Integer, Hash)>
Delete shipment Delete a shipment.
-
#get_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Get shipment Retrieve a single shipment by its ID, including parcels, parties, documents and activity.
-
#get_shipment_document_content(org_id, shipment_id, document_id, opts = {}) ⇒ nil
Download shipment document Streams a shipment document or label file from storage.
-
#get_shipment_document_content_with_http_info(org_id, shipment_id, document_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Download shipment document Streams a shipment document or label file from storage.
-
#get_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Get shipment Retrieve a single shipment by its ID, including parcels, parties, documents and activity.
-
#initialize(api_client = ApiClient.default) ⇒ ShipmentsApi
constructor
A new instance of ShipmentsApi.
-
#list_shipments(org_id, opts = {}) ⇒ ListShipments200Response
List shipments List all shipments for an organization, paginated and ordered by newest first.
-
#list_shipments_with_http_info(org_id, opts = {}) ⇒ Array<(ListShipments200Response, Integer, Hash)>
List shipments List all shipments for an organization, paginated and ordered by newest first.
-
#send_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Send shipment Book a pending or error shipment with the carrier, generating labels and tracking.
-
#send_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Send shipment Book a pending or error shipment with the carrier, generating labels and tracking.
-
#split_shipment(org_id, shipment_id, split_shipment_request, opts = {}) ⇒ SplitShipment201Response
Split shipment Move order lines from a parcel into a new shipment.
-
#split_shipment_parcel(org_id, shipment_id, split_shipment_parcel_request, opts = {}) ⇒ SplitShipmentParcel200Response
Split parcels Redistribute order lines across parcels within a shipment, moving lines between parcels and creating new ones.
-
#split_shipment_parcel_with_http_info(org_id, shipment_id, split_shipment_parcel_request, opts = {}) ⇒ Array<(SplitShipmentParcel200Response, Integer, Hash)>
Split parcels Redistribute order lines across parcels within a shipment, moving lines between parcels and creating new ones.
-
#split_shipment_with_http_info(org_id, shipment_id, split_shipment_request, opts = {}) ⇒ Array<(SplitShipment201Response, Integer, Hash)>
Split shipment Move order lines from a parcel into a new shipment.
-
#track_shipment(org_id, shipment_id, opts = {}) ⇒ TrackShipment200Response
Get shipment tracking Retrieve the tracking timeline for a shipment, including current status and all carrier events.
-
#track_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(TrackShipment200Response, Integer, Hash)>
Get shipment tracking Retrieve the tracking timeline for a shipment, including current status and all carrier events.
-
#update_shipment(org_id, shipment_id, update_shipment_request, opts = {}) ⇒ CreateShipment201Response
Update shipment Update an existing shipment.
-
#update_shipment_with_http_info(org_id, shipment_id, update_shipment_request, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Update shipment Update an existing shipment.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ShipmentsApi
Returns a new instance of ShipmentsApi.
19 20 21 |
# File 'lib/zippendo/api/shipments_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zippendo/api/shipments_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#batch_send_shipments(org_id, batch_send_shipments_request, opts = {}) ⇒ BatchSendShipments200Response
Batch send shipments
Book multiple pending/error shipments with their carriers in one request. Each shipment is processed independently and reported in results; a failure on one shipment never aborts the others. Use it to send every shipment on an order at once.
28 29 30 31 |
# File 'lib/zippendo/api/shipments_api.rb', line 28 def batch_send_shipments(org_id, batch_send_shipments_request, opts = {}) data, _status_code, _headers = batch_send_shipments_with_http_info(org_id, batch_send_shipments_request, opts) data end |
#batch_send_shipments_with_http_info(org_id, batch_send_shipments_request, opts = {}) ⇒ Array<(BatchSendShipments200Response, Integer, Hash)>
Batch send shipments Book multiple pending/error shipments with their carriers in one request. Each shipment is processed independently and reported in `results`; a failure on one shipment never aborts the others. Use it to send every shipment on an order at once.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/zippendo/api/shipments_api.rb', line 39 def batch_send_shipments_with_http_info(org_id, batch_send_shipments_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.batch_send_shipments ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.batch_send_shipments" end # verify the required parameter 'batch_send_shipments_request' is set if @api_client.config.client_side_validation && batch_send_shipments_request.nil? fail ArgumentError, "Missing the required parameter 'batch_send_shipments_request' when calling ShipmentsApi.batch_send_shipments" end # resource path local_var_path = '/orgs/{orgId}/shipments/batch-send'.sub('{orgId}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_send_shipments_request) # return_type return_type = opts[:debug_return_type] || 'BatchSendShipments200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.batch_send_shipments", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#batch_send_shipments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#batch_split_shipment(org_id, shipment_id, batch_split_shipment_request, opts = {}) ⇒ BatchSplitShipment201Response
Batch split shipment Split a parcel into multiple new shipments with per-line quantities in a single atomic operation. Only draft or pending shipments can be split.
103 104 105 106 |
# File 'lib/zippendo/api/shipments_api.rb', line 103 def batch_split_shipment(org_id, shipment_id, batch_split_shipment_request, opts = {}) data, _status_code, _headers = batch_split_shipment_with_http_info(org_id, shipment_id, batch_split_shipment_request, opts) data end |
#batch_split_shipment_with_http_info(org_id, shipment_id, batch_split_shipment_request, opts = {}) ⇒ Array<(BatchSplitShipment201Response, Integer, Hash)>
Batch split shipment Split a parcel into multiple new shipments with per-line quantities in a single atomic operation. Only draft or pending shipments can be split.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/zippendo/api/shipments_api.rb', line 115 def batch_split_shipment_with_http_info(org_id, shipment_id, batch_split_shipment_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.batch_split_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.batch_split_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.batch_split_shipment" end # verify the required parameter 'batch_split_shipment_request' is set if @api_client.config.client_side_validation && batch_split_shipment_request.nil? fail ArgumentError, "Missing the required parameter 'batch_split_shipment_request' when calling ShipmentsApi.batch_split_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/batch-split-shipment'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_split_shipment_request) # return_type return_type = opts[:debug_return_type] || 'BatchSplitShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.batch_split_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#batch_split_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_return_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Create return shipment Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule.
182 183 184 185 |
# File 'lib/zippendo/api/shipments_api.rb', line 182 def create_return_shipment(org_id, shipment_id, opts = {}) data, _status_code, _headers = create_return_shipment_with_http_info(org_id, shipment_id, opts) data end |
#create_return_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Create return shipment Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/zippendo/api/shipments_api.rb', line 193 def create_return_shipment_with_http_info(org_id, shipment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.create_return_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.create_return_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.create_return_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/create-return'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.create_return_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#create_return_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_shipment(org_id, create_shipment_request, opts = {}) ⇒ CreateShipment201Response
Create shipment Create a new shipment for an organization. When orderId is provided, parties and parcels are derived from the order.
251 252 253 254 |
# File 'lib/zippendo/api/shipments_api.rb', line 251 def create_shipment(org_id, create_shipment_request, opts = {}) data, _status_code, _headers = create_shipment_with_http_info(org_id, create_shipment_request, opts) data end |
#create_shipment_with_http_info(org_id, create_shipment_request, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Create shipment Create a new shipment for an organization. When orderId is provided, parties and parcels are derived from the order.
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/zippendo/api/shipments_api.rb', line 262 def create_shipment_with_http_info(org_id, create_shipment_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.create_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.create_shipment" end # verify the required parameter 'create_shipment_request' is set if @api_client.config.client_side_validation && create_shipment_request.nil? fail ArgumentError, "Missing the required parameter 'create_shipment_request' when calling ShipmentsApi.create_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments'.sub('{orgId}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_shipment_request) # return_type return_type = opts[:debug_return_type] || 'CreateShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.create_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#create_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_shipment(org_id, shipment_id, opts = {}) ⇒ RevokeApiToken200Response
Delete shipment Delete a shipment. Only shipments in pending status can be deleted.
325 326 327 328 |
# File 'lib/zippendo/api/shipments_api.rb', line 325 def delete_shipment(org_id, shipment_id, opts = {}) data, _status_code, _headers = delete_shipment_with_http_info(org_id, shipment_id, opts) data end |
#delete_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(RevokeApiToken200Response, Integer, Hash)>
Delete shipment Delete a shipment. Only shipments in pending status can be deleted.
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/zippendo/api/shipments_api.rb', line 336 def delete_shipment_with_http_info(org_id, shipment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.delete_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.delete_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.delete_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RevokeApiToken200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.delete_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#delete_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Get shipment Retrieve a single shipment by its ID, including parcels, parties, documents and activity.
394 395 396 397 |
# File 'lib/zippendo/api/shipments_api.rb', line 394 def get_shipment(org_id, shipment_id, opts = {}) data, _status_code, _headers = get_shipment_with_http_info(org_id, shipment_id, opts) data end |
#get_shipment_document_content(org_id, shipment_id, document_id, opts = {}) ⇒ nil
Download shipment document Streams a shipment document or label file from storage.
466 467 468 469 |
# File 'lib/zippendo/api/shipments_api.rb', line 466 def get_shipment_document_content(org_id, shipment_id, document_id, opts = {}) get_shipment_document_content_with_http_info(org_id, shipment_id, document_id, opts) nil end |
#get_shipment_document_content_with_http_info(org_id, shipment_id, document_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Download shipment document Streams a shipment document or label file from storage.
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/zippendo/api/shipments_api.rb', line 480 def get_shipment_document_content_with_http_info(org_id, shipment_id, document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.get_shipment_document_content ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.get_shipment_document_content" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.get_shipment_document_content" end # verify the required parameter 'document_id' is set if @api_client.config.client_side_validation && document_id.nil? fail ArgumentError, "Missing the required parameter 'document_id' when calling ShipmentsApi.get_shipment_document_content" end allowable_values = ["inline", "attachment"] if @api_client.config.client_side_validation && opts[:'disposition'] && !allowable_values.include?(opts[:'disposition']) fail ArgumentError, "invalid value for \"disposition\", must be one of #{allowable_values}" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/documents/{documentId}/content'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)).sub('{documentId}', CGI.escape(document_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'disposition'] = opts[:'disposition'] if !opts[:'disposition'].nil? query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil? # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.get_shipment_document_content", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#get_shipment_document_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Get shipment Retrieve a single shipment by its ID, including parcels, parties, documents and activity.
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/zippendo/api/shipments_api.rb', line 405 def get_shipment_with_http_info(org_id, shipment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.get_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.get_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.get_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.get_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#get_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_shipments(org_id, opts = {}) ⇒ ListShipments200Response
List shipments List all shipments for an organization, paginated and ordered by newest first.
547 548 549 550 |
# File 'lib/zippendo/api/shipments_api.rb', line 547 def list_shipments(org_id, opts = {}) data, _status_code, _headers = list_shipments_with_http_info(org_id, opts) data end |
#list_shipments_with_http_info(org_id, opts = {}) ⇒ Array<(ListShipments200Response, Integer, Hash)>
List shipments List all shipments for an organization, paginated and ordered by newest first.
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
# File 'lib/zippendo/api/shipments_api.rb', line 559 def list_shipments_with_http_info(org_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.list_shipments ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.list_shipments" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 9007199254740991 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ShipmentsApi.list_shipments, must be smaller than or equal to 9007199254740991.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ShipmentsApi.list_shipments, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ShipmentsApi.list_shipments, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ShipmentsApi.list_shipments, must be greater than or equal to 1.' end # resource path local_var_path = '/orgs/{orgId}/shipments'.sub('{orgId}', CGI.escape(org_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListShipments200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.list_shipments", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#list_shipments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_shipment(org_id, shipment_id, opts = {}) ⇒ CreateShipment201Response
Send shipment Book a pending or error shipment with the carrier, generating labels and tracking. Returns 422 with carrier errors if booking fails.
631 632 633 634 |
# File 'lib/zippendo/api/shipments_api.rb', line 631 def send_shipment(org_id, shipment_id, opts = {}) data, _status_code, _headers = send_shipment_with_http_info(org_id, shipment_id, opts) data end |
#send_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Send shipment Book a pending or error shipment with the carrier, generating labels and tracking. Returns 422 with carrier errors if booking fails.
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
# File 'lib/zippendo/api/shipments_api.rb', line 642 def send_shipment_with_http_info(org_id, shipment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.send_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.send_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.send_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/send'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.send_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#send_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#split_shipment(org_id, shipment_id, split_shipment_request, opts = {}) ⇒ SplitShipment201Response
Split shipment Move order lines from a parcel into a new shipment. Only draft or pending shipments can be split.
701 702 703 704 |
# File 'lib/zippendo/api/shipments_api.rb', line 701 def split_shipment(org_id, shipment_id, split_shipment_request, opts = {}) data, _status_code, _headers = split_shipment_with_http_info(org_id, shipment_id, split_shipment_request, opts) data end |
#split_shipment_parcel(org_id, shipment_id, split_shipment_parcel_request, opts = {}) ⇒ SplitShipmentParcel200Response
Split parcels Redistribute order lines across parcels within a shipment, moving lines between parcels and creating new ones. Only draft, pending or error shipments can be modified.
781 782 783 784 |
# File 'lib/zippendo/api/shipments_api.rb', line 781 def split_shipment_parcel(org_id, shipment_id, split_shipment_parcel_request, opts = {}) data, _status_code, _headers = split_shipment_parcel_with_http_info(org_id, shipment_id, split_shipment_parcel_request, opts) data end |
#split_shipment_parcel_with_http_info(org_id, shipment_id, split_shipment_parcel_request, opts = {}) ⇒ Array<(SplitShipmentParcel200Response, Integer, Hash)>
Split parcels Redistribute order lines across parcels within a shipment, moving lines between parcels and creating new ones. Only draft, pending or error shipments can be modified.
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 |
# File 'lib/zippendo/api/shipments_api.rb', line 793 def split_shipment_parcel_with_http_info(org_id, shipment_id, split_shipment_parcel_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.split_shipment_parcel ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.split_shipment_parcel" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.split_shipment_parcel" end # verify the required parameter 'split_shipment_parcel_request' is set if @api_client.config.client_side_validation && split_shipment_parcel_request.nil? fail ArgumentError, "Missing the required parameter 'split_shipment_parcel_request' when calling ShipmentsApi.split_shipment_parcel" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/split-parcel'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(split_shipment_parcel_request) # return_type return_type = opts[:debug_return_type] || 'SplitShipmentParcel200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.split_shipment_parcel", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#split_shipment_parcel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#split_shipment_with_http_info(org_id, shipment_id, split_shipment_request, opts = {}) ⇒ Array<(SplitShipment201Response, Integer, Hash)>
Split shipment Move order lines from a parcel into a new shipment. Only draft or pending shipments can be split.
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 |
# File 'lib/zippendo/api/shipments_api.rb', line 713 def split_shipment_with_http_info(org_id, shipment_id, split_shipment_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.split_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.split_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.split_shipment" end # verify the required parameter 'split_shipment_request' is set if @api_client.config.client_side_validation && split_shipment_request.nil? fail ArgumentError, "Missing the required parameter 'split_shipment_request' when calling ShipmentsApi.split_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/split-shipment'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(split_shipment_request) # return_type return_type = opts[:debug_return_type] || 'SplitShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.split_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#split_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#track_shipment(org_id, shipment_id, opts = {}) ⇒ TrackShipment200Response
Get shipment tracking Retrieve the tracking timeline for a shipment, including current status and all carrier events.
860 861 862 863 |
# File 'lib/zippendo/api/shipments_api.rb', line 860 def track_shipment(org_id, shipment_id, opts = {}) data, _status_code, _headers = track_shipment_with_http_info(org_id, shipment_id, opts) data end |
#track_shipment_with_http_info(org_id, shipment_id, opts = {}) ⇒ Array<(TrackShipment200Response, Integer, Hash)>
Get shipment tracking Retrieve the tracking timeline for a shipment, including current status and all carrier events.
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
# File 'lib/zippendo/api/shipments_api.rb', line 871 def track_shipment_with_http_info(org_id, shipment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.track_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.track_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.track_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}/tracking'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TrackShipment200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.track_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#track_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_shipment(org_id, shipment_id, update_shipment_request, opts = {}) ⇒ CreateShipment201Response
Update shipment Update an existing shipment. Only draft, pending or error shipments can be updated; an applied shipping rule overrides carrier settings and sender party.
930 931 932 933 |
# File 'lib/zippendo/api/shipments_api.rb', line 930 def update_shipment(org_id, shipment_id, update_shipment_request, opts = {}) data, _status_code, _headers = update_shipment_with_http_info(org_id, shipment_id, update_shipment_request, opts) data end |
#update_shipment_with_http_info(org_id, shipment_id, update_shipment_request, opts = {}) ⇒ Array<(CreateShipment201Response, Integer, Hash)>
Update shipment Update an existing shipment. Only draft, pending or error shipments can be updated; an applied shipping rule overrides carrier settings and sender party.
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
# File 'lib/zippendo/api/shipments_api.rb', line 942 def update_shipment_with_http_info(org_id, shipment_id, update_shipment_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ShipmentsApi.update_shipment ...' end # verify the required parameter 'org_id' is set if @api_client.config.client_side_validation && org_id.nil? fail ArgumentError, "Missing the required parameter 'org_id' when calling ShipmentsApi.update_shipment" end # verify the required parameter 'shipment_id' is set if @api_client.config.client_side_validation && shipment_id.nil? fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.update_shipment" end # verify the required parameter 'update_shipment_request' is set if @api_client.config.client_side_validation && update_shipment_request.nil? fail ArgumentError, "Missing the required parameter 'update_shipment_request' when calling ShipmentsApi.update_shipment" end # resource path local_var_path = '/orgs/{orgId}/shipments/{shipmentId}'.sub('{orgId}', CGI.escape(org_id.to_s)).sub('{shipmentId}', CGI.escape(shipment_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_shipment_request) # return_type return_type = opts[:debug_return_type] || 'CreateShipment201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ShipmentsApi.update_shipment", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ShipmentsApi#update_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |