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
/
Copy pathmodel-orders.go
307 lines (279 loc) Β· 17.6 KB
/
model-orders.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
305
306
307
package shopeego
type GetOrdersListRequest struct {
// The create_time_from and create_time_to fields specify a date range for retrieving orders (based on the order create time). The create_time_from field is the starting date range. The maximum date range that may be specified with the create_time_from and create_time_to fields is 15 days. Must include only create_time or update_time in the request.
CreateTimeFrom int `json:"create_time_from,omitempty"`
// The create_time_from and create_time_to fields specify a date range for retrieving orders (based on the order create time). The create_time_to field is the ending date range. The maximum date range that may be specified with the create_time_from and create_time_to fields is 15 days. Must include only create_time or update_time in the request.
CreateTimeTo int `json:"create_time_to,omitempty"`
// The update_time_from and update_time_to fields specify a date range for retrieving orders (based on the order update time). The update_time_from field is the starting date range. The maximum date range that may be specified with the update_time_from and update_time_to fields is 15 days. Must include only create_time or update_time in the request.
UpdateTimeFrom int `json:"update_time_from,omitempty"`
// The update_time_from and update_time_to fields specify a date range for retrieving orders (based on the order update time). The update_time_to field is the ending date range. The maximum date range that may be specified with the update_time_from and update_time_to fields is 15 days. Must include only create_time or update_time in the request.
UpdateTimeTo int `json:"update_time_to,omitempty"`
// If many orders are available to retrieve, you may need to call GetOrdersList multiple times to retrieve all the data. Each result set is returned as a page of entries. Use the Pagination filters to control the maximum number of entries to retrieve per page (i.e., per call), the offset number to start next call.
// This integer value is used to specify the maximum number of entries to return in a single "page" of data. Max entries per page is 100.
PaginationEntriesPerPage int `json:"pagination_entries_per_page,omitempty"`
// Specifies the starting entry of data to return in the current call. Default is 0. if data is more than one page, the offset can be some entry to start next call.
PaginationOffset int `json:"pagination_offset,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 GetOrdersListResponse struct {
// The set of orders that match the ordersn or filter criteria specified.
Orders []GetOrdersListResponseOrder `json:"orders,omitempty"`
// This is to indicate whether the order list is more than one page. If this value is true, you may want to continue to check next page to retrieve orders.
More bool `json:"more,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetOrdersByStatusRequest struct {
// The order_status filter for retriveing orders. Available value: ALL/UNPAID/READY_TO_SHIP/COMPLETED/IN_CANCEL/CANCELLED/TO_RETURN
OrderStatus string `json:"order_status,omitempty"`
// The create_time_from and create_time_to fields specify a date range for retrieving orders (based on the order create time). The create_time_from field is the starting date range. The maximum date range that may be specified with the create_time_from and create_time_to fields is 15 days. Must include only create_time or update_time in the request.
CreateTimeFrom int `json:"create_time_from,omitempty"`
// The create_time_from and create_time_to fields specify a date range for retrieving orders (based on the order create time). The create_time_to field is the ending date range. The maximum date range that may be specified with the create_time_from and create_time_to fields is 15 days. Must include only create_time or update_time in the request.
CreateTimeTo int `json:"create_time_to,omitempty"`
// If many orders are available to retrieve, you may need to call GetOrdersList multiple times to retrieve all the data. Each result set is returned as a page of entries. Use the Pagination filters to control the maximum number of entries to retrieve per page (i.e., per call), the offset number to start next call.
// This integer value is used to specify the maximum number of entries to return in a single "page" of data. Max entries per page is 100.
PaginationEntriesPerPage int `json:"pagination_entries_per_page,omitempty"`
// Specifies the starting entry of data to return in the current call. Default is 0. if data is more than one page, the offset can be some entry to start next call.
PaginationOffset int `json:"pagination_offset,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 GetOrdersByStatusResponse struct {
// The set of orders that match the ordersn or filter criteria specified.
Orders []GetOrdersByStatusResponseOrder `json:"orders,omitempty"`
// This is to indicate whether the order list is more than one page. If this value is true, you may want to continue to check next page to retrieve orders.
More bool `json:"more,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetOrderDetailsRequest struct {
// The set of ordersn. You can specify up to 50 ordersns in this call.
OrderSNList []string `json:"ordersn_list,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 GetOrderDetailsResponse struct {
// The set of orders that match the ordersn or filter criteria specified.
Orders []GetOrderDetailsResponseOrder `json:"orders,omitempty"`
// Orders that encountered error
Errors []string `json:"errors,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetEscrowDetailsRequest struct {
// Shopee's unique identifier for an order.
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 GetEscrowDetailsResponse struct {
// My Income infomation
Order GetEscrowDetailsResponseOrder `json:"order,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type AddOrderNoteRequest struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// The note seller made for own reference.
Note string `json:"note,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 AddOrderNoteResponse struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// The success or error message.
Msg string `json:"msg,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type CancelOrderRequest struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// The reason seller want to cancel this order. Applicable values: OUT_OF_STOCK, CUSTOMER_REQUEST, UNDELIVERABLE_AREA, COD_NOT_SUPPORTED.
CancelReason string `json:"cancel_reason,omitempty"`
// ID of item. Required when cancel_reason is OUT_OF_STOCK.
ItemID int64 `json:"item_id,omitempty"`
// ID of the variation that belongs to the same item.Required when cancel_reason is OUT_OF_STOCK.
VariationID int64 `json:"variation_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 CancelOrderResponse struct {
// The time when the order is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type AcceptBuyerCancellationRequest struct {
// The order to be accepted cancellation request.
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 AcceptBuyerCancellationResponse struct {
// The time when the order is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type RejectBuyerCancellationRequest struct {
// The order to be rejected cancellation request.
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 RejectBuyerCancellationResponse struct {
// The time when the order is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetForderInfoRequest struct {
// Shopee's unique identifier for an order.
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 GetForderInfoResponse struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// The fulfill order list
ForderList []GetForderInfoResponseForder `json:"forder_list,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetEscrowReleasedOrdersRequest 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"`
// If many orders are available to retrieve, you may need to call GetEscrowReleaseTime multiple times to retrieve all the data. Each result set is returned as a page of entries. Use the Pagination filters to control the maximum number of entries to retrieve per page (i.e., per call), the offset number to start next call. This integer value is used to specify the maximum number of entries to return in a single "page" of data. Max entries per page is 100.
PaginationEntriesPerPage int `json:"pagination_entries_per_page,omitempty"`
// Specifies the starting entry of data to return in the current call. Default is 0. if data is more than one page, the offset can be some entry to start next call.
PaginationOffset int `json:"pagination_offset,omitempty"`
// Release time range to filter order escrow information.
ReleaseTimeFrom int `json:"release_time_from,omitempty"`
// Release time range to filter order escrow information. The value should be higher than release_time_from.
ReleaseTimeTo int `json:"release_time_to,omitempty"`
}
type GetEscrowReleasedOrdersResponse struct {
// Filtered orders' escrow information.
Orders []GetEscrowReleasedOrdersResponseOrder `json:"orders,omitempty"`
}
type SplitOrderRequest 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"`
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// Item information contained in fulfilment orders.
Parcels []SplitOrderRequestParcel `json:"parcels,omitempty"`
}
type SplitOrderResponse struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// Information of fulfillment orders.
Forders []SplitOrderResponseForder `json:"forders,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UndoSplitOrderRequest 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"`
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
}
type UndoSplitOrderResponse struct {
// Whether or not the split order has been cancelled.
Result string `json:"result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetUnbindOrderListRequest 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"`
// Specifies the starting entry of data to return in the current call. Default is 0. if data is more than one page, the offset can be some entry to start next call.
PaginationOffset int `json:"pagination_offset,omitempty"`
// If many unbind orders are available to retrieve, you may need to call GetUnbindOrderList multiple times to retrieve all the data. Each result set is returned as a page of entries. Use the Pagination filters to control the maximum number of entries to retrieve per page (i.e., per call), the offset number to start next call. This integer value is used to specify the maximum number of entries to return in a single "page" of data.
PaginationEntriesPerPage int `json:"pagination_entries_per_page,omitempty"`
}
type GetUnbindOrderListResponse struct {
// This is to indicate whether the item list is more than one page. If this value is true, you may want to continue to check next page to retrieve the rest of items.
More bool `json:"more,omitempty"`
//
Orders []GetUnbindOrderListResponseOrder `json:"orders,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type MyIncomeRequest struct {
// Shopee's unique identifier for an order.
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 MyIncomeResponse struct {
// Shopee's unique identifier for an order.
OrderSN string `json:"ordersn,omitempty"`
// The username of buyer.
BuyerUserName string `json:"buyer_user_name,omitempty"`
// The list of the serial number of return.
ReturnSNList []string `json:"returnsn_list,omitempty"`
//
OrderIncome MyIncomeResponseOrderIncome `json:"order_income,omitempty"`
}