Changes for page Sellables

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

<
From version < 13.1 >
edited by Shop Team
on 2019/08/30 07:33
To version < 3.1 >
edited by jns
on 2019/07/15 12:18
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Sellables
1 +Public Shop API
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.shop
1 +XWiki.jns
Content
... ... @@ -1,330 +1,9 @@
1 -= General Remarks =
2 -
3 -These resources only work for shops that are based on the (new) Partner Area, not for legacy User Area-based shops. Terminology:
4 -
5 -* an **idea** represents an image you uploaded in the Partner Area that you gave a name and added other meta data to. In the Partner Area this is loosely referred to as a **design**.
6 -* a **sellable** is a representation of an **idea** printed on a **product type**. Depending on the product range selected in the Partner Area, one **idea** might have 100+ **sellables** associated with it.
7 -
8 -A **sellable** is thus something concrete that a customer can buy, while an **idea** represents a grouping of content mainly intended to make administration easier.
9 -
10 -All requests to the **Public Shop API** should be made from your server and not from the browser. This allows you to leverage caching, avoids [[CORS>>url:https://en.wikipedia.org/wiki/Cross-origin_resource_sharing||shape="rect"]] policy interference and keeps your API key secure.
11 -
12 -= List Resource =
13 -
14 -(% class="wrapped" %)
15 -|=(((
16 -Method
17 -)))|=(((
18 -URL
19 -)))|=(((
20 -Example
21 -)))
22 -|(((
23 -GET
24 -)))|(((
25 -{{{/api/v1/shops/&#x3c;shopId&#x3e;/sellables?page=&#x3c;page&#x3e;}}}
26 -)))|(((
27 -(% style="color: rgb(80,80,80);" %)[[https:~~/~~/api.spreadshirt.net/api/v1/shops/100488332/sellables?page=0>>url:https://api.spreadshirt.net/api/v1/shops/100488332/sellables?page=0||shape="rect"]]
28 -)))
29 -
30 -
31 -Returns a paginated list of the shop's sellables in a format like this:
32 -
33 -{{code language="js" title="Response Payload"}}
34 -{
35 - "count" : 4760,
36 - "limit" : 48,
37 - "offset" : 0,
38 - "sellables" :
39 - [
40 - {
41 - "sellableId" : "praawgg73zU5gzZN0gaM-812-7",
42 - "ideaId" : "5d22f8ebb264a16f6b87fb6f",
43 - "mainDesignId": "142648902",
44 - "productTypeId" : "812",
45 - "price" :
46 - {
47 - "amount" : 17.49,
48 - "currencyId" : "1"
49 - },
50 - "name" : "I love you",
51 - "tags" :
52 - [
53 - "Young wild and free",
54 - "shop api",
55 - "test",
56 - "Young money",
57 - "Loved",
58 - "Lovestruck",
59 - "Love with heart",
60 - "Love hurts",
61 - "Love",
62 - "Love me",
63 - "Youtube",
64 - "migration",
65 - "Your",
66 - "You",
67 - "Love parade"
68 - ],
69 - "previewImage" :
70 - {
71 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=500,height=500,appearanceId=2,crop=list,modelId=1111,version=1564481428.jpg",
72 - "type" : "MODEL"
73 - },
74 - "appearanceIds" :
75 - [
76 - "411",
77 - "645",
78 - "648",
79 - "649",
80 - "719",
81 - "1",
82 - "2",
83 - "366",
84 - "348",
85 - "387",
86 - "92",
87 - "39",
88 - "231",
89 - "317",
90 - "3",
91 - "29",
92 - "328",
93 - "339"
94 - ],
95 - "defaultAppearanceId" : "2"
96 - }
97 - ]
98 -}
99 -{{/code}}
100 -
101 -The fields are to be interpreted as follows:
102 -
103 -(% class="wrapped" %)
104 -|=(((
105 -Fiel
106 -)))|=(((
107 -Description
108 -)))
109 -|(((
110 -sellableId
111 -)))|(((
112 -Unique identifier for the sellable. Necessary to query the detail resource mentioned below as well as for the add-to-basket request.
113 -)))
114 -|(((
115 -ideaId
116 -)))|(((
117 -Identifies the uploaded design. Necessary to query the detail resource but also useful to group content by design if desired.
118 -)))
119 -|(% colspan="1" %)(% colspan="1" %)
120 -(((
121 -(% class="objectBox objectBox-string" %)mainDesignId
122 -)))|(% colspan="1" %)(% colspan="1" %)
123 -(((
124 -Identifies the main image/design which is used for this Idea (usually the first design you add in the Partner Area). Can be used if you want to useĀ  the [[Designs Resource>>doc:Designs]] in combination with this resource.
125 -)))
126 -|(((
127 -productTypeId
128 -)))|(((
129 -Identifies the 'type of garment' used. Can be used to lookup additional meta data from the product type resources described [[here>>doc:ProductType]].
130 -)))
131 -|(((
132 -price
133 -)))|(((
134 -Always in the currency of the shop. Check [[this>>doc:Price Formatting Guide]] for hints on how to format the price in a user-friendly way.
135 -)))
136 -|(((
137 -name
138 -)))|(((
139 -The text you entered in the Partner Area.
140 -)))
141 -|(((
142 -description
143 -)))|(((
144 -The text you entered in the Partner Area (optional).
145 -)))
146 -|(((
147 -tags
148 -)))|(((
149 -The text you entered in the Partner Area (optional).
150 -)))
151 -|(((
152 -previewImage
153 -)))|(((
154 -An image we deem best suited to represent the sellable on a list page.
155 -)))
156 -|(((
157 -previewImage/url
158 -)))|(((
159 -The image url you can embed directly into your page.
160 -)))
161 -|(((
162 -previewImage/type
163 -)))|(((
164 -Describes the type of image available from the url using one of the following values: PRODUCT, DESIGN, MODEL, ALTERNATIVE_MODEL.
165 -)))
166 -|(% colspan="1" %)(% colspan="1" %)
167 -(((
168 -appearanceIds
169 -)))|(% colspan="1" %)(% colspan="1" %)
170 -(((
171 -The 'colors' a sellable currently has available for purchase. If you need more information on the colors, the product type resource [[here>>doc:ProductType]] is useful.
172 -)))
173 -|(% colspan="1" %)(% colspan="1" %)
174 -(((
175 -defaultAppearanceId
176 -)))|(% colspan="1" %)(% colspan="1" %)
177 -(((
178 -The default 'color' you can set in the Partner Area. This is the color the previewImage is in. It also provides a good starting point when linking to a detail page.
179 -)))
180 -
181 -
182 -Implementation remarks: For advanced implementations, it is usually best to import the content of the sellable list into your own data base in regular intervals (for example once every 24h).
183 -This allows you to implement a custom navigation structure, filters, etc. according to your needs.
184 -
185 -= Detail Resource =
186 -
187 -(% class="wrapped" %)
188 -|=(((
189 -Method
190 -)))|=(((
191 -URL
192 -)))|=(((
193 -Example
194 -)))
195 -|(((
196 -GET
197 -)))|(((
198 -{{{/api/v1/shops/&#x3c;shopId&#x3e;/sellables/&#x3c;sellableId&#x3e;?appearanceId=&#x3c;appearanceId&#x3e;&#x26;ideaId=&#x3c;ideaId&#x3e;}}}
199 -)))|(((
200 -(% style="color: rgb(80,80,80);" %)[[https:~~/~~/api.spreadshirt.net/api/v1/shops/100488332/sellables/praawgg73zU5gzZN0gaM-812-7?appearanceId=411&ideaId=5d22f8ebb264a16f6b87fb6f>>url:https://api.spreadshirt.net/api/v1/shops/100488332/sellables/praawgg73zU5gzZN0gaM-812-7?appearanceId=411&ideaId=5d22f8ebb264a16f6b87fb6f||shape="rect"]]
201 -)))
202 -
1 +(% class="auto-cursor-target" %)
203 203  \\
204 204  
205 -Returns detailed information on a specific sellable in a specific appearance in a format like this:
4 +{{info title="Coming soon - new Public Shop API"}}
5 +<p>As announced at <span class="wikiexternallink"><a shape="rect" href="https://www.spreadshirt.net/forum/t/what-to-do-if-im-still-in-the-legacy-user-area-and-using-spreadshirts-api-or-a-third-party-plugin/6124">https://www.spreadshirt.net/forum/t/what-to-do-if-im-still-in-the-legacy-user-area-and-using-spreadshirts-api-or-a-third-party-plugin/6124</a></span> our new <strong>Public Shop API</strong> documentation will be available soon!</p>
6 +{{/info}}
206 206  
207 -{{code language="js" title="Response Payload"}}
208 -{
209 - "sizeIds" :
210 - [
211 - "2",
212 - "3",
213 - "4",
214 - "5",
215 - "6",
216 - "38",
217 - "94",
218 - "102"
219 - ],
220 - "images" :
221 - [
222 - {
223 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=650,height=650,appearanceId=411,crop=detail,modelId=1111,version=1564481428.jpg",
224 - "type" : "MODEL"
225 - },
226 - {
227 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/compositions/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=650,height=650,appearanceId=411.jpg",
228 - "type" : "DESIGN"
229 - },
230 - {
231 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/2,width=650,height=650,appearanceId=411,crop=detail,modelId=1117,version=1564481457.jpg",
232 - "type" : "MODEL"
233 - },
234 - {
235 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/3,width=650,height=650,appearanceId=411.jpg",
236 - "type" : "PRODUCT"
237 - },
238 - {
239 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/4,width=650,height=650,appearanceId=411.jpg",
240 - "type" : "PRODUCT"
241 - },
242 - {
243 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=650,height=650,appearanceId=411,crop=detail,modelId=85,version=1564482744.jpg",
244 - "type" : "ALTERNATIVE_MODEL"
245 - }
246 - ],
247 - "sellableId" : "praawgg73zU5gzZN0gaM-812-7",
248 - "ideaId" : "5d22f8ebb264a16f6b87fb6f",
249 - "mainDesignId": "142648902",
250 - "productTypeId" : "812",
251 - "price" :
252 - {
253 - "amount" : 17.49,
254 - "currencyId" : "1"
255 - },
256 - "name" : "112016603 143175205 I love you",
257 - "tags" :
258 - [
259 - "Young wild and free",
260 - "shop api",
261 - "test",
262 - "Young money",
263 - "Loved",
264 - "Lovestruck",
265 - "Love with heart",
266 - "Love hurts",
267 - "Love",
268 - "Love me",
269 - "Youtube",
270 - "migration",
271 - "Your",
272 - "You",
273 - "Love parade"
274 - ],
275 - "previewImage" :
276 - {
277 - "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=500,height=500,appearanceId=2,crop=list,modelId=1111,version=1564481428.jpg",
278 - "type" : "MODEL"
279 - },
280 - "appearanceIds" :
281 - [
282 - "411",
283 - "645",
284 - "648",
285 - "649",
286 - "719",
287 - "1",
288 - "2",
289 - "366",
290 - "348",
291 - "387",
292 - "92",
293 - "39",
294 - "231",
295 - "317",
296 - "3",
297 - "29",
298 - "328",
299 - "339"
300 - ],
301 - "defaultAppearanceId" : "2"
302 -}
303 -{{/code}}
304 -
8 +(% class="auto-cursor-target" %)
305 305  \\
306 -
307 -Most of the fields are exactly the same as in the list resource and have the same semantics. Two additional fields are included:
308 -
309 -(% class="wrapped" %)
310 -|=(((
311 -Field name
312 -)))|=(((
313 -Meaning
314 -)))
315 -|(((
316 -sizeIds
317 -)))|(((
318 -Describes the sizes available for purchase for the sellable in this appearance. For more information on sizes, check the product type resource [[here>>doc:ProductType]].
319 -)))
320 -|(((
321 -images
322 -)))|(((
323 -A number of images giving an adequate overview over the sellable and it's properties in this appearance when displayed (ordered from most important to least important image). The exact number and shape of the images depend on your shop settings and the specifications you set when uploading the design. This object has the same structure as **previewImage** (mentioned in the list resource section).
324 -)))
325 -
326 -
327 -Implementation remarks: It is not feasible to import these detail resources into your own data base (because the number of entries can skyrocket quickly).
328 -Instead, it is recommended to request the API dynamically in an ad-hoc manner once a customer visits a detail page.
329 -
330 -\\
Confluence.Code.ConfluencePageClass[0]
id
... ... @@ -1,1 +1,1 @@
1 -28278939
1 +28278801
url
... ... @@ -1,1 +1,1 @@
1 -https://developer.spreadshirt.net/wiki/spaces/API/pages/28278939/Sellables
1 +https://developer.spreadshirt.net/wiki/spaces/API/pages/28278801/Public Shop API