aftership-tracking-sdk 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +11 -0
- data/LICENSE +21 -0
- data/README.md +285 -0
- data/aftership-tracking-sdk.gemspec +27 -0
- data/lib/aftership-tracking-sdk/api/courier.rb +163 -0
- data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +67 -0
- data/lib/aftership-tracking-sdk/api/last_checkpoint.rb +143 -0
- data/lib/aftership-tracking-sdk/api/notification.rb +403 -0
- data/lib/aftership-tracking-sdk/api/tracking.rb +793 -0
- data/lib/aftership-tracking-sdk/api_client.rb +426 -0
- data/lib/aftership-tracking-sdk/configuration.rb +122 -0
- data/lib/aftership-tracking-sdk/error.rb +125 -0
- data/lib/aftership-tracking-sdk/models/additional_fields_v1.rb +32 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_tracking.rb +181 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_tracking.rb +161 -0
- data/lib/aftership-tracking-sdk/models/checkpoint.rb +301 -0
- data/lib/aftership-tracking-sdk/models/coordinate_checkpoint.rb +161 -0
- data/lib/aftership-tracking-sdk/models/courier.rb +241 -0
- data/lib/aftership-tracking-sdk/models/courier_response_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_tracking.rb +181 -0
- data/lib/aftership-tracking-sdk/models/custom_fields_tracking_update_tracking_by_slug_tracking_number_request.rb +139 -0
- data/lib/aftership-tracking-sdk/models/data_courier_response_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/data_notification_response_v1.rb +151 -0
- data/lib/aftership-tracking-sdk/models/data_tracking_delete_response_v1.rb +151 -0
- data/lib/aftership-tracking-sdk/models/data_tracking_response_get_multiple_v1.rb +281 -0
- data/lib/aftership-tracking-sdk/models/data_tracking_response_v1.rb +151 -0
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +191 -0
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +191 -0
- data/lib/aftership-tracking-sdk/models/detect_courier_response.rb +161 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_request.rb +221 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_response.rb +261 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_request.rb +181 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_response.rb +191 -0
- data/lib/aftership-tracking-sdk/models/events_checkpoint.rb +161 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_tracking.rb +191 -0
- data/lib/aftership-tracking-sdk/models/get_all_couriers_response.rb +161 -0
- data/lib/aftership-tracking-sdk/models/get_checkpoint_by_slug_tracking_number_response.rb +211 -0
- data/lib/aftership-tracking-sdk/models/get_checkpoint_by_tracking_id_response.rb +211 -0
- data/lib/aftership-tracking-sdk/models/get_trackings_response.rb +161 -0
- data/lib/aftership-tracking-sdk/models/get_user_couriers_response.rb +161 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +191 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +151 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_request.rb +151 -0
- data/lib/aftership-tracking-sdk/models/meta_v1.rb +171 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +171 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_tracking_create_tracking_request.rb +161 -0
- data/lib/aftership-tracking-sdk/models/notification.rb +161 -0
- data/lib/aftership-tracking-sdk/models/notification_request_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/notification_response_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_request.rb +161 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_response.rb +161 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +191 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +191 -0
- data/lib/aftership-tracking-sdk/models/pagination.rb +156 -0
- data/lib/aftership-tracking-sdk/models/partial_delete_tracking.rb +241 -0
- data/lib/aftership-tracking-sdk/models/partial_update_tracking.rb +251 -0
- data/lib/aftership-tracking-sdk/models/predict_batch_request.rb +151 -0
- data/lib/aftership-tracking-sdk/models/predict_batch_response.rb +151 -0
- data/lib/aftership-tracking-sdk/models/reason_events_checkpoint.rb +151 -0
- data/lib/aftership-tracking-sdk/models/slug_group_v1.rb +37 -0
- data/lib/aftership-tracking-sdk/models/tag_v1.rb +34 -0
- data/lib/aftership-tracking-sdk/models/tracking.rb +921 -0
- data/lib/aftership-tracking-sdk/models/tracking_create_tracking_request.rb +551 -0
- data/lib/aftership-tracking-sdk/models/tracking_delete_response_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/tracking_detect_courier_request.rb +261 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +161 -0
- data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_id_request.rb +501 -0
- data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb +391 -0
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_request.rb +161 -0
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_response.rb +161 -0
- data/lib/aftership-tracking-sdk/sign_string.rb +77 -0
- data/lib/aftership-tracking-sdk/version.rb +5 -0
- data/lib/aftership-tracking-sdk.rb +47 -0
- metadata +157 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
# This code was auto generated by AfterShip SDK Generator.
|
|
2
|
+
# Do not edit the class manually.
|
|
3
|
+
require 'cgi'
|
|
4
|
+
|
|
5
|
+
module AftershipAPI
|
|
6
|
+
class TrackingApi
|
|
7
|
+
attr_accessor :api_client
|
|
8
|
+
|
|
9
|
+
def initialize(api_client = ApiClient.default)
|
|
10
|
+
@api_client = api_client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# create_tracking
|
|
14
|
+
# Create a tracking.<div style="visibility:hidden; height: 0"></div>
|
|
15
|
+
|
|
16
|
+
# @param body [Model::TrackingCreateTrackingRequest]
|
|
17
|
+
# @param [Hash] opts the optional parameters
|
|
18
|
+
# @return [Model::Tracking]
|
|
19
|
+
def create_tracking(body:, opts: {})
|
|
20
|
+
if "tracking" != ""
|
|
21
|
+
body = { :'tracking' => body }
|
|
22
|
+
end
|
|
23
|
+
opts[:body] = body
|
|
24
|
+
data, _status_code, _headers = create_tracking_with_http_info(opts: opts)
|
|
25
|
+
data
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def create_tracking_with_http_info(opts: {})
|
|
29
|
+
if @api_client.config.debugging
|
|
30
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.create_tracking ...'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# resource path
|
|
36
|
+
local_var_path = "/tracking/2024-04/trackings"
|
|
37
|
+
method = :'POST'
|
|
38
|
+
|
|
39
|
+
# query parameters
|
|
40
|
+
query_params = opts[:query_params] || {}
|
|
41
|
+
# header parameters
|
|
42
|
+
header_params = opts[:header_params] || {}
|
|
43
|
+
|
|
44
|
+
# http body (model)
|
|
45
|
+
post_body = opts[:body]
|
|
46
|
+
|
|
47
|
+
# return_type
|
|
48
|
+
return_type = 'Tracking'
|
|
49
|
+
|
|
50
|
+
new_options = opts.merge(
|
|
51
|
+
:operation => :"TrackingApi.create_tracking",
|
|
52
|
+
:header_params => header_params,
|
|
53
|
+
:query_params => query_params,
|
|
54
|
+
:body => post_body,
|
|
55
|
+
:return_type => return_type,
|
|
56
|
+
:response_legacy_tag => "tracking",
|
|
57
|
+
:is_paging => false
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
61
|
+
if @api_client.config.debugging
|
|
62
|
+
@api_client.config.logger.debug "API called: TrackingApi#create_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
63
|
+
end
|
|
64
|
+
return data, status_code, headers
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# delete_tracking_by_id
|
|
68
|
+
# Delete a tracking.
|
|
69
|
+
# @param id [String] tracking ID
|
|
70
|
+
# @param [Hash] opts the optional parameters
|
|
71
|
+
# @return [Model::PartialDeleteTracking]
|
|
72
|
+
def delete_tracking_by_id(id:, opts: {})
|
|
73
|
+
data, _status_code, _headers = delete_tracking_by_id_with_http_info(id: id, opts: opts)
|
|
74
|
+
data
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def delete_tracking_by_id_with_http_info(id:, opts: {})
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.delete_tracking_by_id ...'
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if id.nil? || (id.to_s == '')
|
|
83
|
+
raise InvalidParamError.new "id cannot be nil or empty"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# resource path
|
|
88
|
+
local_var_path = "/tracking/2024-04/trackings/#{id}"
|
|
89
|
+
method = :'DELETE'
|
|
90
|
+
|
|
91
|
+
# query parameters
|
|
92
|
+
query_params = opts[:query_params] || {}
|
|
93
|
+
# header parameters
|
|
94
|
+
header_params = opts[:header_params] || {}
|
|
95
|
+
|
|
96
|
+
# http body (model)
|
|
97
|
+
post_body = opts[:body]
|
|
98
|
+
|
|
99
|
+
# return_type
|
|
100
|
+
return_type = 'PartialDeleteTracking'
|
|
101
|
+
|
|
102
|
+
new_options = opts.merge(
|
|
103
|
+
:operation => :"TrackingApi.delete_tracking_by_id",
|
|
104
|
+
:header_params => header_params,
|
|
105
|
+
:query_params => query_params,
|
|
106
|
+
:body => post_body,
|
|
107
|
+
:return_type => return_type,
|
|
108
|
+
:response_legacy_tag => "tracking",
|
|
109
|
+
:is_paging => false
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug "API called: TrackingApi#delete_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
115
|
+
end
|
|
116
|
+
return data, status_code, headers
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# delete_tracking_by_slug_tracking_number
|
|
120
|
+
# Delete a tracking.
|
|
121
|
+
# @param slug [String] Tracking slug
|
|
122
|
+
# @param tracking_number [String] Tracking number
|
|
123
|
+
# @param [Hash] opts the optional parameters
|
|
124
|
+
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
|
125
|
+
# @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
|
|
126
|
+
# @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
|
|
127
|
+
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
|
128
|
+
# @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
|
|
129
|
+
# @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
|
|
130
|
+
# @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
|
|
131
|
+
# @return [Model::PartialDeleteTracking]
|
|
132
|
+
def delete_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
|
133
|
+
data, _status_code, _headers = delete_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
|
134
|
+
data
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def delete_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
|
138
|
+
if @api_client.config.debugging
|
|
139
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.delete_tracking_by_slug_tracking_number ...'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if slug.nil? || (slug.to_s == '')
|
|
143
|
+
raise InvalidParamError.new "slug cannot be nil or empty"
|
|
144
|
+
end
|
|
145
|
+
if tracking_number.nil? || (tracking_number.to_s == '')
|
|
146
|
+
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# resource path
|
|
151
|
+
local_var_path = "/tracking/2024-04/trackings/#{slug}/#{tracking_number}"
|
|
152
|
+
method = :'DELETE'
|
|
153
|
+
|
|
154
|
+
# query parameters
|
|
155
|
+
query_params = opts[:query_params] || {}
|
|
156
|
+
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
|
157
|
+
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
|
158
|
+
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
|
159
|
+
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
|
160
|
+
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
|
161
|
+
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
|
162
|
+
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
|
163
|
+
# header parameters
|
|
164
|
+
header_params = opts[:header_params] || {}
|
|
165
|
+
|
|
166
|
+
# http body (model)
|
|
167
|
+
post_body = opts[:body]
|
|
168
|
+
|
|
169
|
+
# return_type
|
|
170
|
+
return_type = 'PartialDeleteTracking'
|
|
171
|
+
|
|
172
|
+
new_options = opts.merge(
|
|
173
|
+
:operation => :"TrackingApi.delete_tracking_by_slug_tracking_number",
|
|
174
|
+
:header_params => header_params,
|
|
175
|
+
:query_params => query_params,
|
|
176
|
+
:body => post_body,
|
|
177
|
+
:return_type => return_type,
|
|
178
|
+
:response_legacy_tag => "tracking",
|
|
179
|
+
:is_paging => false
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
183
|
+
if @api_client.config.debugging
|
|
184
|
+
@api_client.config.logger.debug "API called: TrackingApi#delete_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
185
|
+
end
|
|
186
|
+
return data, status_code, headers
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# get_tracking_by_id
|
|
190
|
+
# Get tracking results of a single tracking.
|
|
191
|
+
# @param id [String] tracking ID
|
|
192
|
+
# @param [Hash] opts the optional parameters
|
|
193
|
+
# @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `tracking_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `tracking_origin_country`, `tracking_destination_country`, `tracking_state`, `title`, `order_id`, `tag`, `checkpoints`
|
|
194
|
+
# @option opts [String] :lang Translate checkpoint messages from the carrier’s provided language to the target language. Supported target languages include:</br> - English (en)</br> - French (fr)</br> - French Canadian (fr-CA)</br> - Arabic (ar)</br> - Bulgarian (bg)</br> - Catalan (ca)</br> - Croatian (hr)</br> - Czech (cs)</br> - Danish (da)</br> - Dutch (nl)</br> - Estonian (et)</br> - Filipino (tl)</br> - Finnish (fi)</br> - German (de)</br> - Greek (el)</br> - Hebrew (he)</br> - Hindi (hi)</br> - Hungarian (hu)</br> - Indonesian (id)</br> - Italian (it)</br> - Japanese (ja)</br> - Korean (ko)</br> - Latvian (lv)</br> - Lithuanian (lt)</br> - Malay (ms)</br> - Polish (pl)</br> - Portuguese (pt)</br> - Romanian (ro)</br> - Russian (ru)</br> - Serbian (sr)</br> - Slovak (sk)</br> - Slovenian (sl)</br> - Spanish (es)</br> - Swedish (sv)</br> - Thai (th)</br> - Turkish (tr)</br> - Ukrainian (uk)</br> - Vietnamese (vi)</br> - Simplified Chinese (zh-Hans)</br> - Traditional Chinese (zh-Hant)</br> - Norwegian (nb)</br>
|
|
195
|
+
# @return [Model::Tracking]
|
|
196
|
+
def get_tracking_by_id(id:, opts: {})
|
|
197
|
+
data, _status_code, _headers = get_tracking_by_id_with_http_info(id: id, opts: opts)
|
|
198
|
+
data
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def get_tracking_by_id_with_http_info(id:, opts: {})
|
|
202
|
+
if @api_client.config.debugging
|
|
203
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.get_tracking_by_id ...'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if id.nil? || (id.to_s == '')
|
|
207
|
+
raise InvalidParamError.new "id cannot be nil or empty"
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
# resource path
|
|
212
|
+
local_var_path = "/tracking/2024-04/trackings/#{id}"
|
|
213
|
+
method = :'GET'
|
|
214
|
+
|
|
215
|
+
# query parameters
|
|
216
|
+
query_params = opts[:query_params] || {}
|
|
217
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
|
218
|
+
query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
|
|
219
|
+
# header parameters
|
|
220
|
+
header_params = opts[:header_params] || {}
|
|
221
|
+
|
|
222
|
+
# http body (model)
|
|
223
|
+
post_body = opts[:body]
|
|
224
|
+
|
|
225
|
+
# return_type
|
|
226
|
+
return_type = 'Tracking'
|
|
227
|
+
|
|
228
|
+
new_options = opts.merge(
|
|
229
|
+
:operation => :"TrackingApi.get_tracking_by_id",
|
|
230
|
+
:header_params => header_params,
|
|
231
|
+
:query_params => query_params,
|
|
232
|
+
:body => post_body,
|
|
233
|
+
:return_type => return_type,
|
|
234
|
+
:response_legacy_tag => "tracking",
|
|
235
|
+
:is_paging => false
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
239
|
+
if @api_client.config.debugging
|
|
240
|
+
@api_client.config.logger.debug "API called: TrackingApi#get_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
241
|
+
end
|
|
242
|
+
return data, status_code, headers
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# get_tracking_by_slug_tracking_number
|
|
246
|
+
# Get tracking results of a single tracking.
|
|
247
|
+
# @param slug [String] Tracking slug
|
|
248
|
+
# @param tracking_number [String] Tracking number
|
|
249
|
+
# @param [Hash] opts the optional parameters
|
|
250
|
+
# @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `tracking_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `tracking_origin_country`, `tracking_destination_country`, `tracking_state`, `title`, `order_id`, `tag`, `checkpoints`
|
|
251
|
+
# @option opts [String] :lang Support Chinese to English translation for `china-ems` and `china-post` only
|
|
252
|
+
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
|
253
|
+
# @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
|
|
254
|
+
# @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
|
|
255
|
+
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
|
256
|
+
# @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
|
|
257
|
+
# @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
|
|
258
|
+
# @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
|
|
259
|
+
# @return [Model::Tracking]
|
|
260
|
+
def get_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
|
261
|
+
data, _status_code, _headers = get_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
|
262
|
+
data
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def get_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
|
266
|
+
if @api_client.config.debugging
|
|
267
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.get_tracking_by_slug_tracking_number ...'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if slug.nil? || (slug.to_s == '')
|
|
271
|
+
raise InvalidParamError.new "slug cannot be nil or empty"
|
|
272
|
+
end
|
|
273
|
+
if tracking_number.nil? || (tracking_number.to_s == '')
|
|
274
|
+
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
# resource path
|
|
279
|
+
local_var_path = "/tracking/2024-04/trackings/#{slug}/#{tracking_number}"
|
|
280
|
+
method = :'GET'
|
|
281
|
+
|
|
282
|
+
# query parameters
|
|
283
|
+
query_params = opts[:query_params] || {}
|
|
284
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
|
285
|
+
query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
|
|
286
|
+
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
|
287
|
+
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
|
288
|
+
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
|
289
|
+
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
|
290
|
+
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
|
291
|
+
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
|
292
|
+
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
|
293
|
+
# header parameters
|
|
294
|
+
header_params = opts[:header_params] || {}
|
|
295
|
+
|
|
296
|
+
# http body (model)
|
|
297
|
+
post_body = opts[:body]
|
|
298
|
+
|
|
299
|
+
# return_type
|
|
300
|
+
return_type = 'Tracking'
|
|
301
|
+
|
|
302
|
+
new_options = opts.merge(
|
|
303
|
+
:operation => :"TrackingApi.get_tracking_by_slug_tracking_number",
|
|
304
|
+
:header_params => header_params,
|
|
305
|
+
:query_params => query_params,
|
|
306
|
+
:body => post_body,
|
|
307
|
+
:return_type => return_type,
|
|
308
|
+
:response_legacy_tag => "tracking",
|
|
309
|
+
:is_paging => false
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
313
|
+
if @api_client.config.debugging
|
|
314
|
+
@api_client.config.logger.debug "API called: TrackingApi#get_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
315
|
+
end
|
|
316
|
+
return data, status_code, headers
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# get_trackings
|
|
320
|
+
# Get tracking results of multiple trackings.<div style="visibility:hidden; height: 0"></div>
|
|
321
|
+
# @param [Hash] opts the optional parameters
|
|
322
|
+
# @option opts [Integer] :page The page to query. Maximum page number is bounded by total number of queried trackings which cannot exceed 160,000 trackings. (Default: 1)
|
|
323
|
+
# @option opts [Integer] :limit Number of trackings each page contain. (Default: 100, Max: 200)
|
|
324
|
+
# @option opts [String] :keyword Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customer_name`, `custom_fields`, `emails`, `smses`
|
|
325
|
+
# @option opts [String] :tracking_numbers Tracking number of shipments. Use comma to separate multiple values (Example: RA123456789US,LE123456789US). Supports up to 50 tracking numbers.
|
|
326
|
+
# @option opts [String] :slug Unique courier code Use comma for multiple values. (Example: dhl,ups,usps)
|
|
327
|
+
# @option opts [Integer] :transit_time Total delivery time in days.- When the shipment is delivered: Transit time = Delivered date - Picked up date- When the shipment is not delivered: Transit time = Current date - Picked up dateValue as `null` for the shipment without pickup date.
|
|
328
|
+
# @option opts [String] :origin Origin country/region of trackings. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
|
|
329
|
+
# @option opts [String] :destination Destination country/region of trackings. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
|
|
330
|
+
# @option opts [String] :tag Current status of tracking. Values include `Pending`, `InfoReceived`, `InTransit`, `OutForDelivery`, `AttemptFail`, `Delivered`, `AvailableForPickup`, `Exception`, `Expired` (See tag definition)
|
|
331
|
+
# @option opts [String] :created_at_min Start date and time of trackings created. AfterShip only stores data of 120 days.(Defaults: 30 days ago, Example: 2013-03-15T16:41:56+08:00)
|
|
332
|
+
# @option opts [String] :created_at_max End date and time of trackings created.(Defaults: now, Example: 2013-04-15T16:41:56+08:00)
|
|
333
|
+
# @option opts [String] :updated_at_min Start date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00)
|
|
334
|
+
# @option opts [String] :updated_at_max End date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00)
|
|
335
|
+
# @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Available options: `title`, `order_id`, `tag`, `checkpoints`. Example: `title,order_id`
|
|
336
|
+
# @option opts [String] :return_to_sender Select return to sender, the value should be `true` or `false`, with optional comma separated.
|
|
337
|
+
# @option opts [String] :courier_destination_country_iso3 Destination country/region of trackings returned by courier. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
|
|
338
|
+
# @option opts [String] :shipment_tags Tags you added to your shipments to help categorize and filter them easily. Use a comma to separate multiple values (Example: a,b)
|
|
339
|
+
# @option opts [String] :order_id A globally-unique identifier for the order. Use comma for multiple values.(Example: 6845a095a27a4caeb27487806f058add,4845a095a27a4caeb27487806f058abc)
|
|
340
|
+
# @return [Model::GetTrackingsResponse]
|
|
341
|
+
def get_trackings(opts: {})
|
|
342
|
+
data, _status_code, _headers = get_trackings_with_http_info(opts: opts)
|
|
343
|
+
data
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
def get_trackings_with_http_info(opts: {})
|
|
347
|
+
if @api_client.config.debugging
|
|
348
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.get_trackings ...'
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
# resource path
|
|
354
|
+
local_var_path = "/tracking/2024-04/trackings"
|
|
355
|
+
method = :'GET'
|
|
356
|
+
|
|
357
|
+
# query parameters
|
|
358
|
+
query_params = opts[:query_params] || {}
|
|
359
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
360
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
361
|
+
query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
|
|
362
|
+
query_params[:'tracking_numbers'] = opts[:'tracking_numbers'] if !opts[:'tracking_numbers'].nil?
|
|
363
|
+
query_params[:'slug'] = opts[:'slug'] if !opts[:'slug'].nil?
|
|
364
|
+
query_params[:'transit_time'] = opts[:'transit_time'] if !opts[:'transit_time'].nil?
|
|
365
|
+
query_params[:'origin'] = opts[:'origin'] if !opts[:'origin'].nil?
|
|
366
|
+
query_params[:'destination'] = opts[:'destination'] if !opts[:'destination'].nil?
|
|
367
|
+
query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
|
|
368
|
+
query_params[:'created_at_min'] = opts[:'created_at_min'] if !opts[:'created_at_min'].nil?
|
|
369
|
+
query_params[:'created_at_max'] = opts[:'created_at_max'] if !opts[:'created_at_max'].nil?
|
|
370
|
+
query_params[:'updated_at_min'] = opts[:'updated_at_min'] if !opts[:'updated_at_min'].nil?
|
|
371
|
+
query_params[:'updated_at_max'] = opts[:'updated_at_max'] if !opts[:'updated_at_max'].nil?
|
|
372
|
+
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
|
373
|
+
query_params[:'return_to_sender'] = opts[:'return_to_sender'] if !opts[:'return_to_sender'].nil?
|
|
374
|
+
query_params[:'courier_destination_country_iso3'] = opts[:'courier_destination_country_iso3'] if !opts[:'courier_destination_country_iso3'].nil?
|
|
375
|
+
query_params[:'shipment_tags'] = opts[:'shipment_tags'] if !opts[:'shipment_tags'].nil?
|
|
376
|
+
query_params[:'order_id'] = opts[:'order_id'] if !opts[:'order_id'].nil?
|
|
377
|
+
# header parameters
|
|
378
|
+
header_params = opts[:header_params] || {}
|
|
379
|
+
|
|
380
|
+
# http body (model)
|
|
381
|
+
post_body = opts[:body]
|
|
382
|
+
|
|
383
|
+
# return_type
|
|
384
|
+
return_type = 'GetTrackingsResponse'
|
|
385
|
+
|
|
386
|
+
new_options = opts.merge(
|
|
387
|
+
:operation => :"TrackingApi.get_trackings",
|
|
388
|
+
:header_params => header_params,
|
|
389
|
+
:query_params => query_params,
|
|
390
|
+
:body => post_body,
|
|
391
|
+
:return_type => return_type,
|
|
392
|
+
:response_legacy_tag => "trackings",
|
|
393
|
+
:is_paging => true
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
397
|
+
if @api_client.config.debugging
|
|
398
|
+
@api_client.config.logger.debug "API called: TrackingApi#get_trackings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
399
|
+
end
|
|
400
|
+
return data, status_code, headers
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# mark_tracking_completed_by_id
|
|
404
|
+
# Mark a tracking as completed. The tracking won't auto update until retrack it.
|
|
405
|
+
# @param id [String] tracking id
|
|
406
|
+
|
|
407
|
+
# @param body [Model::MarkTrackingCompletedByIdRequest]
|
|
408
|
+
# @param [Hash] opts the optional parameters
|
|
409
|
+
# @return [Model::Tracking]
|
|
410
|
+
def mark_tracking_completed_by_id(id:, body:, opts: {})
|
|
411
|
+
if "" != ""
|
|
412
|
+
body = { :'' => body }
|
|
413
|
+
end
|
|
414
|
+
opts[:body] = body
|
|
415
|
+
data, _status_code, _headers = mark_tracking_completed_by_id_with_http_info(id: id, opts: opts)
|
|
416
|
+
data
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
def mark_tracking_completed_by_id_with_http_info(id:, opts: {})
|
|
420
|
+
if @api_client.config.debugging
|
|
421
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.mark_tracking_completed_by_id ...'
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
if id.nil? || (id.to_s == '')
|
|
425
|
+
raise InvalidParamError.new "id cannot be nil or empty"
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
# resource path
|
|
430
|
+
local_var_path = "/tracking/2024-04/trackings/#{id}/mark-as-completed"
|
|
431
|
+
method = :'POST'
|
|
432
|
+
|
|
433
|
+
# query parameters
|
|
434
|
+
query_params = opts[:query_params] || {}
|
|
435
|
+
# header parameters
|
|
436
|
+
header_params = opts[:header_params] || {}
|
|
437
|
+
|
|
438
|
+
# http body (model)
|
|
439
|
+
post_body = opts[:body]
|
|
440
|
+
|
|
441
|
+
# return_type
|
|
442
|
+
return_type = 'Tracking'
|
|
443
|
+
|
|
444
|
+
new_options = opts.merge(
|
|
445
|
+
:operation => :"TrackingApi.mark_tracking_completed_by_id",
|
|
446
|
+
:header_params => header_params,
|
|
447
|
+
:query_params => query_params,
|
|
448
|
+
:body => post_body,
|
|
449
|
+
:return_type => return_type,
|
|
450
|
+
:response_legacy_tag => "tracking",
|
|
451
|
+
:is_paging => false
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
455
|
+
if @api_client.config.debugging
|
|
456
|
+
@api_client.config.logger.debug "API called: TrackingApi#mark_tracking_completed_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
457
|
+
end
|
|
458
|
+
return data, status_code, headers
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
# mark_tracking_completed_by_slug_tracking_number
|
|
462
|
+
# Mark a tracking as completed. The tracking won't auto update until retrack it.
|
|
463
|
+
# @param slug [String] Tracking slug
|
|
464
|
+
# @param tracking_number [String] Tracking number
|
|
465
|
+
|
|
466
|
+
# @param body [Model::MarkTrackingCompletedBySlugTrackingNumberRequest]
|
|
467
|
+
# @param [Hash] opts the optional parameters
|
|
468
|
+
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
|
469
|
+
# @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
|
|
470
|
+
# @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
|
|
471
|
+
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
|
472
|
+
# @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
|
|
473
|
+
# @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
|
|
474
|
+
# @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
|
|
475
|
+
# @return [Model::Tracking]
|
|
476
|
+
def mark_tracking_completed_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
|
|
477
|
+
if "" != ""
|
|
478
|
+
body = { :'' => body }
|
|
479
|
+
end
|
|
480
|
+
opts[:body] = body
|
|
481
|
+
data, _status_code, _headers = mark_tracking_completed_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
|
482
|
+
data
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
def mark_tracking_completed_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
|
486
|
+
if @api_client.config.debugging
|
|
487
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.mark_tracking_completed_by_slug_tracking_number ...'
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
if slug.nil? || (slug.to_s == '')
|
|
491
|
+
raise InvalidParamError.new "slug cannot be nil or empty"
|
|
492
|
+
end
|
|
493
|
+
if tracking_number.nil? || (tracking_number.to_s == '')
|
|
494
|
+
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
# resource path
|
|
499
|
+
local_var_path = "/tracking/2024-04/trackings/#{slug}/#{tracking_number}/mark-as-completed"
|
|
500
|
+
method = :'POST'
|
|
501
|
+
|
|
502
|
+
# query parameters
|
|
503
|
+
query_params = opts[:query_params] || {}
|
|
504
|
+
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
|
505
|
+
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
|
506
|
+
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
|
507
|
+
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
|
508
|
+
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
|
509
|
+
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
|
510
|
+
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
|
511
|
+
# header parameters
|
|
512
|
+
header_params = opts[:header_params] || {}
|
|
513
|
+
|
|
514
|
+
# http body (model)
|
|
515
|
+
post_body = opts[:body]
|
|
516
|
+
|
|
517
|
+
# return_type
|
|
518
|
+
return_type = 'Tracking'
|
|
519
|
+
|
|
520
|
+
new_options = opts.merge(
|
|
521
|
+
:operation => :"TrackingApi.mark_tracking_completed_by_slug_tracking_number",
|
|
522
|
+
:header_params => header_params,
|
|
523
|
+
:query_params => query_params,
|
|
524
|
+
:body => post_body,
|
|
525
|
+
:return_type => return_type,
|
|
526
|
+
:response_legacy_tag => "tracking",
|
|
527
|
+
:is_paging => false
|
|
528
|
+
)
|
|
529
|
+
|
|
530
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
531
|
+
if @api_client.config.debugging
|
|
532
|
+
@api_client.config.logger.debug "API called: TrackingApi#mark_tracking_completed_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
533
|
+
end
|
|
534
|
+
return data, status_code, headers
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
# retrack_tracking_by_id
|
|
538
|
+
# Retrack an expired tracking. Max 3 times per tracking.
|
|
539
|
+
# @param id [String] tracking id
|
|
540
|
+
# @param [Hash] opts the optional parameters
|
|
541
|
+
# @return [Model::PartialUpdateTracking]
|
|
542
|
+
def retrack_tracking_by_id(id:, opts: {})
|
|
543
|
+
data, _status_code, _headers = retrack_tracking_by_id_with_http_info(id: id, opts: opts)
|
|
544
|
+
data
|
|
545
|
+
end
|
|
546
|
+
|
|
547
|
+
def retrack_tracking_by_id_with_http_info(id:, opts: {})
|
|
548
|
+
if @api_client.config.debugging
|
|
549
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.retrack_tracking_by_id ...'
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
if id.nil? || (id.to_s == '')
|
|
553
|
+
raise InvalidParamError.new "id cannot be nil or empty"
|
|
554
|
+
end
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
# resource path
|
|
558
|
+
local_var_path = "/tracking/2024-04/trackings/#{id}/retrack"
|
|
559
|
+
method = :'POST'
|
|
560
|
+
|
|
561
|
+
# query parameters
|
|
562
|
+
query_params = opts[:query_params] || {}
|
|
563
|
+
# header parameters
|
|
564
|
+
header_params = opts[:header_params] || {}
|
|
565
|
+
|
|
566
|
+
# http body (model)
|
|
567
|
+
post_body = opts[:body]
|
|
568
|
+
|
|
569
|
+
# return_type
|
|
570
|
+
return_type = 'PartialUpdateTracking'
|
|
571
|
+
|
|
572
|
+
new_options = opts.merge(
|
|
573
|
+
:operation => :"TrackingApi.retrack_tracking_by_id",
|
|
574
|
+
:header_params => header_params,
|
|
575
|
+
:query_params => query_params,
|
|
576
|
+
:body => post_body,
|
|
577
|
+
:return_type => return_type,
|
|
578
|
+
:response_legacy_tag => "tracking",
|
|
579
|
+
:is_paging => false
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
583
|
+
if @api_client.config.debugging
|
|
584
|
+
@api_client.config.logger.debug "API called: TrackingApi#retrack_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
585
|
+
end
|
|
586
|
+
return data, status_code, headers
|
|
587
|
+
end
|
|
588
|
+
|
|
589
|
+
# retrack_tracking_by_slug_tracking_number
|
|
590
|
+
# Retrack an expired tracking. Max 3 times per tracking.
|
|
591
|
+
# @param slug [String] Tracking slug
|
|
592
|
+
# @param tracking_number [String] Tracking number
|
|
593
|
+
# @param [Hash] opts the optional parameters
|
|
594
|
+
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
|
595
|
+
# @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
|
|
596
|
+
# @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
|
|
597
|
+
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
|
598
|
+
# @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
|
|
599
|
+
# @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
|
|
600
|
+
# @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
|
|
601
|
+
# @return [Model::PartialUpdateTracking]
|
|
602
|
+
def retrack_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
|
603
|
+
data, _status_code, _headers = retrack_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
|
604
|
+
data
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
def retrack_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
|
608
|
+
if @api_client.config.debugging
|
|
609
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.retrack_tracking_by_slug_tracking_number ...'
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
if slug.nil? || (slug.to_s == '')
|
|
613
|
+
raise InvalidParamError.new "slug cannot be nil or empty"
|
|
614
|
+
end
|
|
615
|
+
if tracking_number.nil? || (tracking_number.to_s == '')
|
|
616
|
+
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
# resource path
|
|
621
|
+
local_var_path = "/tracking/2024-04/trackings/#{slug}/#{tracking_number}/retrack"
|
|
622
|
+
method = :'POST'
|
|
623
|
+
|
|
624
|
+
# query parameters
|
|
625
|
+
query_params = opts[:query_params] || {}
|
|
626
|
+
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
|
627
|
+
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
|
628
|
+
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
|
629
|
+
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
|
630
|
+
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
|
631
|
+
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
|
632
|
+
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
|
633
|
+
# header parameters
|
|
634
|
+
header_params = opts[:header_params] || {}
|
|
635
|
+
|
|
636
|
+
# http body (model)
|
|
637
|
+
post_body = opts[:body]
|
|
638
|
+
|
|
639
|
+
# return_type
|
|
640
|
+
return_type = 'PartialUpdateTracking'
|
|
641
|
+
|
|
642
|
+
new_options = opts.merge(
|
|
643
|
+
:operation => :"TrackingApi.retrack_tracking_by_slug_tracking_number",
|
|
644
|
+
:header_params => header_params,
|
|
645
|
+
:query_params => query_params,
|
|
646
|
+
:body => post_body,
|
|
647
|
+
:return_type => return_type,
|
|
648
|
+
:response_legacy_tag => "tracking",
|
|
649
|
+
:is_paging => false
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
653
|
+
if @api_client.config.debugging
|
|
654
|
+
@api_client.config.logger.debug "API called: TrackingApi#retrack_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
655
|
+
end
|
|
656
|
+
return data, status_code, headers
|
|
657
|
+
end
|
|
658
|
+
|
|
659
|
+
# update_tracking_by_id
|
|
660
|
+
# Update a tracking.
|
|
661
|
+
# @param id [String] tracking ID
|
|
662
|
+
|
|
663
|
+
# @param body [Model::TrackingUpdateTrackingByIdRequest]
|
|
664
|
+
# @param [Hash] opts the optional parameters
|
|
665
|
+
# @return [Model::Tracking]
|
|
666
|
+
def update_tracking_by_id(id:, body:, opts: {})
|
|
667
|
+
if "tracking" != ""
|
|
668
|
+
body = { :'tracking' => body }
|
|
669
|
+
end
|
|
670
|
+
opts[:body] = body
|
|
671
|
+
data, _status_code, _headers = update_tracking_by_id_with_http_info(id: id, opts: opts)
|
|
672
|
+
data
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
def update_tracking_by_id_with_http_info(id:, opts: {})
|
|
676
|
+
if @api_client.config.debugging
|
|
677
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.update_tracking_by_id ...'
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
if id.nil? || (id.to_s == '')
|
|
681
|
+
raise InvalidParamError.new "id cannot be nil or empty"
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
# resource path
|
|
686
|
+
local_var_path = "/tracking/2024-04/trackings/#{id}"
|
|
687
|
+
method = :'PUT'
|
|
688
|
+
|
|
689
|
+
# query parameters
|
|
690
|
+
query_params = opts[:query_params] || {}
|
|
691
|
+
# header parameters
|
|
692
|
+
header_params = opts[:header_params] || {}
|
|
693
|
+
|
|
694
|
+
# http body (model)
|
|
695
|
+
post_body = opts[:body]
|
|
696
|
+
|
|
697
|
+
# return_type
|
|
698
|
+
return_type = 'Tracking'
|
|
699
|
+
|
|
700
|
+
new_options = opts.merge(
|
|
701
|
+
:operation => :"TrackingApi.update_tracking_by_id",
|
|
702
|
+
:header_params => header_params,
|
|
703
|
+
:query_params => query_params,
|
|
704
|
+
:body => post_body,
|
|
705
|
+
:return_type => return_type,
|
|
706
|
+
:response_legacy_tag => "tracking",
|
|
707
|
+
:is_paging => false
|
|
708
|
+
)
|
|
709
|
+
|
|
710
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
711
|
+
if @api_client.config.debugging
|
|
712
|
+
@api_client.config.logger.debug "API called: TrackingApi#update_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
713
|
+
end
|
|
714
|
+
return data, status_code, headers
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
# update_tracking_by_slug_tracking_number
|
|
718
|
+
# Update a tracking.
|
|
719
|
+
# @param slug [String] Tracking slug
|
|
720
|
+
# @param tracking_number [String] Tracking number
|
|
721
|
+
|
|
722
|
+
# @param body [Model::TrackingUpdateTrackingBySlugTrackingNumberRequest]
|
|
723
|
+
# @param [Hash] opts the optional parameters
|
|
724
|
+
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
|
725
|
+
# @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
|
|
726
|
+
# @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
|
|
727
|
+
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
|
728
|
+
# @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
|
|
729
|
+
# @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
|
|
730
|
+
# @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
|
|
731
|
+
# @return [Model::Tracking]
|
|
732
|
+
def update_tracking_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
|
|
733
|
+
if "tracking" != ""
|
|
734
|
+
body = { :'tracking' => body }
|
|
735
|
+
end
|
|
736
|
+
opts[:body] = body
|
|
737
|
+
data, _status_code, _headers = update_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
|
738
|
+
data
|
|
739
|
+
end
|
|
740
|
+
|
|
741
|
+
def update_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
|
742
|
+
if @api_client.config.debugging
|
|
743
|
+
@api_client.config.logger.debug 'Calling API: TrackingApi.update_tracking_by_slug_tracking_number ...'
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
if slug.nil? || (slug.to_s == '')
|
|
747
|
+
raise InvalidParamError.new "slug cannot be nil or empty"
|
|
748
|
+
end
|
|
749
|
+
if tracking_number.nil? || (tracking_number.to_s == '')
|
|
750
|
+
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
# resource path
|
|
755
|
+
local_var_path = "/tracking/2024-04/trackings/#{slug}/#{tracking_number}"
|
|
756
|
+
method = :'PUT'
|
|
757
|
+
|
|
758
|
+
# query parameters
|
|
759
|
+
query_params = opts[:query_params] || {}
|
|
760
|
+
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
|
761
|
+
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
|
762
|
+
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
|
763
|
+
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
|
764
|
+
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
|
765
|
+
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
|
766
|
+
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
|
767
|
+
# header parameters
|
|
768
|
+
header_params = opts[:header_params] || {}
|
|
769
|
+
|
|
770
|
+
# http body (model)
|
|
771
|
+
post_body = opts[:body]
|
|
772
|
+
|
|
773
|
+
# return_type
|
|
774
|
+
return_type = 'Tracking'
|
|
775
|
+
|
|
776
|
+
new_options = opts.merge(
|
|
777
|
+
:operation => :"TrackingApi.update_tracking_by_slug_tracking_number",
|
|
778
|
+
:header_params => header_params,
|
|
779
|
+
:query_params => query_params,
|
|
780
|
+
:body => post_body,
|
|
781
|
+
:return_type => return_type,
|
|
782
|
+
:response_legacy_tag => "tracking",
|
|
783
|
+
:is_paging => false
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
|
787
|
+
if @api_client.config.debugging
|
|
788
|
+
@api_client.config.logger.debug "API called: TrackingApi#update_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
789
|
+
end
|
|
790
|
+
return data, status_code, headers
|
|
791
|
+
end
|
|
792
|
+
end
|
|
793
|
+
end
|