Wiki source code of ProductType

Last modified by Shop Team on 2023/02/13 22:56

Show last authors
1 == General ==
2
3 In our terminology, a product type represents the pure piece or apparel, e.g. a T-shirt, as we get it from our supplier, e.g. American Apparel. A typical product type, e.g. a yellow T-shirt from American Apparel, is illustrated in the picture below. A product type has the following characteristics:
4
5 \\
6
7 * Each product type has a set of core data, such as name description and price.[[image:attach:producttypemodel.png]]
8 * **Appearances:** A product type has one or more appearances. An appearance describes a pattern/color combination for a piece of apparel, e.g. a yellow T-shirt (no pattern/yellow color) or a camouflage T-shirt (camouflage pattern/light green and dark green as colors). It's important to understand that we are not able to print with each available print type, e.g. flock, flex or digital direct, on each available product type. Therefore, we define for each appearance, which print types are allowed.
9 * **Sizes:** A product type has one or more sizes, such as S, M or L. Please note, that size information may vary between different product types. Sizes for adults are for example different from sizes for babys or kids.
10 * **StockStates:** Each product type provides stock state information for all allowed appearance/size combinations. We tell you for each combination, whether we have that in stock or not.
11 * **Views:** Views describe from which position a human being can look on a specific piece of apparel. Each product type has at least one view. The most common views are apparent: one can look on a piece of apparel from front, back, left and right. However, less apparent is that specific product types have hoods which adds two other views: hood left and hood right. Views for shirts are also different from views for pants. And last but not least, one can also print on the inside areas of certain shirts, e.g. basketball shirts, which adds another set of possible views.
12 * (((
13 (% class="auto-cursor-target" %)
14 **PrintAreas:** Print areas describe those parts on a piece of apparel on which we can actually print text and designs using different print types and print colors. Print areas are usually rectangular. However, there are cases where rectangular print area descriptions are not sufficient, for example for T-shirts with v-neck. Another issue is that there might be knobs, pockets or zippers on a T-shirt on which we cannot print - and which we also need to describe. That's the reason why our print area model contains a hard boundary and soft boundary description for each print area. The hard boundary describes the shape inside which one has to position ones text and designs. The soft boundary describes all things inside the hard boundary on which we can't print, e.g. zipper.
15 \\
16 )))
17
18 == ProductType Images ==
19
20 [[image:attach:producttype-view.png]][[image:attach:producttypesize.png]][[image:attach:producttypedetail.png]]
21
22 For product types, we deliver the following images:
23
24 * **Product Type View Images:** Product type view images display product types from different viewers perspectives, e.g. front, back, left or right. The most left image in the image list above illustrates such a view image.
25 (Example: [[https:~~/~~/image.spreadshirtmedia.net/image-server/v1/productTypes/812/views/1/appearances/1,width=200,height=200.jpg>>url:https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/views/1/appearances/1,width=200,height=200.jpg||shape="rect"]])
26 * **Product Type Size Images:** Product type size images illustrates the different product type measures, e.g. arm length, total length or waist size, in an image.  The image in the center of the image list above illustrates that.
27 (Example: [[https:~~/~~/image.spreadshirtmedia.net/image-server/v1/productTypes/812/variants/size.jpg>>url:https://image.spreadshirtmedia.net/image-server/v1/productTypes/101/variants/size.jpg||shape="rect"]])
28 * **Product Type Detail Images:** Product type detail images show how a product type looks like, when worn by a person. The rightmost image illustrates that. **Note that these images are not provided for newer product types anymore.**
29 [[(Example: https:~~/~~/image.spreadshirtmedia.net/image-server/v1/productTypes/812/variants/detail,width=200,height=200.jpg)>>url:https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/variants/detail,width=200,height=200.jpg||shape="rect"]]
30 * **Product Type Appearance Images: **The image API also returns images for product type appearance, aka product type color/pattern combinations.
31 (Example: [[https:~~/~~/image.spreadshirtmedia.net/image-server/v1/appearances/4.jpg>>url:https://image.spreadshirtmedia.net/image-server/v1/appearances/4,width=200,height=200.jpg||shape="rect"]])
32 * **Print Color Images:** The image API also returns images for print colors.
33 (Example: [[https:~~/~~/image.spreadshirtmedia.net/image-server/v1/printColors/4,width=200,height=200.jpg)>>url:https://image.spreadshirtmedia.net/image-server/v1/printColors/4,width=200,height=200.jpg||shape="rect"]]
34
35 == Resource ==
36
37 While a list resource exists it is recommended to retrieve only the ProductType that is required to display a product. In order to internationalize the returned payload it is possible to specify a [[locale query parameter>>doc:API.Spreadshirt Public Shop API Documentation.API REST Resources.WebHome]].
38
39 (% class="wrapped" %)
40 |=(((
41 Method
42 )))|=(((
43 URL
44 )))|=(((
45 Example
46 )))
47 |(((
48 GET
49 )))|(((
50 /api/v1/shops/<shopId>/productTypes/<productTypeId>
51 )))|(((
52 [[https:~~/~~/api.spreadshirt.net/api/v1/shops/100488332/productTypes/812?mediaType=json>>url:https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/812?mediaType=json||shape="rect"]]
53 )))
54
55 \\
56
57 The returned payload provides you with extension information about the given ProductType:
58
59 {{code language="js" title="Example Payload"}}
60 {
61 "href":"https://api.spreadshirt.net/api/v1/shops/100488332/productTypes/812",
62 "id":"812",
63 "name":"Men’s Premium T-Shirt",
64 "shortDescription":"Classic cut T-shirt for men, 100% cotton. Brand: Spreadshirt",
65 "description":"The Spreadshirt Collection stands for best-possible print results on top-quality products. A huge range of sizes makes sure that our gear fits everyone, big and small alike. \r\nWhat’s more, the Premium T-shirt offers an sheer infinite choice of combination opportunity with other items.\r\n<ul class=\"listMCE\">\r\n<li>Comes highly recommended! Top quality and supreme print results with all print methods</li>\r\n<li>Consistent colours in all sizes for men, women and children </li>\r\n<li>Fair and sustainable</li>\r\n<li>Durable fabrics. 150g/m²</li>\r\n<li>Material: 100% cotton (charcoal: 50% cotton, 50% polyester, heather blue: 50% cotton, 50% polyester, heather grey: 85% cotton, 15% rayon)</li>\r\n</ul>",
66 "categoryName":"T-Shirt",
67 "brand":"Spreadshirt",
68 "shippingFactor":1.0,
69 "sizeFitHint":"normal fit",
70 "manufacturingCountry":{
71 "href":"https://api.spreadshirt.net/api/v1/shippingCountries/137",
72 "id":"137"
73 },
74 "price":{
75 "vatExcluded":10.92,
76 "vatIncluded":12.99,
77 "vat":19.00,
78 "currency":{
79 "href":"https://api.spreadshirt.net/api/v1/currencies/1",
80 "id":"1"
81 }
82 },
83 "defaultValues":{
84 "defaultView":{
85 "id":"1"
86 },
87 "defaultAppearance":{
88 "id":"2"
89 }
90 },
91 "appearances":[
92 {
93 "id":"411",
94 "name":"washed burgundy",
95 "colors":[
96 {
97 "index":0,
98 "value":"#A95762"
99 }
100 ],
101 "printTypes":[
102 {
103 "href":"https://api.spreadshirt.net/api/v1/shops/100488332/printTypes/2",
104 "id":"2"
105 },
106 {
107 "href":"https://api.spreadshirt.net/api/v1/shops/100488332/printTypes/14",
108 "id":"14"
109 },
110 ],
111 "resources":[
112 {
113 "mediaType":"png",
114 "href":"https://image.spreadshirtmedia.net/image-server/v1/appearances/411"
115 }
116 ]
117 },
118 {
119 "id":"566",
120 "name":"heather burgundy",
121 "colors":[
122 {
123 "index":0,
124 "value":"#914857"
125 }
126 ],
127 "printTypes":[
128 {
129 "href":"https://api.spreadshirt.net/api/v1/shops/100488332/printTypes/2",
130 "id":"2"
131 },
132 {
133 "href":"https://api.spreadshirt.net/api/v1/shops/100488332/printTypes/14",
134 "id":"14"
135 },
136 ],
137 "resources":[
138 {
139 "mediaType":"png",
140 "href":"https://image.spreadshirtmedia.net/image-server/v1/appearances/566"
141 }
142 ]
143 },
144 ],
145 "sizes":[
146 {
147 "id":"2",
148 "name":"S",
149 "group":"S",
150 "weight":3.0,
151 "measures":[
152 {
153 "name":"A",
154 "value":{
155 "value":710,
156 "unit":"mm"
157 }
158 },
159 {
160 "name":"B",
161 "value":{
162 "value":455,
163 "unit":"mm"
164 }
165 },
166 {
167 "name":"C",
168 "value":{
169 "value":203,
170 "unit":"mm"
171 }
172 }
173 ]
174 },
175 {
176 "id":"3",
177 "name":"M",
178 "group":"M",
179 "weight":4.0,
180 "measures":[
181 {
182 "name":"A",
183 "value":{
184 "value":735,
185 "unit":"mm"
186 }
187 },
188 {
189 "name":"B",
190 "value":{
191 "value":510,
192 "unit":"mm"
193 }
194 },
195 {
196 "name":"C",
197 "value":{
198 "value":210,
199 "unit":"mm"
200 }
201 }
202 ]
203 },
204 ],
205 "attributes":[
206
207 ],
208 "washingInstructions":[
209
210 ],
211 "views":[
212 {
213 "id":"1",
214 "name":"Front",
215 "perspective":"front",
216 "resources":[
217 {
218 "mediaType":"png",
219 "href":"https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/views/1/appearances/2"
220 }
221 ],
222 "state":"ACTIVATED"
223 },
224 {
225 "id":"2",
226 "name":"Back",
227 "perspective":"back",
228 "resources":[
229 {
230 "mediaType":"png",
231 "href":"https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/views/2/appearances/2"
232 }
233 ],
234 "state":"ACTIVATED"
235 },
236 ],
237 "printAreas":[ ],
238 "stockStates":[
239 {
240 "appearance":{
241 "id":"1"
242 },
243 "size":{
244 "id":"102"
245 },
246 "available":true,
247 "quantity":354
248 },
249 {
250 "appearance":{
251 "id":"1"
252 },
253 "size":{
254 "id":"38"
255 },
256 "available":true,
257 "quantity":466
258 },
259 {
260 "appearance":{
261 "id":"1"
262 },
263 "size":{
264 "id":"94"
265 },
266 "available":true,
267 "quantity":365
268 },
269 ],
270 "resources":[
271 {
272 "mediaType":"png",
273 "type":"preview",
274 "href":"https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/views/1/appearances/2"
275 },
276 {
277 "mediaType":"png",
278 "type":"size",
279 "href":"https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/variants/size"
280 },
281 {
282 "mediaType":"png",
283 "type":"detail",
284 "href":"https://image.spreadshirtmedia.net/image-server/v1/productTypes/812/variants/detail"
285 }
286 ],
287 }
288 {{/code}}
289
290 (% class="auto-cursor-target" %)
291 \\