Class: Noths::OrdersApi
- Inherits:
-
Object
- Object
- Noths::OrdersApi
- Defined in:
- lib/noths/api/orders_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ OrdersApi
constructor
A new instance of OrdersApi.
-
#orders_acceptance(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) ⇒ nil
Accept an order Accept an order that is in the placed state.
-
#orders_acceptance_bulk(token, payload, opts = {}) ⇒ nil
Accept multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_acceptance_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Accept multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Accept an order Accept an order that is in the placed state.
-
#orders_decline(token, id, decline_reason, opts = {}) ⇒ nil
Decline an order Declines an order that is in the placed state.
-
#orders_decline_bulk(token, payload, opts = {}) ⇒ nil
Decline multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_decline_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_decline_with_http_info(token, id, decline_reason, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline an order Declines an order that is in the placed state.
-
#orders_dispatch_note(token, id, opts = {}) ⇒ File
Generate a dispatch note pdf or gift note pdf.
-
#orders_dispatch_note_with_http_info(token, id, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate a dispatch note pdf or gift note pdf.
-
#orders_dispatch_notes_bulk(token, payload, opts = {}) ⇒ File
Generate pdf with dispatch note for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d ‘[123, 456]’ -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>.
-
#orders_dispatch_notes_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate pdf with dispatch note for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d '[123, 456]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>.
-
#orders_dispatch_order(token, id, estimated_delivery_date, opts = {}) ⇒ nil
Dispatch an order Dispatches an order that is in an accepted state and has also had its dispatch note printed.
-
#orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Dispatch an order Dispatches an order that is in an accepted state and has also had its dispatch note printed.
-
#orders_dispatch_orders_bulk(token, payload, opts = {}) ⇒ nil
Dispatch multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_dispatch_orders_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Dispatch multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_index(token, opts = {}) ⇒ OrderIndex
Fetch orders Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
-
#orders_index_with_http_info(token, opts = {}) ⇒ Array<(OrderIndex, Fixnum, Hash)>
Fetch orders Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
-
#orders_invoice(token, id, type, opts = {}) ⇒ File
Generate a vat invoice pdf.
-
#orders_invoice_with_http_info(token, id, type, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate a vat invoice pdf.
-
#orders_order_details(token, id, opts = {}) ⇒ File
Generate an order details pdf Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>.
-
#orders_order_details_bulk(token, payload, opts = {}) ⇒ File
Generate pdf with order details for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d ‘[123, 456]’ -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>.
-
#orders_order_details_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate pdf with order details for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d '[123, 456]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>.
-
#orders_order_details_with_http_info(token, id, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate an order details pdf Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>.
-
#orders_show(token, id, opts = {}) ⇒ Order
Fetch a single Order.
-
#orders_show_with_http_info(token, id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>
Fetch a single Order.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ OrdersApi
Returns a new instance of OrdersApi.
9 10 11 |
# File 'lib/noths/api/orders_api.rb', line 9 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
7 8 9 |
# File 'lib/noths/api/orders_api.rb', line 7 def api_client @api_client end |
Instance Method Details
#orders_acceptance(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) ⇒ nil
Accept an order
Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
22 23 24 25 |
# File 'lib/noths/api/orders_api.rb', line 22 def orders_acceptance(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts) return nil end |
#orders_acceptance_bulk(token, payload, opts = {}) ⇒ nil
Accept multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn’t find the requested resource" } ] } ] </pre>
95 96 97 98 |
# File 'lib/noths/api/orders_api.rb', line 95 def orders_acceptance_bulk(token, payload, opts = {}) orders_acceptance_bulk_with_http_info(token, payload, opts) return nil end |
#orders_acceptance_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Accept multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn't find the requested resource" } ] } ] </pre>
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/noths/api/orders_api.rb', line 106 def orders_acceptance_bulk_with_http_info(token, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance_bulk ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_acceptance_bulk" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_acceptance_bulk" end # resource path local_var_path = "/api/v1/orders/accept" # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_acceptance_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Accept an order
Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/noths/api/orders_api.rb', line 36 def orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_acceptance" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_acceptance" end # verify the required parameter 'estimated_delivery_date' is set if @api_client.config.client_side_validation && estimated_delivery_date.nil? fail ArgumentError, "Missing the required parameter 'estimated_delivery_date' when calling OrdersApi.orders_acceptance" end # verify the required parameter 'estimated_dispatch_at' is set if @api_client.config.client_side_validation && estimated_dispatch_at.nil? fail ArgumentError, "Missing the required parameter 'estimated_dispatch_at' when calling OrdersApi.orders_acceptance" end # resource path local_var_path = "/api/v1/orders/{id}/accept".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} form_params["estimated_delivery_date"] = estimated_delivery_date form_params["estimated_dispatch_at"] = estimated_dispatch_at form_params["confirmation_note"] = opts[:'confirmation_note'] if !opts[:'confirmation_note'].nil? # http body (model) post_body = nil 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_acceptance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_decline(token, id, decline_reason, opts = {}) ⇒ nil
Decline an order Declines an order that is in the placed state
155 156 157 158 |
# File 'lib/noths/api/orders_api.rb', line 155 def orders_decline(token, id, decline_reason, opts = {}) orders_decline_with_http_info(token, id, decline_reason, opts) return nil end |
#orders_decline_bulk(token, payload, opts = {}) ⇒ nil
Decline multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn’t find the requested resource" } ] } ] </pre>
220 221 222 223 |
# File 'lib/noths/api/orders_api.rb', line 220 def orders_decline_bulk(token, payload, opts = {}) orders_decline_bulk_with_http_info(token, payload, opts) return nil end |
#orders_decline_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn't find the requested resource" } ] } ] </pre>
231 232 233 234 235 236 237 238 239 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 |
# File 'lib/noths/api/orders_api.rb', line 231 def orders_decline_bulk_with_http_info(token, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_decline_bulk ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_decline_bulk" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_decline_bulk" end # resource path local_var_path = "/api/v1/orders/decline" # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_decline_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_decline_with_http_info(token, id, decline_reason, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline an order Declines an order that is in the placed state
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/noths/api/orders_api.rb', line 167 def orders_decline_with_http_info(token, id, decline_reason, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_decline ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_decline" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_decline" end # verify the required parameter 'decline_reason' is set if @api_client.config.client_side_validation && decline_reason.nil? fail ArgumentError, "Missing the required parameter 'decline_reason' when calling OrdersApi.orders_decline" end # resource path local_var_path = "/api/v1/orders/{id}/decline".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} form_params["decline_reason"] = decline_reason # http body (model) post_body = nil 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_decline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_dispatch_note(token, id, opts = {}) ⇒ File
Generate a dispatch note pdf or gift note pdf. Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.<p/>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
280 281 282 283 |
# File 'lib/noths/api/orders_api.rb', line 280 def orders_dispatch_note(token, id, opts = {}) data, _status_code, _headers = orders_dispatch_note_with_http_info(token, id, opts) return data end |
#orders_dispatch_note_with_http_info(token, id, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate a dispatch note pdf or gift note pdf. Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.<p/>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
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 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/noths/api/orders_api.rb', line 292 def orders_dispatch_note_with_http_info(token, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_note ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_note" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_note" end if @api_client.config.client_side_validation && opts[:'force_type'] && !['regular'].include?(opts[:'force_type']) fail ArgumentError, 'invalid value for "force_type", must be one of regular' end # resource path local_var_path = "/api/v1/orders/{id}/dispatch_note".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token query_params[:'force_type'] = normalize(opts[:'force_type']) if !opts[:'force_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_dispatch_notes_bulk(token, payload, opts = {}) ⇒ File
Generate pdf with dispatch note for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d ‘[123, 456]’ -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>
345 346 347 348 |
# File 'lib/noths/api/orders_api.rb', line 345 def orders_dispatch_notes_bulk(token, payload, opts = {}) data, _status_code, _headers = orders_dispatch_notes_bulk_with_http_info(token, payload, opts) return data end |
#orders_dispatch_notes_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate pdf with dispatch note for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d '[123, 456]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>
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 387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/noths/api/orders_api.rb', line 356 def orders_dispatch_notes_bulk_with_http_info(token, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_notes_bulk ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_notes_bulk" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_notes_bulk" end # resource path local_var_path = "/api/v1/orders/dispatch_notes" # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_notes_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_dispatch_order(token, id, estimated_delivery_date, opts = {}) ⇒ nil
Dispatch an order Dispatches an order that is in an accepted state and has also had its dispatch note printed
412 413 414 415 |
# File 'lib/noths/api/orders_api.rb', line 412 def orders_dispatch_order(token, id, estimated_delivery_date, opts = {}) orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts) return nil end |
#orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Dispatch an order Dispatches an order that is in an accepted state and has also had its dispatch note printed
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 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/noths/api/orders_api.rb', line 428 def orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_order ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_order" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_order" end # verify the required parameter 'estimated_delivery_date' is set if @api_client.config.client_side_validation && estimated_delivery_date.nil? fail ArgumentError, "Missing the required parameter 'estimated_delivery_date' when calling OrdersApi.orders_dispatch_order" end # resource path local_var_path = "/api/v1/orders/{id}/dispatch".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} form_params["estimated_delivery_date"] = estimated_delivery_date form_params["resolve_enquiry"] = opts[:'resolve_enquiry'] if !opts[:'resolve_enquiry'].nil? form_params["tracking_number"] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil? form_params["parcel_tracking_url"] = opts[:'parcel_tracking_url'] if !opts[:'parcel_tracking_url'].nil? form_params["ignore_unresolved_enquiries"] = opts[:'ignore_unresolved_enquiries'] if !opts[:'ignore_unresolved_enquiries'].nil? # http body (model) post_body = nil 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_dispatch_orders_bulk(token, payload, opts = {}) ⇒ nil
Dispatch multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn’t find the requested resource" } ] } ] </pre>
486 487 488 489 |
# File 'lib/noths/api/orders_api.rb', line 486 def orders_dispatch_orders_bulk(token, payload, opts = {}) orders_dispatch_orders_bulk_with_http_info(token, payload, opts) return nil end |
#orders_dispatch_orders_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Dispatch multiple orders Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { "id": 12, "status": 200, "errors": [] }, { "id": 22, "status": 404, "errors": [ { "code": "RESOURCE_NOT_FOUND", "title": "Couldn't find the requested resource" } ] } ] </pre>
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 539 |
# File 'lib/noths/api/orders_api.rb', line 498 def orders_dispatch_orders_bulk_with_http_info(token, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_orders_bulk ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_orders_bulk" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_orders_bulk" end # resource path local_var_path = "/api/v1/orders/dispatch" # query parameters query_params = {} query_params[:'token'] = token query_params[:'ignore_unresolved_enquiries'] = normalize(opts[:'ignore_unresolved_enquiries']) if !opts[:'ignore_unresolved_enquiries'].nil? # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_orders_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_index(token, opts = {}) ⇒ OrderIndex
Fetch orders Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
569 570 571 572 |
# File 'lib/noths/api/orders_api.rb', line 569 def orders_index(token, opts = {}) data, _status_code, _headers = orders_index_with_http_info(token, opts) return data end |
#orders_index_with_http_info(token, opts = {}) ⇒ Array<(OrderIndex, Fixnum, Hash)>
Fetch orders Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 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 |
# File 'lib/noths/api/orders_api.rb', line 602 def orders_index_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_index ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_index" end if @api_client.config.client_side_validation && opts[:'delivery_service_code'] && !['EXPRESS_12', 'EXPRESS_24', 'EXPRESS_48', 'FREE', 'SATURDAY', 'STANDARD', 'STANDARD_COURIER'].include?(opts[:'delivery_service_code']) fail ArgumentError, 'invalid value for "delivery_service_code", must be one of EXPRESS_12, EXPRESS_24, EXPRESS_48, FREE, SATURDAY, STANDARD, STANDARD_COURIER' end if @api_client.config.client_side_validation && opts[:'dir'] && !['asc', 'desc'].include?(opts[:'dir']) fail ArgumentError, 'invalid value for "dir", must be one of asc, desc' end if @api_client.config.client_side_validation && opts[:'enquiry_state'] && !['opened', 'acknowledged', 'overdue', 'resolved', 'unresolved'].include?(opts[:'enquiry_state']) fail ArgumentError, 'invalid value for "enquiry_state", must be one of opened, acknowledged, overdue, resolved, unresolved' end if @api_client.config.client_side_validation && opts[:'sort'] && !['accepted_at', 'confirm_by', 'customer_email', 'customer_expected_delivery_date', 'customer_name', 'declined_at', 'delivery_recipient_name', 'delivery_service_code', 'dispatch_note_viewed', 'dispatched_at', 'enquiry_state', 'estimated_delivery_date', 'estimated_dispatch_at', 'expired_at', 'gift', 'international', 'listing_total_gross_value', 'partner_name', 'partner_shortcode', 'placed_at', 'state'].include?(opts[:'sort']) fail ArgumentError, 'invalid value for "sort", must be one of accepted_at, confirm_by, customer_email, customer_expected_delivery_date, customer_name, declined_at, delivery_recipient_name, delivery_service_code, dispatch_note_viewed, dispatched_at, enquiry_state, estimated_delivery_date, estimated_dispatch_at, expired_at, gift, international, listing_total_gross_value, partner_name, partner_shortcode, placed_at, state' end # resource path local_var_path = "/api/v1/orders" # query parameters query_params = {} query_params[:'token'] = token query_params[:'customer_expected_delivery_date[from]'] = normalize(opts[:'customer_expected_delivery_date_from']) if !opts[:'customer_expected_delivery_date_from'].nil? query_params[:'customer_expected_delivery_date[to]'] = normalize(opts[:'customer_expected_delivery_date_to']) if !opts[:'customer_expected_delivery_date_to'].nil? query_params[:'delivery_service_code'] = normalize(opts[:'delivery_service_code']) if !opts[:'delivery_service_code'].nil? query_params[:'delivery_zone_ids'] = normalize(opts[:'delivery_zone_ids']) if !opts[:'delivery_zone_ids'].nil? query_params[:'dir'] = normalize(opts[:'dir']) if !opts[:'dir'].nil? query_params[:'dispatch_note_viewed'] = normalize(opts[:'dispatch_note_viewed']) if !opts[:'dispatch_note_viewed'].nil? query_params[:'enquiry_state'] = normalize(opts[:'enquiry_state']) if !opts[:'enquiry_state'].nil? query_params[:'estimated_delivery_date[from]'] = normalize(opts[:'estimated_delivery_date_from']) if !opts[:'estimated_delivery_date_from'].nil? query_params[:'estimated_delivery_date[to]'] = normalize(opts[:'estimated_delivery_date_to']) if !opts[:'estimated_delivery_date_to'].nil? query_params[:'estimated_dispatch_at[from]'] = normalize(opts[:'estimated_dispatch_at_from']) if !opts[:'estimated_dispatch_at_from'].nil? query_params[:'estimated_dispatch_at[to]'] = normalize(opts[:'estimated_dispatch_at_to']) if !opts[:'estimated_dispatch_at_to'].nil? query_params[:'updated_at[from]'] = normalize(opts[:'updated_at_from']) if !opts[:'updated_at_from'].nil? query_params[:'updated_at[to]'] = normalize(opts[:'updated_at_to']) if !opts[:'updated_at_to'].nil? query_params[:'gift'] = normalize(opts[:'gift']) if !opts[:'gift'].nil? query_params[:'unresolved_enquiry'] = normalize(opts[:'unresolved_enquiry']) if !opts[:'unresolved_enquiry'].nil? query_params[:'ids'] = normalize(opts[:'ids']) if !opts[:'ids'].nil? query_params[:'offset'] = normalize(opts[:'offset']) if !opts[:'offset'].nil? query_params[:'per_page'] = normalize(opts[:'per_page']) if !opts[:'per_page'].nil? query_params[:'product_ids'] = normalize(opts[:'product_ids']) if !opts[:'product_ids'].nil? query_params[:'query'] = normalize(opts[:'query']) if !opts[:'query'].nil? query_params[:'repeat_customer'] = normalize(opts[:'repeat_customer']) if !opts[:'repeat_customer'].nil? query_params[:'sort'] = normalize(opts[:'sort']) if !opts[:'sort'].nil? query_params[:'state'] = normalize(@api_client.build_collection_param(opts[:'state'], :csv)) if !opts[:'state'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil 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 => 'OrderIndex') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_invoice(token, id, type, opts = {}) ⇒ File
Generate a vat invoice pdf. <p>Invoices are currently only applicable for the UK site</p>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
681 682 683 684 |
# File 'lib/noths/api/orders_api.rb', line 681 def orders_invoice(token, id, type, opts = {}) data, _status_code, _headers = orders_invoice_with_http_info(token, id, type, opts) return data end |
#orders_invoice_with_http_info(token, id, type, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate a vat invoice pdf. <p>Invoices are currently only applicable for the UK site</p>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 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 |
# File 'lib/noths/api/orders_api.rb', line 693 def orders_invoice_with_http_info(token, id, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_invoice ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_invoice" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_invoice" end # verify the required parameter 'type' is set if @api_client.config.client_side_validation && type.nil? fail ArgumentError, "Missing the required parameter 'type' when calling OrdersApi.orders_invoice" end # verify enum value if @api_client.config.client_side_validation && !['vat_invoice', 'additional_payment'].include?(type) fail ArgumentError, "invalid value for 'type', must be one of vat_invoice, additional_payment" end # resource path local_var_path = "/api/v1/orders/{id}/invoice".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token query_params[:'type'] = type # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_order_details(token, id, opts = {}) ⇒ File
Generate an order details pdf Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
751 752 753 754 |
# File 'lib/noths/api/orders_api.rb', line 751 def orders_order_details(token, id, opts = {}) data, _status_code, _headers = orders_order_details_with_http_info(token, id, opts) return data end |
#orders_order_details_bulk(token, payload, opts = {}) ⇒ File
Generate pdf with order details for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d ‘[123, 456]’ -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>
811 812 813 814 |
# File 'lib/noths/api/orders_api.rb', line 811 def orders_order_details_bulk(token, payload, opts = {}) data, _status_code, _headers = orders_order_details_bulk_with_http_info(token, payload, opts) return data end |
#orders_order_details_bulk_with_http_info(token, payload, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate pdf with order details for each order <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H "Content-Type: application/json" -d '[123, 456]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to "Content-Type: application/json".<p/>
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 853 854 855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/noths/api/orders_api.rb', line 822 def orders_order_details_bulk_with_http_info(token, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details_bulk ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_order_details_bulk" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_order_details_bulk" end # resource path local_var_path = "/api/v1/orders/order_details" # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_order_details_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_order_details_with_http_info(token, id, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Generate an order details pdf Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 |
# File 'lib/noths/api/orders_api.rb', line 762 def orders_order_details_with_http_info(token, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_order_details" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_order_details" end # resource path local_var_path = "/api/v1/orders/{id}/order_details".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_order_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_show(token, id, opts = {}) ⇒ Order
Fetch a single Order
874 875 876 877 |
# File 'lib/noths/api/orders_api.rb', line 874 def orders_show(token, id, opts = {}) data, _status_code, _headers = orders_show_with_http_info(token, id, opts) return data end |
#orders_show_with_http_info(token, id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>
Fetch a single Order
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 922 923 924 925 926 |
# File 'lib/noths/api/orders_api.rb', line 886 def orders_show_with_http_info(token, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OrdersApi.orders_show ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_show" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_show" end # resource path local_var_path = "/api/v1/orders/{id}".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'token'] = token query_params[:'include'] = normalize(opts[:'include']) if !opts[:'include'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil 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 => 'Order') if @api_client.config.debugging @api_client.config.logger.debug "API called: OrdersApi#orders_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |