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-item.go
795 lines (727 loc) Β· 40.1 KB
/
model-item.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
package shopeego
type GetCategoriesRequest 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"`
// Indicate the translation language. Language values include: en(English), vi(Vietnamese), id(Indonesian), th(Thai), zh-Hant(Traditional Chinese), zh-Hans(Simplified Chinese), ms-my(Malaysian Malay). If the selected language is not supported in certain shop location, the response will be in default language.
Language string `json:"language,omitempty"`
}
type GetCategoriesResponse struct {
// The category list.
Categories []GetCategoriesResponseCategory `json:"categories,omitempty"`
// The identifier for an API request for error tracking.
RequestID string `json:"request_id,omitempty"`
}
type GetAttributesRequest struct {
// The Identify of category. Should call shopee.item.GetCategories to get category_id first. Attributes can ONLY be fetched for the category_id WITHOUT children.
CategoryID int64 `json:"category_id,omitempty"`
// Indicate the translation language. Language values include: en(English), vi(Vietnamese), id(Indonesian), th(Thai), zh-Hant(Traditional Chinese), zh-Hans(Simplified Chinese), ms-my(Malaysian Malay). If the selected language is not supported in certain shop location, the response will be in default language.
Language string `json:"language,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"`
// Two-characters country code(capital letter) for the attributes. Should be provided if no "shopid".
Country string `json:"country,omitempty"`
// Is cross-border or not. Should be provided if no "shopid".
IsCB bool `json:"is_cb,omitempty"`
// Shopee's unique identifier for a shop. Should be provided if no "country" and "is_cb".
ShopID int64 `json:"shopid,omitempty"`
}
type GetAttributesResponse struct {
// The attributes list.
Attributes []GetAttributesResponseAttribute `json:"attributes,omitempty"`
// The identifier for an API request for error tracking.
RequestID string `json:"request_id,omitempty"`
}
type AddRequest struct {
// Should call shopee.item.GetCategories to get category first.Related to result.categories.category_id
CategoryID int64 `json:"category_id,omitempty"`
// Name of the item in local language.
Name string `json:"name,omitempty"`
// Description of the item in local language. HTML is not supported.
Description string `json:"description,omitempty"`
// The current price of the item in the listing currency. This value will be ignored if there is variation level price input.
Price float64 `json:"price,omitempty,string"`
// The current stock quantity of the item. This value will be ignored if there is variation level stock input.
Stock int `json:"stock,omitempty"`
// An item SKU (stock keeping unit) is an identifier defined by a seller, sometimes called parent SKU. Item SKU can be assigned to an item in Shopee Listings.
ItemSKU string `json:"item_sku,omitempty"`
// Please skip this field and use the dedicated APIs to create 2-tier variation. More details: https://open.shopee.com/documents?module=63&type=2&id=54
Variations []AddRequestVariation `json:"variations,omitempty"`
// Image URLs of the item. Up to 9 images(12 images for TW mall seller), max 2.0 MB each.Image format accepted: JPG, JPEG, PNG.Suggested dimension: 1024 x 1024 px. Max size: 2MB
Images []AddRequestImage `json:"images,omitempty"`
// This field is optional depending on the specific attribute under different categories. Should call shopee.item.GetAttributes to get attribute first. Must contain all all mandatory attribute.
Attributes []AddRequestAttribute `json:"attributes,omitempty"`
// Should call shopee.logistics.GetLogistics to get logistics first. Should contain all all logistics.
Logistics []AddRequestLogistic `json:"logistics,omitempty"`
// the net weight of this item, the unit is KG.
Weight float64 `json:"weight,omitempty,string"`
// The length of package for this single item, the unit is CM
PackageLength int `json:"package_length,omitempty"`
// The width of package for this single item, the unit is CM
PackageWidth int `json:"package_width,omitempty"`
// The height of package for this single item, the unit is CM
PackageHeight int `json:"package_height,omitempty"`
// The guaranteed days to ship orders. For pre-order, please input value from 7 to 30; for non pre-order, please exclude this field and it will default to the respective standard value per your shop location.(e.g. 3 for CrossBorder)
DaysToShip int `json:"days_to_ship,omitempty"`
// The wholesales tier list. Please put the wholesale tier info in order by min count.
Wholesales []AddRequestWholesale `json:"wholesales,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"`
// Url of size chart image. Only particular categories support it. max size: 500KB. 2000*2000 pixels
SizeChart string `json:"size_chart,omitempty"`
// This indicates whether the item is secondhand.
Condition string `json:"condition,omitempty"`
// Use this field to indicate the initial status of the new item. Value can be one of 'NORMAL' or 'UNLIST'.
Status string `json:"status,omitempty"`
// Use this field to identify whether the item is pre-order. Applicable value: true/false.
IsPreOrder bool `json:"is_pre_order,omitempty"`
}
type AddResponse struct {
//
ItemID int64 `json:"item_id,omitempty"`
// Item's info.
Item AddResponseItem `json:"item,omitempty"`
//
Warning string `json:"warning,omitempty"`
// Image URLs for fail download.
FailImage []string `json:"fail_image,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
// Url of size chart image. Only particular categories support it. max size: 500KB. 2000*2000 pixels
SizeChart string `json:"size_chart,omitempty"`
}
type DeleteRequest struct {
// The identity of product item.
ItemID int64 `json:"item_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 DeleteResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
//
Msg string `json:"msg,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UnlistItemRequest 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"`
// List of item_ids and expected status. Up to 50 items for one call.
Items []UnlistItemRequestItem `json:"items,omitempty"`
}
type UnlistItemResponse struct {
// List of item ids which failed to update status, including their reasons
Failed []UnlistItemResponseFailed `json:"failed,omitempty"`
// List of item ids which succeed to update status, including their current status.
Success []UnlistItemResponseSuccess `json:"success,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type AddVariationsRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// The variation of item is to list out all models of this product. For example, iPhone has model of White and Black, then its variations includes "White iPhone" and "Black iPhone".
Variations []AddVariationsRequestVariation `json:"variations,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 AddVariationsResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// The time when stock of the variation is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// The variation list of item.
Variations []AddVariationsResponseVariation `json:"variations,omitempty"`
// The identifier for an API request for error tracking.
RequestID string `json:"request_id,omitempty"`
}
type DeleteVariationRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// Shopee's unique identifier for a variation of an item. Please input the variation_id of a variation to be changed. The variation_id and item_id pair must be matched in order to perform the update.
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 DeleteVariationResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// Shopee's unique identifier for a variation of an item.
VariationID int64 `json:"variation_id,omitempty"`
// The time when stock of the variation is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetItemsListRequest struct {
// 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"`
// If many items are available to retrieve, you may need to call GetItemsList 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 (<= 100) to retrieve per page (i.e., per call), the offset number to start next call. This integer value is usUed to specify the maximum number of entries to return in a single ""page"" of data.
PaginationEntriesPerPage int `json:"pagination_entries_per_page"`
// The update_time_from and update_time_to fields specify a date range for retrieving orders (based on the item 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.
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 item 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.
UpdateTimeTo int `json:"update_time_to,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"`
// true:return item in all status; false:return items without item deleted by seller; default: false.
NeedDeletedItem bool `json:"need_deleted_item,omitempty"`
}
type GetItemsListResponse struct {
//
Items []GetItemsListResponseItem `json:"items,omitempty"`
// 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"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
// The total count of items.
Total int64 `json:"total,omitempty"`
}
type GetItemDetailRequest struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_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 GetItemDetailResponse struct {
//
Item GetItemDetailResponseItem `json:"item,omitempty"`
// Warning returned when the category or attributes are missing/invalid.
Warning string `json:"warning,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateItemRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Should call shopee.item.GetItemDetail to get category first.Related to result.categories.category_id
CategoryID int64 `json:"category_id,omitempty"`
// Name of the item in local language.
Name string `json:"name,omitempty"`
// Description of the item in local language. HTML is not supported.
Description string `json:"description,omitempty"`
// An item SKU (stock keeping unit) is an identifier defined by a seller, sometimes called parent SKU. Item SKU can be assigned to an item in Shopee Listings.
ItemSKU string `json:"item_sku,omitempty"`
// The variation of item is to list out all models of this product, for example, iPhone has model of White and Black, then its variations includes "White iPhone" and "Black iPhone".
Variations []UpdateItemRequestVariation `json:"variations,omitempty"`
// Should call shopee.item.GetAttributes to get attribute first. Should contain all all mandatory attribute if change the category.
Attributes []UpdateItemRequestAttribute `json:"attributes,omitempty"`
// The guaranteed days to ship orders. Update value to less than 7 will default the value to the respective standard per your shop location and make this item non pre-order.(e.g. 3 for CrossBorder)
DaysToShip int `json:"days_to_ship,omitempty"`
// The wholesales tier list. If the item has already had wholesale info, the wholesale info will be replaced. Please put the wholesale tier info in order by min count.
Wholesales []UpdateItemRequestWholesale `json:"wholesales,omitempty"`
// Should call shopee.logistics.GetLogistics to get logistics first. Should contain all all logistics.
Logistics []UpdateItemRequestLogistic `json:"logistics,omitempty"`
// the net weight of this item, the unit is KG.
Weight float64 `json:"weight,omitempty,string"`
// The length of package for this single item, the unit is CM
PackageLength int `json:"package_length,omitempty"`
// The width of package for this single item, the unit is CM
PackageWidth int `json:"package_width,omitempty"`
// The height of package for this single item, the unit is CM
PackageHeight int `json:"package_height,omitempty"`
// This indicates whether the item is secondhand.
Condition string `json:"condition,omitempty"`
// Url of size chart image. Only particular categories support it. max size: 500KB. 2000*2000 pixels
SizeChart string `json:"size_chart,omitempty"`
// Use this field to identify whether the item is pre-order. Applicable value: true/false.
IsPreOrder bool `json:"is_pre_order,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 UpdateItemResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
//
Item UpdateItemResponseItem `json:"item,omitempty"`
//
Warning string `json:"warning,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type AddItemImgRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Image URLs of the item. It contains at most 9 URLs. Could get the url by api GetItemDetail
Images []string `json:"images,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 AddItemImgResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// Image URLs for fail download.
FailImage []string `json:"fail_image,omitempty"`
// Image URLs of item.
Images []string `json:"images,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateItemImgRequest struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// Image URLs of the item. Up to 9 images(12 images for TW mall seller), max 2.0 MB each.Image format accepted: JPG, JPEG, PNG.Suggested dimension: 1024 x 1024 px. Max size: 2MB
Images []string `json:"images,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 UpdateItemImgResponse struct {
// Image URLs of the item. Up to 9 images, max 2.0 MB each.Image format accepted: JPG, JPEG, PNG.Suggested dimension: 1024 x 1024 px. Max size: 2MB
Images []string `json:"images,omitempty"`
// Shopee's unique identifier for a shop.
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"`
}
type InsertItemImgRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Image URL of the item.
ImageURL string `json:"image_url,omitempty"`
// The position that insert the image. It starts with 1 and the max number is 9. If the position is bigger than existing position, the image would be placed on the last position.
ImagePosition int `json:"image_position,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 InsertItemImgResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// The time when stock of the variation is updated.
ModifiedTime int `json:"modified_time,omitempty"`
// Image URLs of item.
Images []string `json:"images,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type DeleteItemImgRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Image URLs of the item. It contains at most 9 URLs.Could get the url by api GetItemDetail
Images []string `json:"images,omitempty"`
// Image positions of the item. Positions start with 1 and the max number is 9. If the position can not match the old image position, this position would be ignored It contains at most 9 positions. Param position and param images can not been empty at the same time.If there are images and positions at the same time, positions is ignored.
Positions []int `json:"positions,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 DeleteItemImgResponse struct {
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdatePriceRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// Specify the revised price of the item. This value will be ignored if there is variation level price input.
Price float64 `json:"price,omitempty,string"`
// 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 UpdatePriceResponse struct {
//
Item UpdatePriceResponseItem `json:"item,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateStockRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// Specify the updated stock quantity. This value will be ignored if there is variation level stock input.
Stock int `json:"stock,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 UpdateStockResponse struct {
//
Item UpdateStockResponseItem `json:"item,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateVariationPriceRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// Specify the revised price of one variation of the item.
Price float64 `json:"price,omitempty,string"`
// Shopee's unique identifier for a variation of an item. Please input the variation_id of a variation to be changed. The variation_id and item_id pair must be matched in order to perform the update.
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 UpdateVariationPriceResponse struct {
//
Item UpdateVariationPriceResponseItem `json:"item,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateVariationStockRequest struct {
// Shopee's unique identifier for an item. Please input the item_id of an item to be changed.
ItemID int64 `json:"item_id,omitempty"`
// Specify the updated stock quantity.
Stock int `json:"stock,omitempty"`
// Shopee's unique identifier for a variation of an item. Please input the variation_id of a variation to be changed. The variation_id and item_id pair must be matched in order to perform the update.
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 UpdateVariationStockResponse struct {
//
Item UpdateVariationStockResponseItem `json:"item,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdatePriceBatchRequest 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"`
// List of items to update price. Up to 50 items in one call.
Items []UpdatePriceBatchRequestItem `json:"items,omitempty"`
}
type UpdatePriceBatchResponse struct {
// Result of batch updating.
BatchResult []UpdatePriceBatchResponseBatchResult `json:"batch_result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateStockBatchRequest 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"`
// List of items to update stock. Up to 50 items in one call.
Items []UpdateStockBatchRequestItem `json:"items,omitempty"`
}
type UpdateStockBatchResponse struct {
// Result of batch updating.
BatchResult []UpdateStockBatchResponseBatchResult `json:"batch_result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateVariationPriceBatchRequest 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"`
// List of variations to update price. Up to 50 variations in one call.
Variations []UpdateVariationPriceBatchRequestVariation `json:"variations,omitempty"`
}
type UpdateVariationPriceBatchResponse struct {
// Result of batch updating.
BatchResult []UpdateVariationPriceBatchResponseBatchResult `json:"batch_result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateVariationStockBatchRequest 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"`
// List of variations to update price. Up to 50 variations in one call.
Variations []UpdateVariationStockBatchRequestVariation `json:"variations,omitempty"`
}
type UpdateVariationStockBatchResponse struct {
// Result of batch updating.
BatchResult []UpdateVariationStockBatchResponseBatchResult `json:"batch_result,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type InitTierVariationRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Tier_variation list. Up to 2 tiers.
TierVariation []InitTierVariationRequestTierVariation `json:"tier_variation,omitempty"`
// 2-Tier variation list.
Variation []InitTierVariationRequestVariation `json:"variation,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 InitTierVariationResponse struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
// Current variation ids under this item
VariationIDList []InitTierVariationResponseVariation `json:"variation_id_list,omitempty"`
}
type AddTierVariationRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// 2-Tier variation list.
Variation []AddTierVariationRequestVariation `json:"variation,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 AddTierVariationResponse struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
// Current variations information under this item.
VariationIDList []AddTierVariationResponseVariation `json:"variation_id_list,omitempty"`
}
type GetVariationRequest struct {
// The identity of product item.
ItemID int64 `json:"item_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 GetVariationResponse struct {
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// Tier_variation list.
TierVariation []GetVariationResponseTierVariation `json:"tier_variation,omitempty"`
// Item's variation list.
Variations []GetVariationResponseVariation `json:"variations,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateTierVariationListRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// Tier_variation list. Length must be 1 or 2.
TierVariation []UpdateTierVariationListRequestTierVariation `json:"tier_variation,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 UpdateTierVariationListResponse struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type UpdateTierVariationIndexRequest struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// 2-Tier variation list.
Variation []UpdateTierVariationIndexRequestVariation `json:"variation,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 UpdateTierVariationIndexResponse struct {
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type BoostItemRequest struct {
// A list of item ids to be boosted. You can input a maximum of 5 items per request.
ItemID []int `json:"item_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 BoostItemResponse struct {
// batch result details
BatchResult BoostItemResponseBatchResult `json:"batch_result,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetBoostedItemRequest 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 GetBoostedItemResponse struct {
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
//
Items []GetBoostedItemResponseItem `json:"items,omitempty"`
}
type SetItemInstallmentTenuresRequest 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 item.
ItemID int64 `json:"item_id,omitempty"`
// List of installments, applicable values: 3, 6, 12, 24. If the list is empty, it means you wanna close the installment.
Tenures []int `json:"tenures,omitempty"`
}
type SetItemInstallmentTenuresResponse struct {
// List of installments
Tenures []int `json:"tenures,omitempty"`
// Shopee's unique identifier for an item.
ItemID int64 `json:"item_id,omitempty"`
// The identifier of the API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type GetPromotionInfoRequest struct {
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// The list of item_id. Up to 50 item_ids in one call.
ItemIDList []int64 `json:"item_id_list,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"`
}
type GetPromotionInfoResponse struct {
// The set of item's promotion list.
Items []GetPromotionInfoResponseItem `json:"items,omitempty"`
// The identifier of the API request for error tracking.
RequestID string `json:"request_id,omitempty"`
}
type GetRecommendCatsRequest struct {
// The title of a particular item, used to get recommended category ids.
Name string `json:"name,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 GetRecommendCatsResponse struct {
// List of recommended category ids.
CategoryIDs []string `json:"category_i_ds,omitempty"`
// The identifier of the API request for error tracking.
RequestID string `json:"request_id,omitempty"`
}
type GetCommentRequest 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"`
// The identity of product item.
ItemID int64 `json:"item_id,omitempty"`
// The identity of comment.
CMTID int64 `json:"cmt_id,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 items are available to retrieve, you may need to call GetItemsList 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 (<= 100) to retrieve per page (i.e., per call), the offset number to start next call. This integer value is usUed to specify the maximum number of entries to return in a single ""page"" of data.
PaginationEntriesPerPage int `json:"pagination_entries_per_page,omitempty"`
}
type GetCommentResponse struct {
// Shopee's unique identifier for a shop. Required for all requests.
ShopID int64 `json:"shopid,omitempty"`
// This is to indicate whether the comment 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 comments.
More bool `json:"more,omitempty"`
//
ItemCMTList []GetCommentResponseItemCMTList `json:"item_cmt_list,omitempty"`
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
}
type ReplyCommentsRequest 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"`
//
CMTList ReplyCommentsRequestCMTList `json:"cmt_list,omitempty"`
}
type ReplyCommentsResponse struct {
// The identifier for an API request for error tracking
RequestID string `json:"request_id,omitempty"`
//
SuccList []ReplyCommentsResponseSuccList `json:"succ_list,omitempty"`
//
Errors []ReplyCommentsResponseError `json:"errors,omitempty"`
}