... |
... |
@@ -13,7 +13,7 @@ |
13 |
13 |
)))|((( |
14 |
14 |
/api/v1/baskets |
15 |
15 |
)))|((( |
16 |
|
-[[https:~~/~~/api.spreadshirt.net/api/v1/baskets?mediaType=json>>url:https://api.spreadshirt.net/api/v1/currencies/1?mediaType=json||shape="rect"]] |
|
16 |
+https:~/~/api.spreadshirt.net/api/v1/baskets?mediaType=json |
17 |
17 |
))) |
18 |
18 |
|
19 |
19 |
Send a payload as shown below in the request body to create a new basket with any number of basket items in it. A request like this should usually be performed once a new customer interacts with the add-to-basket button for the first time while on your site. |
... |
... |
@@ -106,7 +106,7 @@ |
106 |
106 |
\\ |
107 |
107 |
|
108 |
108 |
(% class="auto-cursor-target" %) |
109 |
|
-= Read a basket = |
|
109 |
+= Retrieve a basket = |
110 |
110 |
|
111 |
111 |
|=((( |
112 |
112 |
Method |
... |
... |
@@ -120,10 +120,26 @@ |
120 |
120 |
)))|((( |
121 |
121 |
/api/v1/baskets/<basketId> |
122 |
122 |
)))|((( |
123 |
|
-[[https:~~/~~/api.spreadshirt.net/api/v1/baskets/5ad33740-30ad-41b0-846f-9e1f0c6824b5?mediaType=json>>url:https://api.spreadshirt.net/api/v1/currencies/1?mediaType=json||shape="rect"]] |
|
123 |
+https:~/~/api.spreadshirt.net/api/v1/baskets/5ad33740-30ad-41b0-846f-9e1f0c6824b5?mediaType=json |
124 |
124 |
))) |
125 |
125 |
|
126 |
126 |
(% class="auto-cursor-target" %) |
|
127 |
+\\ |
|
128 |
+ |
|
129 |
+|=((( |
|
130 |
+Query Parameter |
|
131 |
+)))|=((( |
|
132 |
+Description |
|
133 |
+))) |
|
134 |
+|((( |
|
135 |
+locale |
|
136 |
+)))|((( |
|
137 |
+Use on of the values described [[here>>doc:API.Spreadshirt Public Shop API Documentation.API REST Resources.WebHome]]. This will affect the assumed shipping costs as well as the localized names of "description", "sizeLabel" and "appearanceLabel". |
|
138 |
+))) |
|
139 |
+ |
|
140 |
+\\ |
|
141 |
+ |
|
142 |
+(% class="auto-cursor-target" %) |
127 |
127 |
Given an id obtained from creating a basket, this resource allows to read the basket data and it contains additional information that can be useful to show to the customer. |
128 |
128 |
|
129 |
129 |
{{code language="js" title="Example Response Payload"}} |
... |
... |
@@ -335,7 +335,7 @@ |
335 |
335 |
|((( |
336 |
336 |
basketItems/description |
337 |
337 |
)))|((( |
338 |
|
-Human-readable product type description. |
|
354 |
+Human-readable product type description. Depends on the locale parameter. |
339 |
339 |
))) |
340 |
340 |
|((( |
341 |
341 |
basketItems/quantity |
... |
... |
@@ -350,7 +350,7 @@ |
350 |
350 |
|((( |
351 |
351 |
basketItems/element/properties |
352 |
352 |
)))|((( |
353 |
|
-Aside from the properties that you sent yourself when creating the basket, this also includes the useful human-readable fields "sizeLabel" and "appearanceLabel". |
|
369 |
+Aside from the properties that you sent yourself when creating the basket, this also includes the useful human-readable fields "sizeLabel" and "appearanceLabel". These depend on the locale parameter. |
354 |
354 |
))) |
355 |
355 |
|(% colspan="1" %)(% colspan="1" %) |
356 |
356 |
((( |
... |
... |
@@ -374,4 +374,33 @@ |
374 |
374 |
Use the link with type "shopCheckout" to redirect your customer to Spreadshirt's checkout. |
375 |
375 |
))) |
376 |
376 |
|
|
393 |
+(% class="auto-cursor-target" %) |
377 |
377 |
\\ |
|
395 |
+ |
|
396 |
+(% class="auto-cursor-target" %) |
|
397 |
+= Update a basket = |
|
398 |
+ |
|
399 |
+|=((( |
|
400 |
+Method |
|
401 |
+)))|=((( |
|
402 |
+URL |
|
403 |
+)))|=((( |
|
404 |
+Example |
|
405 |
+))) |
|
406 |
+|((( |
|
407 |
+PUT |
|
408 |
+)))|((( |
|
409 |
+/api/v1/baskets/<basketId> |
|
410 |
+)))|((( |
|
411 |
+https:~/~/api.spreadshirt.net/api/v1/baskets/5ad33740-30ad-41b0-846f-9e1f0c6824b5?mediaType=json |
|
412 |
+))) |
|
413 |
+ |
|
414 |
+(% class="auto-cursor-target" %) |
|
415 |
+Allows to update an existing basket by overwriting its content. This works as follows: |
|
416 |
+ |
|
417 |
+1. Retrieve an existing basket via GET. |
|
418 |
+1. Modify the response payload according to your needs. |
|
419 |
+1. Send the modified payload via PUT. |
|
420 |
+1. In the response body, the result of the update is returned. Save and display this response; an additional GET request is thus not required. |
|
421 |
+ |
|
422 |
+"Modifying the payload" might mean increasing or decreasing a basket item's quantity, adding or removing basket items from the "basketItems" array. Fields like prices can of course not be set by you. It is irrelevant whether you send them with the PUT request or not. However, you need to know how prices change when you increased an item's quantity - that is what the response body is for. |