noths 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +149 -0
- data/Rakefile +8 -0
- data/bin/generate_gem +18 -0
- data/bin/refresh_schemas +94 -0
- data/docs/AcceptanceBulkModel.md +11 -0
- data/docs/Currency.md +11 -0
- data/docs/DeclineBulkModel.md +9 -0
- data/docs/DeliveryAddress.md +13 -0
- data/docs/DeliveryService.md +9 -0
- data/docs/DeliveryZone.md +9 -0
- data/docs/DispatchBulkModel.md +12 -0
- data/docs/DispatchNotesBulkModel.md +8 -0
- data/docs/Enquiry.md +10 -0
- data/docs/EnquiryMessage.md +8 -0
- data/docs/Error.md +9 -0
- data/docs/Financials.md +25 -0
- data/docs/FinancialsDetails.md +10 -0
- data/docs/ImageUrl.md +13 -0
- data/docs/Item.md +15 -0
- data/docs/ItemFinancials.md +13 -0
- data/docs/Link.md +10 -0
- data/docs/ManualPayment.md +11 -0
- data/docs/Money.md +9 -0
- data/docs/Order.md +53 -0
- data/docs/OrderDetail.md +9 -0
- data/docs/OrderDetailsBulkModel.md +8 -0
- data/docs/OrderIndex.md +10 -0
- data/docs/OrderRefund.md +8 -0
- data/docs/OrdersApi.md +796 -0
- data/docs/Product.md +12 -0
- data/docs/ProductOption.md +9 -0
- data/docs/RefundResponse.md +10 -0
- data/docs/RefundsApi.md +69 -0
- data/docs/SearchResultMeta.md +9 -0
- data/docs/User.md +10 -0
- data/lib/noths.rb +70 -0
- data/lib/noths/api/orders_api.rb +819 -0
- data/lib/noths/api/refunds_api.rb +88 -0
- data/lib/noths/api_client.rb +389 -0
- data/lib/noths/api_error.rb +38 -0
- data/lib/noths/configuration.rb +209 -0
- data/lib/noths/models/acceptance_bulk_model.rb +233 -0
- data/lib/noths/models/currency.rb +235 -0
- data/lib/noths/models/decline_bulk_model.rb +208 -0
- data/lib/noths/models/delivery_address.rb +263 -0
- data/lib/noths/models/delivery_service.rb +207 -0
- data/lib/noths/models/delivery_zone.rb +207 -0
- data/lib/noths/models/dispatch_bulk_model.rb +236 -0
- data/lib/noths/models/dispatch_notes_bulk_model.rb +194 -0
- data/lib/noths/models/enquiry.rb +223 -0
- data/lib/noths/models/enquiry_message.rb +193 -0
- data/lib/noths/models/error.rb +207 -0
- data/lib/noths/models/financials.rb +433 -0
- data/lib/noths/models/financials_details.rb +221 -0
- data/lib/noths/models/image_url.rb +263 -0
- data/lib/noths/models/item.rb +293 -0
- data/lib/noths/models/item_financials.rb +263 -0
- data/lib/noths/models/link.rb +222 -0
- data/lib/noths/models/manual_payment.rb +235 -0
- data/lib/noths/models/money.rb +207 -0
- data/lib/noths/models/order.rb +812 -0
- data/lib/noths/models/order_detail.rb +207 -0
- data/lib/noths/models/order_details_bulk_model.rb +194 -0
- data/lib/noths/models/order_index.rb +225 -0
- data/lib/noths/models/order_refund.rb +193 -0
- data/lib/noths/models/product.rb +249 -0
- data/lib/noths/models/product_option.rb +207 -0
- data/lib/noths/models/refund_response.rb +223 -0
- data/lib/noths/models/search_result_meta.rb +207 -0
- data/lib/noths/models/user.rb +221 -0
- data/lib/noths/version.rb +15 -0
- data/noths.gemspec +45 -0
- data/schemas/api-docs.json +26 -0
- data/schemas/orders.json +2013 -0
- data/schemas/refunds.json +128 -0
- data/spec/api/orders_api_spec.rb +239 -0
- data/spec/api/refunds_api_spec.rb +50 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/acceptance_bulk_model_spec.rb +60 -0
- data/spec/models/currency_spec.rb +60 -0
- data/spec/models/decline_bulk_model_spec.rb +48 -0
- data/spec/models/delivery_address_spec.rb +72 -0
- data/spec/models/delivery_service_spec.rb +48 -0
- data/spec/models/delivery_zone_spec.rb +48 -0
- data/spec/models/dispatch_bulk_model_spec.rb +66 -0
- data/spec/models/dispatch_notes_bulk_model_spec.rb +42 -0
- data/spec/models/enquiry_message_spec.rb +42 -0
- data/spec/models/enquiry_spec.rb +54 -0
- data/spec/models/error_spec.rb +48 -0
- data/spec/models/financials_details_spec.rb +54 -0
- data/spec/models/financials_spec.rb +144 -0
- data/spec/models/image_url_spec.rb +72 -0
- data/spec/models/item_financials_spec.rb +72 -0
- data/spec/models/item_spec.rb +84 -0
- data/spec/models/link_spec.rb +54 -0
- data/spec/models/manual_payment_spec.rb +60 -0
- data/spec/models/money_spec.rb +48 -0
- data/spec/models/order_detail_spec.rb +48 -0
- data/spec/models/order_details_bulk_model_spec.rb +42 -0
- data/spec/models/order_index_spec.rb +54 -0
- data/spec/models/order_refund_spec.rb +42 -0
- data/spec/models/order_spec.rb +312 -0
- data/spec/models/product_option_spec.rb +48 -0
- data/spec/models/product_spec.rb +66 -0
- data/spec/models/refund_response_spec.rb +54 -0
- data/spec/models/search_result_meta_spec.rb +48 -0
- data/spec/models/user_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- data/swagger_config.json +16 -0
- metadata +370 -0
data/docs/Product.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Noths::Product
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | |
|
7
|
+
**sku** | **String** | |
|
8
|
+
**title** | **String** | |
|
9
|
+
**personalisable** | **BOOLEAN** | |
|
10
|
+
**image** | [**ImageUrl**](ImageUrl.md) | |
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Noths::RefundResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**status** | **Integer** | |
|
7
|
+
**errors** | [**Array<Error>**](Error.md) | |
|
8
|
+
**order_refund** | [**OrderRefund**](OrderRefund.md) | |
|
9
|
+
|
10
|
+
|
data/docs/RefundsApi.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Noths::RefundsApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**refunds_create**](RefundsApi.md#refunds_create) | **POST** /api/v1/orders/{order_id}/refunds | Refund an order
|
8
|
+
|
9
|
+
|
10
|
+
# **refunds_create**
|
11
|
+
> RefundResponse refunds_create(order_id, refund_reason, cents)
|
12
|
+
|
13
|
+
Refund an order
|
14
|
+
|
15
|
+
Refunds all or part of an order
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'noths'
|
21
|
+
# setup authorization
|
22
|
+
Noths.configure do |config|
|
23
|
+
# Configure API key authorization: token
|
24
|
+
config.api_key['token'] = 'YOUR API KEY'
|
25
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
26
|
+
#config.api_key_prefix['token'] = 'Bearer'
|
27
|
+
end
|
28
|
+
|
29
|
+
api_instance = Noths::RefundsApi.new
|
30
|
+
|
31
|
+
order_id = 56 # Integer | Order id
|
32
|
+
|
33
|
+
refund_reason = "refund_reason_example" # String | Customer will see this message
|
34
|
+
|
35
|
+
cents = 56 # Integer |
|
36
|
+
|
37
|
+
|
38
|
+
begin
|
39
|
+
#Refund an order
|
40
|
+
result = api_instance.refunds_create(order_id, refund_reason, cents)
|
41
|
+
p result
|
42
|
+
rescue Noths::ApiError => e
|
43
|
+
puts "Exception when calling RefundsApi->refunds_create: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
### Parameters
|
48
|
+
|
49
|
+
Name | Type | Description | Notes
|
50
|
+
------------- | ------------- | ------------- | -------------
|
51
|
+
**order_id** | **Integer**| Order id |
|
52
|
+
**refund_reason** | **String**| Customer will see this message |
|
53
|
+
**cents** | **Integer**| |
|
54
|
+
|
55
|
+
### Return type
|
56
|
+
|
57
|
+
[**RefundResponse**](RefundResponse.md)
|
58
|
+
|
59
|
+
### Authorization
|
60
|
+
|
61
|
+
[token](../README.md#token)
|
62
|
+
|
63
|
+
### HTTP request headers
|
64
|
+
|
65
|
+
- **Content-Type**: Not defined
|
66
|
+
- **Accept**: Not defined
|
67
|
+
|
68
|
+
|
69
|
+
|
data/docs/User.md
ADDED
data/lib/noths.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
=begin
|
2
|
+
#Noths
|
3
|
+
|
4
|
+
#www.notonthehighstreet.com API client
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'noths/api_client'
|
15
|
+
require 'noths/api_error'
|
16
|
+
require 'noths/version'
|
17
|
+
require 'noths/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'noths/models/acceptance_bulk_model'
|
21
|
+
require 'noths/models/currency'
|
22
|
+
require 'noths/models/decline_bulk_model'
|
23
|
+
require 'noths/models/delivery_address'
|
24
|
+
require 'noths/models/delivery_service'
|
25
|
+
require 'noths/models/delivery_zone'
|
26
|
+
require 'noths/models/dispatch_bulk_model'
|
27
|
+
require 'noths/models/dispatch_notes_bulk_model'
|
28
|
+
require 'noths/models/enquiry'
|
29
|
+
require 'noths/models/enquiry_message'
|
30
|
+
require 'noths/models/error'
|
31
|
+
require 'noths/models/financials'
|
32
|
+
require 'noths/models/financials_details'
|
33
|
+
require 'noths/models/image_url'
|
34
|
+
require 'noths/models/item'
|
35
|
+
require 'noths/models/item_financials'
|
36
|
+
require 'noths/models/link'
|
37
|
+
require 'noths/models/manual_payment'
|
38
|
+
require 'noths/models/money'
|
39
|
+
require 'noths/models/order'
|
40
|
+
require 'noths/models/order_detail'
|
41
|
+
require 'noths/models/order_details_bulk_model'
|
42
|
+
require 'noths/models/order_index'
|
43
|
+
require 'noths/models/order_refund'
|
44
|
+
require 'noths/models/product'
|
45
|
+
require 'noths/models/product_option'
|
46
|
+
require 'noths/models/refund_response'
|
47
|
+
require 'noths/models/search_result_meta'
|
48
|
+
require 'noths/models/user'
|
49
|
+
|
50
|
+
# APIs
|
51
|
+
require 'noths/api/orders_api'
|
52
|
+
require 'noths/api/refunds_api'
|
53
|
+
|
54
|
+
module Noths
|
55
|
+
class << self
|
56
|
+
# Customize default settings for the SDK using block.
|
57
|
+
# Noths.configure do |config|
|
58
|
+
# config.username = "xxx"
|
59
|
+
# config.password = "xxx"
|
60
|
+
# end
|
61
|
+
# If no block given, return the default Configuration object.
|
62
|
+
def configure
|
63
|
+
if block_given?
|
64
|
+
yield(Configuration.default)
|
65
|
+
else
|
66
|
+
Configuration.default
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,819 @@
|
|
1
|
+
=begin
|
2
|
+
#Noths
|
3
|
+
|
4
|
+
#www.notonthehighstreet.com API client
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module Noths
|
16
|
+
class OrdersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Accept an order
|
24
|
+
# Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
|
25
|
+
# @param id Order id
|
26
|
+
# @param estimated_delivery_date 'yyyy-mm-dd'
|
27
|
+
# @param estimated_dispatch_at 'yyyy-mm-dd'
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @option opts [String] :confirmation_note
|
30
|
+
# @return [nil]
|
31
|
+
def orders_acceptance(id, estimated_delivery_date, estimated_dispatch_at, opts = {})
|
32
|
+
orders_acceptance_with_http_info(id, estimated_delivery_date, estimated_dispatch_at, opts)
|
33
|
+
return nil
|
34
|
+
end
|
35
|
+
|
36
|
+
# Accept an order
|
37
|
+
# Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
|
38
|
+
# @param id Order id
|
39
|
+
# @param estimated_delivery_date 'yyyy-mm-dd'
|
40
|
+
# @param estimated_dispatch_at 'yyyy-mm-dd'
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @option opts [String] :confirmation_note
|
43
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
44
|
+
def orders_acceptance_with_http_info(id, estimated_delivery_date, estimated_dispatch_at, opts = {})
|
45
|
+
if @api_client.config.debugging
|
46
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance ..."
|
47
|
+
end
|
48
|
+
# verify the required parameter 'id' is set
|
49
|
+
if @api_client.config.client_side_validation && id.nil?
|
50
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_acceptance"
|
51
|
+
end
|
52
|
+
# verify the required parameter 'estimated_delivery_date' is set
|
53
|
+
if @api_client.config.client_side_validation && estimated_delivery_date.nil?
|
54
|
+
fail ArgumentError, "Missing the required parameter 'estimated_delivery_date' when calling OrdersApi.orders_acceptance"
|
55
|
+
end
|
56
|
+
# verify the required parameter 'estimated_dispatch_at' is set
|
57
|
+
if @api_client.config.client_side_validation && estimated_dispatch_at.nil?
|
58
|
+
fail ArgumentError, "Missing the required parameter 'estimated_dispatch_at' when calling OrdersApi.orders_acceptance"
|
59
|
+
end
|
60
|
+
# resource path
|
61
|
+
local_var_path = "/api/v1/orders/{id}/accept".sub('{' + 'id' + '}', id.to_s)
|
62
|
+
|
63
|
+
# query parameters
|
64
|
+
query_params = {}
|
65
|
+
|
66
|
+
# header parameters
|
67
|
+
header_params = {}
|
68
|
+
|
69
|
+
# form parameters
|
70
|
+
form_params = {}
|
71
|
+
form_params["estimated_delivery_date"] = estimated_delivery_date
|
72
|
+
form_params["estimated_dispatch_at"] = estimated_dispatch_at
|
73
|
+
form_params["confirmation_note"] = opts[:'confirmation_note'] if !opts[:'confirmation_note'].nil?
|
74
|
+
|
75
|
+
# http body (model)
|
76
|
+
post_body = nil
|
77
|
+
auth_names = ['token']
|
78
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
79
|
+
:header_params => header_params,
|
80
|
+
:query_params => query_params,
|
81
|
+
:form_params => form_params,
|
82
|
+
:body => post_body,
|
83
|
+
:auth_names => auth_names)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_acceptance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Accept multiple orders
|
91
|
+
# 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>
|
92
|
+
# @param payload
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [nil]
|
95
|
+
def orders_acceptance_bulk(payload, opts = {})
|
96
|
+
orders_acceptance_bulk_with_http_info(payload, opts)
|
97
|
+
return nil
|
98
|
+
end
|
99
|
+
|
100
|
+
# Accept multiple orders
|
101
|
+
# 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>
|
102
|
+
# @param payload
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
105
|
+
def orders_acceptance_bulk_with_http_info(payload, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance_bulk ..."
|
108
|
+
end
|
109
|
+
# verify the required parameter 'payload' is set
|
110
|
+
if @api_client.config.client_side_validation && payload.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_acceptance_bulk"
|
112
|
+
end
|
113
|
+
# resource path
|
114
|
+
local_var_path = "/api/v1/orders/accept"
|
115
|
+
|
116
|
+
# query parameters
|
117
|
+
query_params = {}
|
118
|
+
|
119
|
+
# header parameters
|
120
|
+
header_params = {}
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = @api_client.object_to_http_body(payload)
|
127
|
+
auth_names = ['token']
|
128
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
129
|
+
:header_params => header_params,
|
130
|
+
:query_params => query_params,
|
131
|
+
:form_params => form_params,
|
132
|
+
:body => post_body,
|
133
|
+
:auth_names => auth_names)
|
134
|
+
if @api_client.config.debugging
|
135
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_acceptance_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
136
|
+
end
|
137
|
+
return data, status_code, headers
|
138
|
+
end
|
139
|
+
|
140
|
+
# Decline an order
|
141
|
+
# Declines an order that is in the placed state
|
142
|
+
# @param id Order id
|
143
|
+
# @param decline_reason
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @return [nil]
|
146
|
+
def orders_decline(id, decline_reason, opts = {})
|
147
|
+
orders_decline_with_http_info(id, decline_reason, opts)
|
148
|
+
return nil
|
149
|
+
end
|
150
|
+
|
151
|
+
# Decline an order
|
152
|
+
# Declines an order that is in the placed state
|
153
|
+
# @param id Order id
|
154
|
+
# @param decline_reason
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
157
|
+
def orders_decline_with_http_info(id, decline_reason, opts = {})
|
158
|
+
if @api_client.config.debugging
|
159
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_decline ..."
|
160
|
+
end
|
161
|
+
# verify the required parameter 'id' is set
|
162
|
+
if @api_client.config.client_side_validation && id.nil?
|
163
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_decline"
|
164
|
+
end
|
165
|
+
# verify the required parameter 'decline_reason' is set
|
166
|
+
if @api_client.config.client_side_validation && decline_reason.nil?
|
167
|
+
fail ArgumentError, "Missing the required parameter 'decline_reason' when calling OrdersApi.orders_decline"
|
168
|
+
end
|
169
|
+
# resource path
|
170
|
+
local_var_path = "/api/v1/orders/{id}/decline".sub('{' + 'id' + '}', id.to_s)
|
171
|
+
|
172
|
+
# query parameters
|
173
|
+
query_params = {}
|
174
|
+
|
175
|
+
# header parameters
|
176
|
+
header_params = {}
|
177
|
+
|
178
|
+
# form parameters
|
179
|
+
form_params = {}
|
180
|
+
form_params["decline_reason"] = decline_reason
|
181
|
+
|
182
|
+
# http body (model)
|
183
|
+
post_body = nil
|
184
|
+
auth_names = ['token']
|
185
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
186
|
+
:header_params => header_params,
|
187
|
+
:query_params => query_params,
|
188
|
+
:form_params => form_params,
|
189
|
+
:body => post_body,
|
190
|
+
:auth_names => auth_names)
|
191
|
+
if @api_client.config.debugging
|
192
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_decline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
193
|
+
end
|
194
|
+
return data, status_code, headers
|
195
|
+
end
|
196
|
+
|
197
|
+
# Decline multiple orders
|
198
|
+
# 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>
|
199
|
+
# @param payload
|
200
|
+
# @param [Hash] opts the optional parameters
|
201
|
+
# @return [nil]
|
202
|
+
def orders_decline_bulk(payload, opts = {})
|
203
|
+
orders_decline_bulk_with_http_info(payload, opts)
|
204
|
+
return nil
|
205
|
+
end
|
206
|
+
|
207
|
+
# Decline multiple orders
|
208
|
+
# 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>
|
209
|
+
# @param payload
|
210
|
+
# @param [Hash] opts the optional parameters
|
211
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
212
|
+
def orders_decline_bulk_with_http_info(payload, opts = {})
|
213
|
+
if @api_client.config.debugging
|
214
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_decline_bulk ..."
|
215
|
+
end
|
216
|
+
# verify the required parameter 'payload' is set
|
217
|
+
if @api_client.config.client_side_validation && payload.nil?
|
218
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_decline_bulk"
|
219
|
+
end
|
220
|
+
# resource path
|
221
|
+
local_var_path = "/api/v1/orders/decline"
|
222
|
+
|
223
|
+
# query parameters
|
224
|
+
query_params = {}
|
225
|
+
|
226
|
+
# header parameters
|
227
|
+
header_params = {}
|
228
|
+
|
229
|
+
# form parameters
|
230
|
+
form_params = {}
|
231
|
+
|
232
|
+
# http body (model)
|
233
|
+
post_body = @api_client.object_to_http_body(payload)
|
234
|
+
auth_names = ['token']
|
235
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
236
|
+
:header_params => header_params,
|
237
|
+
:query_params => query_params,
|
238
|
+
:form_params => form_params,
|
239
|
+
:body => post_body,
|
240
|
+
:auth_names => auth_names)
|
241
|
+
if @api_client.config.debugging
|
242
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_decline_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
243
|
+
end
|
244
|
+
return data, status_code, headers
|
245
|
+
end
|
246
|
+
|
247
|
+
# Generate a dispatch note pdf or gift note pdf.
|
248
|
+
# 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>
|
249
|
+
# @param id Order id
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @option opts [String] :force_type Type of document
|
252
|
+
# @return [nil]
|
253
|
+
def orders_dispatch_note(id, opts = {})
|
254
|
+
orders_dispatch_note_with_http_info(id, opts)
|
255
|
+
return nil
|
256
|
+
end
|
257
|
+
|
258
|
+
# Generate a dispatch note pdf or gift note pdf.
|
259
|
+
# 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>
|
260
|
+
# @param id Order id
|
261
|
+
# @param [Hash] opts the optional parameters
|
262
|
+
# @option opts [String] :force_type Type of document
|
263
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
264
|
+
def orders_dispatch_note_with_http_info(id, opts = {})
|
265
|
+
if @api_client.config.debugging
|
266
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_note ..."
|
267
|
+
end
|
268
|
+
# verify the required parameter 'id' is set
|
269
|
+
if @api_client.config.client_side_validation && id.nil?
|
270
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_note"
|
271
|
+
end
|
272
|
+
if @api_client.config.client_side_validation && opts[:'force_type'] && !['regular'].include?(opts[:'force_type'])
|
273
|
+
fail ArgumentError, 'invalid value for "force_type", must be one of regular'
|
274
|
+
end
|
275
|
+
# resource path
|
276
|
+
local_var_path = "/api/v1/orders/{id}/dispatch_note".sub('{' + 'id' + '}', id.to_s)
|
277
|
+
|
278
|
+
# query parameters
|
279
|
+
query_params = {}
|
280
|
+
query_params[:'force_type'] = opts[:'force_type'] if !opts[:'force_type'].nil?
|
281
|
+
|
282
|
+
# header parameters
|
283
|
+
header_params = {}
|
284
|
+
|
285
|
+
# form parameters
|
286
|
+
form_params = {}
|
287
|
+
|
288
|
+
# http body (model)
|
289
|
+
post_body = nil
|
290
|
+
auth_names = ['token']
|
291
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
292
|
+
:header_params => header_params,
|
293
|
+
:query_params => query_params,
|
294
|
+
:form_params => form_params,
|
295
|
+
:body => post_body,
|
296
|
+
:auth_names => auth_names)
|
297
|
+
if @api_client.config.debugging
|
298
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
299
|
+
end
|
300
|
+
return data, status_code, headers
|
301
|
+
end
|
302
|
+
|
303
|
+
# Generate pdf with dispatch note for each order
|
304
|
+
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
305
|
+
# @param payload
|
306
|
+
# @param [Hash] opts the optional parameters
|
307
|
+
# @return [nil]
|
308
|
+
def orders_dispatch_notes_bulk(payload, opts = {})
|
309
|
+
orders_dispatch_notes_bulk_with_http_info(payload, opts)
|
310
|
+
return nil
|
311
|
+
end
|
312
|
+
|
313
|
+
# Generate pdf with dispatch note for each order
|
314
|
+
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
315
|
+
# @param payload
|
316
|
+
# @param [Hash] opts the optional parameters
|
317
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
318
|
+
def orders_dispatch_notes_bulk_with_http_info(payload, opts = {})
|
319
|
+
if @api_client.config.debugging
|
320
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_notes_bulk ..."
|
321
|
+
end
|
322
|
+
# verify the required parameter 'payload' is set
|
323
|
+
if @api_client.config.client_side_validation && payload.nil?
|
324
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_notes_bulk"
|
325
|
+
end
|
326
|
+
# resource path
|
327
|
+
local_var_path = "/api/v1/orders/dispatch_notes"
|
328
|
+
|
329
|
+
# query parameters
|
330
|
+
query_params = {}
|
331
|
+
|
332
|
+
# header parameters
|
333
|
+
header_params = {}
|
334
|
+
|
335
|
+
# form parameters
|
336
|
+
form_params = {}
|
337
|
+
|
338
|
+
# http body (model)
|
339
|
+
post_body = @api_client.object_to_http_body(payload)
|
340
|
+
auth_names = ['token']
|
341
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
342
|
+
:header_params => header_params,
|
343
|
+
:query_params => query_params,
|
344
|
+
:form_params => form_params,
|
345
|
+
:body => post_body,
|
346
|
+
:auth_names => auth_names)
|
347
|
+
if @api_client.config.debugging
|
348
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_notes_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
349
|
+
end
|
350
|
+
return data, status_code, headers
|
351
|
+
end
|
352
|
+
|
353
|
+
# Dispatch an order
|
354
|
+
# Dispatches an order that is in an accepted state and has also had its dispatch note printed
|
355
|
+
# @param id Order id
|
356
|
+
# @param estimated_delivery_date 'yyyy-mm-dd'
|
357
|
+
# @param [Hash] opts the optional parameters
|
358
|
+
# @option opts [BOOLEAN] :resolve_enquiry
|
359
|
+
# @option opts [String] :tracking_number
|
360
|
+
# @option opts [String] :parcel_tracking_url
|
361
|
+
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
362
|
+
# @return [nil]
|
363
|
+
def orders_dispatch_order(id, estimated_delivery_date, opts = {})
|
364
|
+
orders_dispatch_order_with_http_info(id, estimated_delivery_date, opts)
|
365
|
+
return nil
|
366
|
+
end
|
367
|
+
|
368
|
+
# Dispatch an order
|
369
|
+
# Dispatches an order that is in an accepted state and has also had its dispatch note printed
|
370
|
+
# @param id Order id
|
371
|
+
# @param estimated_delivery_date 'yyyy-mm-dd'
|
372
|
+
# @param [Hash] opts the optional parameters
|
373
|
+
# @option opts [BOOLEAN] :resolve_enquiry
|
374
|
+
# @option opts [String] :tracking_number
|
375
|
+
# @option opts [String] :parcel_tracking_url
|
376
|
+
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
377
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
378
|
+
def orders_dispatch_order_with_http_info(id, estimated_delivery_date, opts = {})
|
379
|
+
if @api_client.config.debugging
|
380
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_order ..."
|
381
|
+
end
|
382
|
+
# verify the required parameter 'id' is set
|
383
|
+
if @api_client.config.client_side_validation && id.nil?
|
384
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_order"
|
385
|
+
end
|
386
|
+
# verify the required parameter 'estimated_delivery_date' is set
|
387
|
+
if @api_client.config.client_side_validation && estimated_delivery_date.nil?
|
388
|
+
fail ArgumentError, "Missing the required parameter 'estimated_delivery_date' when calling OrdersApi.orders_dispatch_order"
|
389
|
+
end
|
390
|
+
# resource path
|
391
|
+
local_var_path = "/api/v1/orders/{id}/dispatch".sub('{' + 'id' + '}', id.to_s)
|
392
|
+
|
393
|
+
# query parameters
|
394
|
+
query_params = {}
|
395
|
+
|
396
|
+
# header parameters
|
397
|
+
header_params = {}
|
398
|
+
|
399
|
+
# form parameters
|
400
|
+
form_params = {}
|
401
|
+
form_params["estimated_delivery_date"] = estimated_delivery_date
|
402
|
+
form_params["resolve_enquiry"] = opts[:'resolve_enquiry'] if !opts[:'resolve_enquiry'].nil?
|
403
|
+
form_params["tracking_number"] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil?
|
404
|
+
form_params["parcel_tracking_url"] = opts[:'parcel_tracking_url'] if !opts[:'parcel_tracking_url'].nil?
|
405
|
+
form_params["ignore_unresolved_enquiries"] = opts[:'ignore_unresolved_enquiries'] if !opts[:'ignore_unresolved_enquiries'].nil?
|
406
|
+
|
407
|
+
# http body (model)
|
408
|
+
post_body = nil
|
409
|
+
auth_names = ['token']
|
410
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
411
|
+
:header_params => header_params,
|
412
|
+
:query_params => query_params,
|
413
|
+
:form_params => form_params,
|
414
|
+
:body => post_body,
|
415
|
+
:auth_names => auth_names)
|
416
|
+
if @api_client.config.debugging
|
417
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
418
|
+
end
|
419
|
+
return data, status_code, headers
|
420
|
+
end
|
421
|
+
|
422
|
+
# Dispatch multiple orders
|
423
|
+
# 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>
|
424
|
+
# @param payload
|
425
|
+
# @param [Hash] opts the optional parameters
|
426
|
+
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
427
|
+
# @return [nil]
|
428
|
+
def orders_dispatch_orders_bulk(payload, opts = {})
|
429
|
+
orders_dispatch_orders_bulk_with_http_info(payload, opts)
|
430
|
+
return nil
|
431
|
+
end
|
432
|
+
|
433
|
+
# Dispatch multiple orders
|
434
|
+
# 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>
|
435
|
+
# @param payload
|
436
|
+
# @param [Hash] opts the optional parameters
|
437
|
+
# @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
|
438
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
439
|
+
def orders_dispatch_orders_bulk_with_http_info(payload, opts = {})
|
440
|
+
if @api_client.config.debugging
|
441
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_orders_bulk ..."
|
442
|
+
end
|
443
|
+
# verify the required parameter 'payload' is set
|
444
|
+
if @api_client.config.client_side_validation && payload.nil?
|
445
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_orders_bulk"
|
446
|
+
end
|
447
|
+
# resource path
|
448
|
+
local_var_path = "/api/v1/orders/dispatch"
|
449
|
+
|
450
|
+
# query parameters
|
451
|
+
query_params = {}
|
452
|
+
query_params[:'ignore_unresolved_enquiries'] = opts[:'ignore_unresolved_enquiries'] if !opts[:'ignore_unresolved_enquiries'].nil?
|
453
|
+
|
454
|
+
# header parameters
|
455
|
+
header_params = {}
|
456
|
+
|
457
|
+
# form parameters
|
458
|
+
form_params = {}
|
459
|
+
|
460
|
+
# http body (model)
|
461
|
+
post_body = @api_client.object_to_http_body(payload)
|
462
|
+
auth_names = ['token']
|
463
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
464
|
+
:header_params => header_params,
|
465
|
+
:query_params => query_params,
|
466
|
+
:form_params => form_params,
|
467
|
+
:body => post_body,
|
468
|
+
:auth_names => auth_names)
|
469
|
+
if @api_client.config.debugging
|
470
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_orders_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
471
|
+
end
|
472
|
+
return data, status_code, headers
|
473
|
+
end
|
474
|
+
|
475
|
+
# Fetch orders
|
476
|
+
# Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
|
477
|
+
# @param [Hash] opts the optional parameters
|
478
|
+
# @option opts [DateTime] :customer_expected_delivery_date_from Earliest customer_expected_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
479
|
+
# @option opts [DateTime] :customer_expected_delivery_date_to Latest customer_expected_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
480
|
+
# @option opts [String] :delivery_service_code Delivery service code
|
481
|
+
# @option opts [String] :delivery_zone_ids List of delivery zone ids
|
482
|
+
# @option opts [String] :dir Direction (defaults to desc)
|
483
|
+
# @option opts [BOOLEAN] :dispatch_note_viewed
|
484
|
+
# @option opts [String] :enquiry_state Enquiry state where `unresolved` includes `opened`, `acknowledged` and `overdue`
|
485
|
+
# @option opts [DateTime] :estimated_delivery_date_from Earliest estimated_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
486
|
+
# @option opts [DateTime] :estimated_delivery_date_to Latest estimated_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
487
|
+
# @option opts [DateTime] :estimated_dispatch_at_from Earliest estimated_dispatch_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
488
|
+
# @option opts [DateTime] :estimated_dispatch_at_to Latest estimated_dispatch_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
489
|
+
# @option opts [DateTime] :updated_at_from Earliest updated_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'. Is not changed on nested resource updates eg 'Enquiry'
|
490
|
+
# @option opts [DateTime] :updated_at_to Latest updated_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'. Is not changed on nested resource updates eg 'Enquiry'
|
491
|
+
# @option opts [BOOLEAN] :gift
|
492
|
+
# @option opts [BOOLEAN] :unresolved_enquiry
|
493
|
+
# @option opts [String] :ids List of order ids
|
494
|
+
# @option opts [Integer] :offset
|
495
|
+
# @option opts [Integer] :per_page Defaults to 30, maximum is 250
|
496
|
+
# @option opts [String] :product_ids List of product ids
|
497
|
+
# @option opts [String] :query Matches your query to information related to your orders
|
498
|
+
# @option opts [BOOLEAN] :repeat_customer
|
499
|
+
# @option opts [String] :sort Defaults to placed_at
|
500
|
+
# @option opts [String] :state State
|
501
|
+
# @return [OrderIndex]
|
502
|
+
def orders_index(opts = {})
|
503
|
+
data, _status_code, _headers = orders_index_with_http_info(opts)
|
504
|
+
return data
|
505
|
+
end
|
506
|
+
|
507
|
+
# Fetch orders
|
508
|
+
# Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
|
509
|
+
# @param [Hash] opts the optional parameters
|
510
|
+
# @option opts [DateTime] :customer_expected_delivery_date_from Earliest customer_expected_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
511
|
+
# @option opts [DateTime] :customer_expected_delivery_date_to Latest customer_expected_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
512
|
+
# @option opts [String] :delivery_service_code Delivery service code
|
513
|
+
# @option opts [String] :delivery_zone_ids List of delivery zone ids
|
514
|
+
# @option opts [String] :dir Direction (defaults to desc)
|
515
|
+
# @option opts [BOOLEAN] :dispatch_note_viewed
|
516
|
+
# @option opts [String] :enquiry_state Enquiry state where `unresolved` includes `opened`, `acknowledged` and `overdue`
|
517
|
+
# @option opts [DateTime] :estimated_delivery_date_from Earliest estimated_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
518
|
+
# @option opts [DateTime] :estimated_delivery_date_to Latest estimated_delivery_date datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
519
|
+
# @option opts [DateTime] :estimated_dispatch_at_from Earliest estimated_dispatch_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
520
|
+
# @option opts [DateTime] :estimated_dispatch_at_to Latest estimated_dispatch_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'
|
521
|
+
# @option opts [DateTime] :updated_at_from Earliest updated_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'. Is not changed on nested resource updates eg 'Enquiry'
|
522
|
+
# @option opts [DateTime] :updated_at_to Latest updated_at datetime - format iso8601 eg '2011-10-05T22:26:12-04:00'. Is not changed on nested resource updates eg 'Enquiry'
|
523
|
+
# @option opts [BOOLEAN] :gift
|
524
|
+
# @option opts [BOOLEAN] :unresolved_enquiry
|
525
|
+
# @option opts [String] :ids List of order ids
|
526
|
+
# @option opts [Integer] :offset
|
527
|
+
# @option opts [Integer] :per_page Defaults to 30, maximum is 250
|
528
|
+
# @option opts [String] :product_ids List of product ids
|
529
|
+
# @option opts [String] :query Matches your query to information related to your orders
|
530
|
+
# @option opts [BOOLEAN] :repeat_customer
|
531
|
+
# @option opts [String] :sort Defaults to placed_at
|
532
|
+
# @option opts [String] :state State
|
533
|
+
# @return [Array<(OrderIndex, Fixnum, Hash)>] OrderIndex data, response status code and response headers
|
534
|
+
def orders_index_with_http_info(opts = {})
|
535
|
+
if @api_client.config.debugging
|
536
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_index ..."
|
537
|
+
end
|
538
|
+
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'])
|
539
|
+
fail ArgumentError, 'invalid value for "delivery_service_code", must be one of EXPRESS_12, EXPRESS_24, EXPRESS_48, FREE, SATURDAY, STANDARD, STANDARD_COURIER'
|
540
|
+
end
|
541
|
+
if @api_client.config.client_side_validation && opts[:'dir'] && !['asc', 'desc'].include?(opts[:'dir'])
|
542
|
+
fail ArgumentError, 'invalid value for "dir", must be one of asc, desc'
|
543
|
+
end
|
544
|
+
if @api_client.config.client_side_validation && opts[:'enquiry_state'] && !['opened', 'acknowledged', 'overdue', 'resolved', 'unresolved'].include?(opts[:'enquiry_state'])
|
545
|
+
fail ArgumentError, 'invalid value for "enquiry_state", must be one of opened, acknowledged, overdue, resolved, unresolved'
|
546
|
+
end
|
547
|
+
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'])
|
548
|
+
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'
|
549
|
+
end
|
550
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !['placed', 'expired', 'accepted', 'declined', 'dispatched', 'refunded', 'archived'].include?(opts[:'state'])
|
551
|
+
fail ArgumentError, 'invalid value for "state", must be one of placed, expired, accepted, declined, dispatched, refunded, archived'
|
552
|
+
end
|
553
|
+
# resource path
|
554
|
+
local_var_path = "/api/v1/orders"
|
555
|
+
|
556
|
+
# query parameters
|
557
|
+
query_params = {}
|
558
|
+
query_params[:'customer_expected_delivery_date[from]'] = opts[:'customer_expected_delivery_date_from'] if !opts[:'customer_expected_delivery_date_from'].nil?
|
559
|
+
query_params[:'customer_expected_delivery_date[to]'] = opts[:'customer_expected_delivery_date_to'] if !opts[:'customer_expected_delivery_date_to'].nil?
|
560
|
+
query_params[:'delivery_service_code'] = opts[:'delivery_service_code'] if !opts[:'delivery_service_code'].nil?
|
561
|
+
query_params[:'delivery_zone_ids'] = opts[:'delivery_zone_ids'] if !opts[:'delivery_zone_ids'].nil?
|
562
|
+
query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
|
563
|
+
query_params[:'dispatch_note_viewed'] = opts[:'dispatch_note_viewed'] if !opts[:'dispatch_note_viewed'].nil?
|
564
|
+
query_params[:'enquiry_state'] = opts[:'enquiry_state'] if !opts[:'enquiry_state'].nil?
|
565
|
+
query_params[:'estimated_delivery_date[from]'] = opts[:'estimated_delivery_date_from'] if !opts[:'estimated_delivery_date_from'].nil?
|
566
|
+
query_params[:'estimated_delivery_date[to]'] = opts[:'estimated_delivery_date_to'] if !opts[:'estimated_delivery_date_to'].nil?
|
567
|
+
query_params[:'estimated_dispatch_at[from]'] = opts[:'estimated_dispatch_at_from'] if !opts[:'estimated_dispatch_at_from'].nil?
|
568
|
+
query_params[:'estimated_dispatch_at[to]'] = opts[:'estimated_dispatch_at_to'] if !opts[:'estimated_dispatch_at_to'].nil?
|
569
|
+
query_params[:'updated_at[from]'] = opts[:'updated_at_from'] if !opts[:'updated_at_from'].nil?
|
570
|
+
query_params[:'updated_at[to]'] = opts[:'updated_at_to'] if !opts[:'updated_at_to'].nil?
|
571
|
+
query_params[:'gift'] = opts[:'gift'] if !opts[:'gift'].nil?
|
572
|
+
query_params[:'unresolved_enquiry'] = opts[:'unresolved_enquiry'] if !opts[:'unresolved_enquiry'].nil?
|
573
|
+
query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?
|
574
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
575
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
576
|
+
query_params[:'product_ids'] = opts[:'product_ids'] if !opts[:'product_ids'].nil?
|
577
|
+
query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
|
578
|
+
query_params[:'repeat_customer'] = opts[:'repeat_customer'] if !opts[:'repeat_customer'].nil?
|
579
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
580
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
581
|
+
|
582
|
+
# header parameters
|
583
|
+
header_params = {}
|
584
|
+
|
585
|
+
# form parameters
|
586
|
+
form_params = {}
|
587
|
+
|
588
|
+
# http body (model)
|
589
|
+
post_body = nil
|
590
|
+
auth_names = ['token']
|
591
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
592
|
+
:header_params => header_params,
|
593
|
+
:query_params => query_params,
|
594
|
+
:form_params => form_params,
|
595
|
+
:body => post_body,
|
596
|
+
:auth_names => auth_names,
|
597
|
+
:return_type => 'OrderIndex')
|
598
|
+
if @api_client.config.debugging
|
599
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
600
|
+
end
|
601
|
+
return data, status_code, headers
|
602
|
+
end
|
603
|
+
|
604
|
+
# Generate a vat invoice pdf.
|
605
|
+
# <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>
|
606
|
+
# @param id Order id
|
607
|
+
# @param type Type of invoice
|
608
|
+
# @param [Hash] opts the optional parameters
|
609
|
+
# @return [nil]
|
610
|
+
def orders_invoice(id, type, opts = {})
|
611
|
+
orders_invoice_with_http_info(id, type, opts)
|
612
|
+
return nil
|
613
|
+
end
|
614
|
+
|
615
|
+
# Generate a vat invoice pdf.
|
616
|
+
# <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>
|
617
|
+
# @param id Order id
|
618
|
+
# @param type Type of invoice
|
619
|
+
# @param [Hash] opts the optional parameters
|
620
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
621
|
+
def orders_invoice_with_http_info(id, type, opts = {})
|
622
|
+
if @api_client.config.debugging
|
623
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_invoice ..."
|
624
|
+
end
|
625
|
+
# verify the required parameter 'id' is set
|
626
|
+
if @api_client.config.client_side_validation && id.nil?
|
627
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_invoice"
|
628
|
+
end
|
629
|
+
# verify the required parameter 'type' is set
|
630
|
+
if @api_client.config.client_side_validation && type.nil?
|
631
|
+
fail ArgumentError, "Missing the required parameter 'type' when calling OrdersApi.orders_invoice"
|
632
|
+
end
|
633
|
+
# verify enum value
|
634
|
+
if @api_client.config.client_side_validation && !['vat_invoice', 'additional_payment'].include?(type)
|
635
|
+
fail ArgumentError, "invalid value for 'type', must be one of vat_invoice, additional_payment"
|
636
|
+
end
|
637
|
+
# resource path
|
638
|
+
local_var_path = "/api/v1/orders/{id}/invoice".sub('{' + 'id' + '}', id.to_s)
|
639
|
+
|
640
|
+
# query parameters
|
641
|
+
query_params = {}
|
642
|
+
query_params[:'type'] = type
|
643
|
+
|
644
|
+
# header parameters
|
645
|
+
header_params = {}
|
646
|
+
|
647
|
+
# form parameters
|
648
|
+
form_params = {}
|
649
|
+
|
650
|
+
# http body (model)
|
651
|
+
post_body = nil
|
652
|
+
auth_names = ['token']
|
653
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
654
|
+
:header_params => header_params,
|
655
|
+
:query_params => query_params,
|
656
|
+
:form_params => form_params,
|
657
|
+
:body => post_body,
|
658
|
+
:auth_names => auth_names)
|
659
|
+
if @api_client.config.debugging
|
660
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
661
|
+
end
|
662
|
+
return data, status_code, headers
|
663
|
+
end
|
664
|
+
|
665
|
+
# Generate an order details pdf
|
666
|
+
# Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
|
667
|
+
# @param id Order id
|
668
|
+
# @param [Hash] opts the optional parameters
|
669
|
+
# @return [nil]
|
670
|
+
def orders_order_details(id, opts = {})
|
671
|
+
orders_order_details_with_http_info(id, opts)
|
672
|
+
return nil
|
673
|
+
end
|
674
|
+
|
675
|
+
# Generate an order details pdf
|
676
|
+
# Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
|
677
|
+
# @param id Order id
|
678
|
+
# @param [Hash] opts the optional parameters
|
679
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
680
|
+
def orders_order_details_with_http_info(id, opts = {})
|
681
|
+
if @api_client.config.debugging
|
682
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details ..."
|
683
|
+
end
|
684
|
+
# verify the required parameter 'id' is set
|
685
|
+
if @api_client.config.client_side_validation && id.nil?
|
686
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_order_details"
|
687
|
+
end
|
688
|
+
# resource path
|
689
|
+
local_var_path = "/api/v1/orders/{id}/order_details".sub('{' + 'id' + '}', id.to_s)
|
690
|
+
|
691
|
+
# query parameters
|
692
|
+
query_params = {}
|
693
|
+
|
694
|
+
# header parameters
|
695
|
+
header_params = {}
|
696
|
+
|
697
|
+
# form parameters
|
698
|
+
form_params = {}
|
699
|
+
|
700
|
+
# http body (model)
|
701
|
+
post_body = nil
|
702
|
+
auth_names = ['token']
|
703
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
704
|
+
:header_params => header_params,
|
705
|
+
:query_params => query_params,
|
706
|
+
:form_params => form_params,
|
707
|
+
:body => post_body,
|
708
|
+
:auth_names => auth_names)
|
709
|
+
if @api_client.config.debugging
|
710
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_order_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
711
|
+
end
|
712
|
+
return data, status_code, headers
|
713
|
+
end
|
714
|
+
|
715
|
+
# Generate pdf with order details for each order
|
716
|
+
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
717
|
+
# @param payload
|
718
|
+
# @param [Hash] opts the optional parameters
|
719
|
+
# @return [nil]
|
720
|
+
def orders_order_details_bulk(payload, opts = {})
|
721
|
+
orders_order_details_bulk_with_http_info(payload, opts)
|
722
|
+
return nil
|
723
|
+
end
|
724
|
+
|
725
|
+
# Generate pdf with order details for each order
|
726
|
+
# <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
|
727
|
+
# @param payload
|
728
|
+
# @param [Hash] opts the optional parameters
|
729
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
730
|
+
def orders_order_details_bulk_with_http_info(payload, opts = {})
|
731
|
+
if @api_client.config.debugging
|
732
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details_bulk ..."
|
733
|
+
end
|
734
|
+
# verify the required parameter 'payload' is set
|
735
|
+
if @api_client.config.client_side_validation && payload.nil?
|
736
|
+
fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_order_details_bulk"
|
737
|
+
end
|
738
|
+
# resource path
|
739
|
+
local_var_path = "/api/v1/orders/order_details"
|
740
|
+
|
741
|
+
# query parameters
|
742
|
+
query_params = {}
|
743
|
+
|
744
|
+
# header parameters
|
745
|
+
header_params = {}
|
746
|
+
|
747
|
+
# form parameters
|
748
|
+
form_params = {}
|
749
|
+
|
750
|
+
# http body (model)
|
751
|
+
post_body = @api_client.object_to_http_body(payload)
|
752
|
+
auth_names = ['token']
|
753
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
754
|
+
:header_params => header_params,
|
755
|
+
:query_params => query_params,
|
756
|
+
:form_params => form_params,
|
757
|
+
:body => post_body,
|
758
|
+
:auth_names => auth_names)
|
759
|
+
if @api_client.config.debugging
|
760
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_order_details_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
761
|
+
end
|
762
|
+
return data, status_code, headers
|
763
|
+
end
|
764
|
+
|
765
|
+
# Fetch a single Order
|
766
|
+
#
|
767
|
+
# @param id Order Id
|
768
|
+
# @param [Hash] opts the optional parameters
|
769
|
+
# @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: <br /><b style=\"margin-left: 10px\">financials</b> <p style=\"margin-left: 20px\"> Additional financial data about this order, eg: commission and discount amounts. </p>
|
770
|
+
# @return [Order]
|
771
|
+
def orders_show(id, opts = {})
|
772
|
+
data, _status_code, _headers = orders_show_with_http_info(id, opts)
|
773
|
+
return data
|
774
|
+
end
|
775
|
+
|
776
|
+
# Fetch a single Order
|
777
|
+
#
|
778
|
+
# @param id Order Id
|
779
|
+
# @param [Hash] opts the optional parameters
|
780
|
+
# @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: <br /><b style=\"margin-left: 10px\">financials</b> <p style=\"margin-left: 20px\"> Additional financial data about this order, eg: commission and discount amounts. </p>
|
781
|
+
# @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
|
782
|
+
def orders_show_with_http_info(id, opts = {})
|
783
|
+
if @api_client.config.debugging
|
784
|
+
@api_client.config.logger.debug "Calling API: OrdersApi.orders_show ..."
|
785
|
+
end
|
786
|
+
# verify the required parameter 'id' is set
|
787
|
+
if @api_client.config.client_side_validation && id.nil?
|
788
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_show"
|
789
|
+
end
|
790
|
+
# resource path
|
791
|
+
local_var_path = "/api/v1/orders/{id}".sub('{' + 'id' + '}', id.to_s)
|
792
|
+
|
793
|
+
# query parameters
|
794
|
+
query_params = {}
|
795
|
+
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
|
796
|
+
|
797
|
+
# header parameters
|
798
|
+
header_params = {}
|
799
|
+
|
800
|
+
# form parameters
|
801
|
+
form_params = {}
|
802
|
+
|
803
|
+
# http body (model)
|
804
|
+
post_body = nil
|
805
|
+
auth_names = ['token']
|
806
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
807
|
+
:header_params => header_params,
|
808
|
+
:query_params => query_params,
|
809
|
+
:form_params => form_params,
|
810
|
+
:body => post_body,
|
811
|
+
:auth_names => auth_names,
|
812
|
+
:return_type => 'Order')
|
813
|
+
if @api_client.config.debugging
|
814
|
+
@api_client.config.logger.debug "API called: OrdersApi#orders_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
815
|
+
end
|
816
|
+
return data, status_code, headers
|
817
|
+
end
|
818
|
+
end
|
819
|
+
end
|