Class: AmznSpApi::EasyShipApiModel::EasyShipApi
- Inherits:
-
Object
- Object
- AmznSpApi::EasyShipApiModel::EasyShipApi
- Defined in:
- lib/easy_ship_api_model/api/easy_ship_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_scheduled_package(body, opts = {}) ⇒ Package
Schedules an Easy Ship order and returns the scheduled package information.
-
#create_scheduled_package_bulk(body, opts = {}) ⇒ CreateScheduledPackagesResponse
This operation automatically schedules a time slot for all the ‘amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).
-
#create_scheduled_package_bulk_with_http_info(body, opts = {}) ⇒ Array<(CreateScheduledPackagesResponse, Integer, Hash)>
This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).
-
#create_scheduled_package_with_http_info(body, opts = {}) ⇒ Array<(Package, Integer, Hash)>
Schedules an Easy Ship order and returns the scheduled package information.
-
#get_scheduled_package(amazon_order_id, marketplace_id, opts = {}) ⇒ Package
Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.
-
#get_scheduled_package_with_http_info(amazon_order_id, marketplace_id, opts = {}) ⇒ Array<(Package, Integer, Hash)>
Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status.
-
#initialize(api_client = ApiClient.default) ⇒ EasyShipApi
constructor
A new instance of EasyShipApi.
-
#list_handover_slots(opts = {}) ⇒ ListHandoverSlotsResponse
Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.
-
#list_handover_slots_with_http_info(opts = {}) ⇒ Array<(ListHandoverSlotsResponse, Integer, Hash)>
Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies.
-
#update_scheduled_packages(opts = {}) ⇒ Packages
Updates the time slot for handing over the package indicated by the specified ‘scheduledPackageId`.
-
#update_scheduled_packages_with_http_info(opts = {}) ⇒ Array<(Packages, Integer, Hash)>
Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ EasyShipApi
Returns a new instance of EasyShipApi.
14 15 16 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 14 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
12 13 14 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 12 def api_client @api_client end |
Instance Method Details
#create_scheduled_package(body, opts = {}) ⇒ Package
Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling ‘createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, Invoice, and Warranty columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
22 23 24 25 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 22 def create_scheduled_package(body, opts = {}) data, _status_code, _headers = create_scheduled_package_with_http_info(body, opts) data end |
#create_scheduled_package_bulk(body, opts = {}) ⇒ CreateScheduledPackagesResponse
This operation automatically schedules a time slot for all the ‘amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, i.e., if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label’s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn’t be scheduled, then Amazon adds the ‘rejectedOrders` list into the response, which contains an entry for each order we couldn’t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
74 75 76 77 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 74 def create_scheduled_package_bulk(body, opts = {}) data, _status_code, _headers = create_scheduled_package_bulk_with_http_info(body, opts) data end |
#create_scheduled_package_bulk_with_http_info(body, opts = {}) ⇒ Array<(CreateScheduledPackagesResponse, Integer, Hash)>
This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, i.e., if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label's file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn't be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn't process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 83 def create_scheduled_package_bulk_with_http_info(body, opts = {}) @api_client.config.logger.debug 'Calling API: EasyShipApi.create_scheduled_package_bulk ...' if @api_client.config.debugging # verify the required parameter 'body' is set raise ArgumentError, "Missing the required parameter 'body' when calling EasyShipApi.create_scheduled_package_bulk" if @api_client.config.client_side_validation && body.nil? # resource path local_var_path = '/easyShip/2022-03-23/packages/bulk' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'CreateScheduledPackagesResponse' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type) @api_client.config.logger.debug "API called: EasyShipApi#create_scheduled_package_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |
#create_scheduled_package_with_http_info(body, opts = {}) ⇒ Array<(Package, Integer, Hash)>
Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, Invoice, and Warranty columns in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
31 32 33 34 35 36 37 38 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 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 31 def create_scheduled_package_with_http_info(body, opts = {}) @api_client.config.logger.debug 'Calling API: EasyShipApi.create_scheduled_package ...' if @api_client.config.debugging # verify the required parameter 'body' is set raise ArgumentError, "Missing the required parameter 'body' when calling EasyShipApi.create_scheduled_package" if @api_client.config.client_side_validation && body.nil? # resource path local_var_path = '/easyShip/2022-03-23/package' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) return_type = opts[:return_type] || 'Package' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type) @api_client.config.logger.debug "API called: EasyShipApi#create_scheduled_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |
#get_scheduled_package(amazon_order_id, marketplace_id, opts = {}) ⇒ Package
Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
127 128 129 130 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 127 def get_scheduled_package(amazon_order_id, marketplace_id, opts = {}) data, _status_code, _headers = get_scheduled_package_with_http_info(amazon_order_id, marketplace_id, opts) data end |
#get_scheduled_package_with_http_info(amazon_order_id, marketplace_id, opts = {}) ⇒ Array<(Package, Integer, Hash)>
Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
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 175 176 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 137 def get_scheduled_package_with_http_info(amazon_order_id, marketplace_id, opts = {}) @api_client.config.logger.debug 'Calling API: EasyShipApi.get_scheduled_package ...' if @api_client.config.debugging # verify the required parameter 'amazon_order_id' is set raise ArgumentError, "Missing the required parameter 'amazon_order_id' when calling EasyShipApi.get_scheduled_package" if @api_client.config.client_side_validation && amazon_order_id.nil? # verify the required parameter 'marketplace_id' is set raise ArgumentError, "Missing the required parameter 'marketplace_id' when calling EasyShipApi.get_scheduled_package" if @api_client.config.client_side_validation && marketplace_id.nil? # resource path local_var_path = '/easyShip/2022-03-23/package' # query parameters query_params = opts[:query_params] || {} query_params[:amazonOrderId] = amazon_order_id query_params[:marketplaceId] = marketplace_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'Package' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type) @api_client.config.logger.debug "API called: EasyShipApi#get_scheduled_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |
#list_handover_slots(opts = {}) ⇒ ListHandoverSlotsResponse
Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
182 183 184 185 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 182 def list_handover_slots(opts = {}) data, _status_code, _headers = list_handover_slots_with_http_info(opts) data end |
#list_handover_slots_with_http_info(opts = {}) ⇒ Array<(ListHandoverSlotsResponse, Integer, Hash)>
Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 191 def list_handover_slots_with_http_info(opts = {}) @api_client.config.logger.debug 'Calling API: EasyShipApi.list_handover_slots ...' if @api_client.config.debugging # resource path local_var_path = '/easyShip/2022-03-23/timeSlot' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:body]) return_type = opts[:return_type] || 'ListHandoverSlotsResponse' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type) @api_client.config.logger.debug "API called: EasyShipApi#list_handover_slots\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |
#update_scheduled_packages(opts = {}) ⇒ Packages
Updates the time slot for handing over the package indicated by the specified ‘scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
231 232 233 234 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 231 def update_scheduled_packages(opts = {}) data, _status_code, _headers = update_scheduled_packages_with_http_info(opts) data end |
#update_scheduled_packages_with_http_info(opts = {}) ⇒ Array<(Packages, Integer, Hash)>
Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/easy_ship_api_model/api/easy_ship_api.rb', line 240 def update_scheduled_packages_with_http_info(opts = {}) @api_client.config.logger.debug 'Calling API: EasyShipApi.update_scheduled_packages ...' if @api_client.config.debugging # resource path local_var_path = '/easyShip/2022-03-23/package' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:body]) return_type = opts[:return_type] || 'Packages' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type) @api_client.config.logger.debug "API called: EasyShipApi#update_scheduled_packages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |