Wiki source code of ProductType Departments and Categories
Last modified by Shop Team on 2023/02/13 22:56
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="auto-cursor-target" %) | ||
2 | \\ | ||
3 | |||
4 | (% class="relative-table wrapped" style="width: 57.0968%;" %) | ||
5 | |=((( | ||
6 | Method | ||
7 | )))|=((( | ||
8 | URL | ||
9 | )))|=((( | ||
10 | Example | ||
11 | ))) | ||
12 | |((( | ||
13 | GET | ||
14 | )))|((( | ||
15 | /api/v1/shops/<shopId>/productTypeDepartments | ||
16 | )))|((( | ||
17 | [[https:~~/~~/api.spreadshirt.net/api/v1/shops/100488332/productTypeDepartments?mediaType=json&fullData=true>>url:https://api.spreadshirt.net/api/v1/shops/100488332/productTypeDepartments?mediaType=json&fullData=true||shape="rect"]] | ||
18 | ))) | ||
19 | |||
20 | \\ | ||
21 | |||
22 | This resource will list all available ProductType Departments of the given shop. It is recommended to use the **fullData** query parameter to avoid unnecessary requests for each ProductType Department. A Department can be seen as a group of ProductType Categories that themself group one or more ProductTypes. This results in a tree where all leaves are on the 3rd level. You can use this categorization to build a navigation tree or filters. | ||
23 | |||
24 | \\ | ||
25 | |||
26 | {{code language="js" title="Example Payload"}} | ||
27 | { | ||
28 | "offset":0, | ||
29 | "limit":50, | ||
30 | "count":1, | ||
31 | "productTypeDepartments":[ | ||
32 | { | ||
33 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypeDepartments/1", | ||
34 | "id":"1", | ||
35 | "lifeCycleState":"ACTIVATED", | ||
36 | "name":"Men", | ||
37 | "weight":1.0, | ||
38 | "categories":[ | ||
39 | { | ||
40 | "id":"24", | ||
41 | "name":"T-Shirts", | ||
42 | "nameSingular":"T-Shirt", | ||
43 | "productTypes":[ | ||
44 | { | ||
45 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/812", | ||
46 | "id":"812" | ||
47 | }, | ||
48 | { | ||
49 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/6", | ||
50 | "id":"6" | ||
51 | }, | ||
52 | { | ||
53 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/1183", | ||
54 | "id":"1183" | ||
55 | }, | ||
56 | ] | ||
57 | }, | ||
58 | { | ||
59 | "id":"25", | ||
60 | "name":"Long sleeve shirts", | ||
61 | "nameSingular":"Long Sleeve Shirt", | ||
62 | "productTypes":[ | ||
63 | { | ||
64 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/1287", | ||
65 | "id":"1287" | ||
66 | }, | ||
67 | { | ||
68 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/875", | ||
69 | "id":"875" | ||
70 | }, | ||
71 | { | ||
72 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/36", | ||
73 | "id":"36" | ||
74 | } | ||
75 | ] | ||
76 | }, | ||
77 | { | ||
78 | "id":"27", | ||
79 | "name":"Hoodies & Sweatshirts", | ||
80 | "nameSingular":"Hoodie", | ||
81 | "productTypes":[ | ||
82 | { | ||
83 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/20", | ||
84 | "id":"20" | ||
85 | }, | ||
86 | { | ||
87 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/1388", | ||
88 | "id":"1388" | ||
89 | } | ||
90 | ] | ||
91 | }, | ||
92 | { | ||
93 | "id":"28", | ||
94 | "name":"Jackets & Vests", | ||
95 | "nameSingular":"Jacket", | ||
96 | "productTypes":[ | ||
97 | { | ||
98 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/1215", | ||
99 | "id":"1215" | ||
100 | }, | ||
101 | { | ||
102 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/93", | ||
103 | "id":"93" | ||
104 | }, | ||
105 | { | ||
106 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/1114", | ||
107 | "id":"1114" | ||
108 | }, | ||
109 | { | ||
110 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/644", | ||
111 | "id":"644" | ||
112 | } | ||
113 | ] | ||
114 | }, | ||
115 | ] | ||
116 | }, | ||
117 | ], | ||
118 | "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypeDepartments" | ||
119 | } | ||
120 | {{/code}} | ||
121 | |||
122 | (% class="auto-cursor-target" %) | ||
123 | \\ |