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(id, estimated_delivery_date, estimated_dispatch_at, opts = {}) ⇒ nil
Accept an order Accept an order that is in the placed state.
-
#orders_acceptance_bulk(payload, opts = {}) ⇒ nil
Accept multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_acceptance_bulk_with_http_info(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(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(id, decline_reason, opts = {}) ⇒ nil
Decline an order Declines an order that is in the placed state.
-
#orders_decline_bulk(payload, opts = {}) ⇒ nil
Decline multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_decline_bulk_with_http_info(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(id, decline_reason, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline an order Declines an order that is in the placed state.
-
#orders_dispatch_note(id, opts = {}) ⇒ nil
Generate a dispatch note pdf or gift note pdf.
-
#orders_dispatch_note_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Generate a dispatch note pdf or gift note pdf.
-
#orders_dispatch_notes_bulk(payload, opts = {}) ⇒ nil
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(payload, opts = {}) ⇒ Array<(nil, 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(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(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(payload, opts = {}) ⇒ nil
Dispatch multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_dispatch_orders_bulk_with_http_info(payload, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Dispatch multiple orders Returns an array of hashes containing order ids and status codes.
-
#orders_index(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(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(id, type, opts = {}) ⇒ nil
Generate a vat invoice pdf.
-
#orders_invoice_with_http_info(id, type, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Generate a vat invoice pdf.
-
#orders_order_details(id, opts = {}) ⇒ nil
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(payload, opts = {}) ⇒ nil
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(payload, opts = {}) ⇒ Array<(nil, 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(id, opts = {}) ⇒ Array<(nil, 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(id, opts = {}) ⇒ Order
Fetch a single Order.
-
#orders_show_with_http_info(id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>
Fetch a single Order.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/noths/api/orders_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#orders_acceptance(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.
31 32 33 34 |
# File 'lib/noths/api/orders_api.rb', line 31 def orders_acceptance(id, estimated_delivery_date, estimated_dispatch_at, opts = {}) orders_acceptance_with_http_info(id, estimated_delivery_date, estimated_dispatch_at, opts) return nil end |
#orders_acceptance_bulk(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(payload, opts = {}) orders_acceptance_bulk_with_http_info(payload, opts) return nil end |
#orders_acceptance_bulk_with_http_info(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>
105 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 |
# File 'lib/noths/api/orders_api.rb', line 105 def orders_acceptance_bulk_with_http_info(payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['token'] 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(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.
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 |
# File 'lib/noths/api/orders_api.rb', line 44 def orders_acceptance_with_http_info(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 '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 = {} # header parameters header_params = {} # 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 = ['token'] 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(id, decline_reason, opts = {}) ⇒ nil
Decline an order Declines an order that is in the placed state
146 147 148 149 |
# File 'lib/noths/api/orders_api.rb', line 146 def orders_decline(id, decline_reason, opts = {}) orders_decline_with_http_info(id, decline_reason, opts) return nil end |
#orders_decline_bulk(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>
202 203 204 205 |
# File 'lib/noths/api/orders_api.rb', line 202 def orders_decline_bulk(payload, opts = {}) orders_decline_bulk_with_http_info(payload, opts) return nil end |
#orders_decline_bulk_with_http_info(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>
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 244 245 |
# File 'lib/noths/api/orders_api.rb', line 212 def orders_decline_bulk_with_http_info(payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['token'] 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(id, decline_reason, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Decline an order Declines an order that is in the placed state
157 158 159 160 161 162 163 164 165 166 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 |
# File 'lib/noths/api/orders_api.rb', line 157 def orders_decline_with_http_info(id, decline_reason, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} form_params["decline_reason"] = decline_reason # http body (model) post_body = nil auth_names = ['token'] 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(id, opts = {}) ⇒ nil
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>
253 254 255 256 |
# File 'lib/noths/api/orders_api.rb', line 253 def orders_dispatch_note(id, opts = {}) orders_dispatch_note_with_http_info(id, opts) return nil end |
#orders_dispatch_note_with_http_info(id, opts = {}) ⇒ Array<(nil, 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>
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 |
# File 'lib/noths/api/orders_api.rb', line 264 def orders_dispatch_note_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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[:'force_type'] = opts[:'force_type'] if !opts[:'force_type'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['token'] 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) 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(payload, opts = {}) ⇒ nil
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/>
308 309 310 311 |
# File 'lib/noths/api/orders_api.rb', line 308 def orders_dispatch_notes_bulk(payload, opts = {}) orders_dispatch_notes_bulk_with_http_info(payload, opts) return nil end |
#orders_dispatch_notes_bulk_with_http_info(payload, opts = {}) ⇒ Array<(nil, 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/>
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/noths/api/orders_api.rb', line 318 def orders_dispatch_notes_bulk_with_http_info(payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['token'] 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_notes_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#orders_dispatch_order(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
363 364 365 366 |
# File 'lib/noths/api/orders_api.rb', line 363 def orders_dispatch_order(id, estimated_delivery_date, opts = {}) orders_dispatch_order_with_http_info(id, estimated_delivery_date, opts) return nil end |
#orders_dispatch_order_with_http_info(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
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/noths/api/orders_api.rb', line 378 def orders_dispatch_order_with_http_info(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 '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 = {} # header parameters header_params = {} # 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 = ['token'] 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(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>
428 429 430 431 |
# File 'lib/noths/api/orders_api.rb', line 428 def orders_dispatch_orders_bulk(payload, opts = {}) orders_dispatch_orders_bulk_with_http_info(payload, opts) return nil end |
#orders_dispatch_orders_bulk_with_http_info(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>
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 |
# File 'lib/noths/api/orders_api.rb', line 439 def orders_dispatch_orders_bulk_with_http_info(payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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[:'ignore_unresolved_enquiries'] = opts[:'ignore_unresolved_enquiries'] if !opts[:'ignore_unresolved_enquiries'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['token'] 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(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 .
502 503 504 505 |
# File 'lib/noths/api/orders_api.rb', line 502 def orders_index(opts = {}) data, _status_code, _headers = orders_index_with_http_info(opts) return data end |
#orders_index_with_http_info(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 .
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 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 |
# File 'lib/noths/api/orders_api.rb', line 534 def orders_index_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 if @api_client.config.client_side_validation && opts[:'state'] && !['placed', 'expired', 'accepted', 'declined', 'dispatched', 'refunded', 'archived'].include?(opts[:'state']) fail ArgumentError, 'invalid value for "state", must be one of placed, expired, accepted, declined, dispatched, refunded, archived' end # resource path local_var_path = "/api/v1/orders" # query parameters query_params = {} query_params[:'customer_expected_delivery_date[from]'] = opts[:'customer_expected_delivery_date_from'] if !opts[:'customer_expected_delivery_date_from'].nil? query_params[:'customer_expected_delivery_date[to]'] = opts[:'customer_expected_delivery_date_to'] if !opts[:'customer_expected_delivery_date_to'].nil? query_params[:'delivery_service_code'] = opts[:'delivery_service_code'] if !opts[:'delivery_service_code'].nil? query_params[:'delivery_zone_ids'] = opts[:'delivery_zone_ids'] if !opts[:'delivery_zone_ids'].nil? query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil? query_params[:'dispatch_note_viewed'] = opts[:'dispatch_note_viewed'] if !opts[:'dispatch_note_viewed'].nil? query_params[:'enquiry_state'] = opts[:'enquiry_state'] if !opts[:'enquiry_state'].nil? query_params[:'estimated_delivery_date[from]'] = opts[:'estimated_delivery_date_from'] if !opts[:'estimated_delivery_date_from'].nil? query_params[:'estimated_delivery_date[to]'] = opts[:'estimated_delivery_date_to'] if !opts[:'estimated_delivery_date_to'].nil? query_params[:'estimated_dispatch_at[from]'] = opts[:'estimated_dispatch_at_from'] if !opts[:'estimated_dispatch_at_from'].nil? query_params[:'estimated_dispatch_at[to]'] = opts[:'estimated_dispatch_at_to'] if !opts[:'estimated_dispatch_at_to'].nil? query_params[:'updated_at[from]'] = opts[:'updated_at_from'] if !opts[:'updated_at_from'].nil? query_params[:'updated_at[to]'] = opts[:'updated_at_to'] if !opts[:'updated_at_to'].nil? query_params[:'gift'] = opts[:'gift'] if !opts[:'gift'].nil? query_params[:'unresolved_enquiry'] = opts[:'unresolved_enquiry'] if !opts[:'unresolved_enquiry'].nil? query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? query_params[:'product_ids'] = opts[:'product_ids'] if !opts[:'product_ids'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? query_params[:'repeat_customer'] = opts[:'repeat_customer'] if !opts[:'repeat_customer'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['token'] 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(id, type, opts = {}) ⇒ nil
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>
610 611 612 613 |
# File 'lib/noths/api/orders_api.rb', line 610 def orders_invoice(id, type, opts = {}) orders_invoice_with_http_info(id, type, opts) return nil end |
#orders_invoice_with_http_info(id, type, opts = {}) ⇒ Array<(nil, 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>
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 |
# File 'lib/noths/api/orders_api.rb', line 621 def orders_invoice_with_http_info(id, type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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[:'type'] = type # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['token'] 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) 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(id, opts = {}) ⇒ nil
Generate an order details pdf Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
670 671 672 673 |
# File 'lib/noths/api/orders_api.rb', line 670 def orders_order_details(id, opts = {}) orders_order_details_with_http_info(id, opts) return nil end |
#orders_order_details_bulk(payload, opts = {}) ⇒ nil
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/>
720 721 722 723 |
# File 'lib/noths/api/orders_api.rb', line 720 def orders_order_details_bulk(payload, opts = {}) orders_order_details_bulk_with_http_info(payload, opts) return nil end |
#orders_order_details_bulk_with_http_info(payload, opts = {}) ⇒ Array<(nil, 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/>
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 |
# File 'lib/noths/api/orders_api.rb', line 730 def orders_order_details_bulk_with_http_info(payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['token'] 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_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(id, opts = {}) ⇒ Array<(nil, 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>
680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
# File 'lib/noths/api/orders_api.rb', line 680 def orders_order_details_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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 = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['token'] 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) 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(id, opts = {}) ⇒ Order
Fetch a single Order
771 772 773 774 |
# File 'lib/noths/api/orders_api.rb', line 771 def orders_show(id, opts = {}) data, _status_code, _headers = orders_show_with_http_info(id, opts) return data end |
#orders_show_with_http_info(id, opts = {}) ⇒ Array<(Order, Fixnum, Hash)>
Fetch a single Order
782 783 784 785 786 787 788 789 790 791 792 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 |
# File 'lib/noths/api/orders_api.rb', line 782 def orders_show_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: 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[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['token'] 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 |