This repository has been archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
model-logistics.go
304 lines (276 loc) Β· 15 KB
/
model-logistics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
package shopeego
type GetLogisticsRequest struct {
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetLogisticsResponse struct {
Logistics []GetLogisticsResponseLogistic `json:"logistics,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateShopLogisticsRequest struct {
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// The identity of logistic channel
LogisticID int64 `json:"logistic_id,omitempty"`
// Whether to enable this logistic channel
Enabled bool `json:"enabled,omitempty"`
// Whether to make this logistic channel preferred. Indonestia logistics channel are not applicable.
Preferred bool `json:"preferred,omitempty"`
// Whether to enable COD for this logistic channel. Only COD supported channels are applicable.
COD bool `json:"cod,omitempty"`
}
type UpdateShopLogisticsResponse struct {
// Shopee's unique identifier for a shop.
ShopID int64 `json:"shopid,omitempty"`
// The identity of logistic channel
LogisticID int64 `json:"logistic_id,omitempty"`
// Whether this logistic channel is enabled
Enabled bool `json:"enabled,omitempty"`
// Whether this logistic channel is preferred
Preferred bool `json:"preferred,omitempty"`
// WHether COD is enabled for this channel
COD bool `json:"cod,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetParameterForInitRequest struct {
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// The serial numbers of the order needs to be initiated logistic.
OrderSN string `json:"ordersn,omitempty"`
}
type GetParameterForInitResponse struct {
// Could contain 'address_id', 'pickup_time_id'. If it contains 'address_id', should call shopee.logistics.GetAddress to get address list, then choose one of the address to init logistic. If it contains pickup_time_id, should call shopee.logistics.GetTimeSlot to get timeslot list, then choose one of the time to init logistic. If it has empty value, developer should still include "pickup" field in Init API.
Pickup []string `json:"pickup,omitempty"`
// Could contain 'branch_id', 'sender_real_name' or 'tracking_no'. If it contains 'branch_id', should call shopee.logistics.GetBranch to get branch list. If it contains 'sender_real_name' or 'tracking_no', should manually input these values in Init API. If it has empty value, developer should still include "dropoff" field in Init API.
Dropoff []string `json:"dropoff,omitempty"`
// Could contain 'tracking_no'. If it contains 'tracking_no', should manually input these values in Init API. If it has empty value, developer should still include "non-integrated" field in Init API.
NonIntegrated []string `json:"non_integrated_[],omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetAddressRequest struct {
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetAddressResponse struct {
// All pickup address that you can choose.
AddressList []GetAddressResponseAddress `json:"address_list,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetTimeSlotRequest struct {
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// The identify of address.
AddressID int64 `json:"address_id,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetTimeSlotResponse struct {
//
PickupTime []GetTimeSlotResponseTime `json:"pickup_time,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetBranchRequest struct {
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetBranchResponse struct {
// All dropoff branches you can choose.
Branch []GetBranchResponseBranch `json:"branch,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetLogisticInfoRequest struct {
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetLogisticInfoResponse struct {
// Logistics information for pickup mode order.
Pickup GetLogisticInfoResponsePickup `json:"pickup,omitempty"`
// Logistics information for dropoff mode order.
Dropoff GetLogisticInfoResponseDropoff `json:"dropoff,omitempty"`
// The parameters required based on each specific order to Init. Must use the fields included under info_needed to call Init.
InfoNeeded GetLogisticInfoResponseInfo `json:"info_needed,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type InitRequest struct {
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// Required parameter ONLY if GetParameterForInit returns "pickup" or if GetLogisticsInfo returns "pickup" under "info_needed" for the same order. Developer should still include "pickup" field in the call even if "pickup" has empty value.
Pickup *InitRequestPickup `json:"pickup,omitempty"`
// Required parameter ONLY if GetParameterForInit returns "dropoff" or if GetLogisticsInfo returns "dropoff" under "info_needed" for the same order. Developer should still include "dropoff" field in the call even if "dropoff" has empty value.
Dropoff *InitRequestDropoff `json:"dropoff,omitempty"`
// Optional parameter when GetParameterForInit returns "non-integrated" or GetLogisticsInfo returns "non-integrated" under "info_needed".
NonIntegrated *InitRequestNonIntegrated `json:"non_integrated,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// Shopee's unique identifier for a fulfillment order.
ForderID string `json:"forder_id,omitempty"`
}
type InitResponse struct {
// The tracking number of order
TrackingNumber string `json:"tracking_number,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetAirwayBillRequest struct {
// The set of order serial numbers. Up to 50 ordersn in one call.
OrderSNList []string `json:"ordersn_list,omitempty"`
// Option to get batch airway bills in single file. Default value is false.
IsBatch bool `json:"is_batch,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
}
type GetAirwayBillResponse struct {
// This object contains the detailed breakdown for the result of this API call if the param is_batch is false.
Result GetAirwayBillResponseResult `json:"result,omitempty"`
// This object contains the detailed breakdown for the result of this API call if the param is_batch is true.
BatchResult GetAirwayBillResponseBatchResult `json:"batch_result,omitempty"`
// This list contains the ordersn of all orders that failed to retrieve airway bill in this call. AirwayBill is no longer fetchable after the order status is updated to SHIPPED.
Errors []string `json:"errors,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetOrderLogisticsRequest struct {
// The order serial numbers. Make sure the order has trackingNo generated before calling this API.
OrderSN string `json:"ordersn,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// Shopee's unique identifier for a fulfillment order.
ForderID string `json:"forder_id,omitempty"`
}
type GetOrderLogisticsResponse struct {
// The logistics of order.
Logistics []GetOrderLogisticsResponseLogistic `json:"logistics,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetLogisticsMessageRequest struct {
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// The tracking number assigned by the shipping carrier for item shipment. If there are more than one tracking number in one order, this param is necessary.
TrackingNumber string `json:"tracking_number,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// Shopee's unique identifier for a fulfillment order.
ForderID string `json:"forder_id,omitempty"`
}
type GetLogisticsMessageResponse struct {
// The tracking number assigned by the shipping carrier for item shipment.
TrackingNumber string `json:"tracking_number,omitempty"`
//
TrackingInfo []GetLogisticsMessageResponseInfo `json:"tracking_info,omitempty"`
// The Shopee logistics status for the order. Applicable values: See Data Definition- LogisticsStatus.
LogisticStatus string `json:"logisttic_status,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
// The order serial numbers.
OrderSN string `json:"ordersn,omitempty"`
// Shopee's unique identifier for a fulfillment order.
ForderID string `json:"forder_id,omitempty"`
}
type GetForderWaybillRequest struct {
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// The set of order serial numbers. Up to 50 ordersn in one call.
OrdersList []GetForderWaybillRequestOrder `json:"orders_list,omitempty"`
// Option to get batch airway bills in single file. Default value is false.
IsBatch bool `json:"is_batch,omitempty"`
}
type GetForderWaybillResponse struct {
// This object contains the detailed breakdown for the result of this API call if the param is_batch is false.
Result GetForderWaybillResponseResult `json:"result,omitempty"`
// This object contains the detailed breakdown for the result of this API call if the param is_batch is true.
BatchResult GetForderWaybillResponseBatchResult `json:"batch_result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type SetAddressRequest struct {
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// The identity of default address.
DefaultAddressID int64 `json:"default_address_id,omitempty"`
// The identity of pick_up address.
PickUpAddressID int64 `json:"pick_up_address_id,omitempty"`
// The identity of return address.
ReturnAddressID int64 `json:"return_address_id,omitempty"`
}
type SetAddressResponse struct {
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type DeleteAddressRequest struct {
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// Partner ID is assigned upon registration is successful. Required for all requests.
PartnerID int64 `json:"partner_id,omitempty"`
// This is to indicate the timestamp of the request. Required for all requests.
Timestamp int `json:"timestamp,omitempty"`
// The identity of address
AddressID int64 `json:"address_id,omitempty"`
}
type DeleteAddressResponse struct {
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}