| ... | 
        ... | 
                @@ -1,108 +1,119 @@ | 
      
              
                    | 1 | 
           | 
          -= General Remarks = | 
        
              
                     | 
          1 | 
          += Preface = | 
        
              
                    | 2 | 
          2 | 
            | 
        
              
                    | 3 | 
           | 
          -These resources only work for shops that are based on the (new) Partner Area, not for legacy User Area-based shops. Terminology: | 
        
              
                     | 
          3 | 
          +Spreadshirt provides several ways to offer an online shop experience to your customers: | 
        
              
                    | 4 | 
          4 | 
            | 
        
              
                     | 
          5 | 
          +1. The standalone Spreadshop ([[this>>url:https://shop.spreadshirt.com/SpreadShop||shape="rect"]], for example). This application is officially developed, hosted and maintained by Spreadshirt. Running a Spreadshop requires zero technical skills and is always the recommended approach. | 
        
              
                     | 
          6 | 
          +1. JavaScript integration (described [[here>>url:https://help.spreadshirt.com/hc/en-us/articles/207487815-Website-Integration-with-JavaScript||shape="rect"]]). If you have an existing website, you can embed a piece of JavaScript into it that manipulates your website in order to embed the Spreadshop into your site. This requires a decent understanding of HTML and CSS in order to resolve any conflicts between your site and the Spreadshop that may arise. | 
        
              
                     | 
          7 | 
          +1. CMS plugins for [[WordPress>>url:https://wordpress.org/plugins/spreadshop/#developers||shape="rect"]] and others (currently just [[Joomla>>url:https://extensions.joomla.org/extension/spreadshop/||shape="rect"]]) that embed the JavaScript snippet mentioned in (2.) for you. If you run a website based on such CMS, these plugins can make your life a bit easier. An understanding of HTML and CSS is nonetheless important. | 
        
              
                     | 
          8 | 
          +1. An independent, custom built web application based on the **Public Shop API** described in this document. This interface is for web developers only (or people who can afford to hire one). Going for this approach is only feasible for people who have a solid understanding of server side & client side programming, HTTP, HTML and CSS. | 
        
              
                     | 
          9 | 
          + | 
        
              
                     | 
          10 | 
          += Prerequisites = | 
        
              
                     | 
          11 | 
          + | 
        
              
                     | 
          12 | 
          +The **Public Shop API** only works for shops that are based on the (new) Partner Area, not for legacy User Area-based shops. On top of that, an API key is required. | 
        
              
                     | 
          13 | 
          +Note that not only the content you upload in the Partner Area, but also the shop settings affect the output of the **Public Shop API**. For example, enabling model images affects the image URLs returned by the API. | 
        
              
                     | 
          14 | 
          + | 
        
              
                     | 
          15 | 
          += Terminology = | 
        
              
                     | 
          16 | 
          + | 
        
              
                     | 
          17 | 
          +Partner Area shops are not based on the old domain entities **articles** and **products** anymore. Instead, they are based on **ideas** and **sellables** (sic!). | 
        
              
                     | 
          18 | 
          + | 
        
              
                    | 5 | 
          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 | 
          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 | 
          7 | 
            | 
        
              
                    | 8 | 
          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 | 
          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. | 
        
              
                     | 
          24 | 
          += Changelog = | 
        
              
                    | 11 | 
          11 | 
            | 
        
              
                    | 12 | 
           | 
          -= List Resource = | 
        
              
                     | 
          26 | 
          +* 22 July 2019: 1.0 | 
        
              
                     | 
          27 | 
          +** The field **previewImage** as well as the content of the **images** array have been changed from strings to objects. These objects now contain information about the image type. | 
        
              
                     | 
          28 | 
          +** Introduced a **legacy article mapping resource**. | 
        
              
                     | 
          29 | 
          +* 27 June 2019: Beta | 
        
              
                     | 
          30 | 
          +** Beta release with request for feedback | 
        
              
                    | 13 | 
          13 | 
            | 
        
              
                    | 14 | 
           | 
          -|=((( | 
        
              
                    | 15 | 
           | 
          -Method | 
        
              
                    | 16 | 
           | 
          -)))|=((( | 
        
              
                    | 17 | 
           | 
          -URL | 
        
              
                    | 18 | 
           | 
          -)))|=((( | 
        
              
                    | 19 | 
           | 
          -Example | 
        
              
                    | 20 | 
           | 
          -))) | 
        
              
                    | 21 | 
           | 
          -|((( | 
        
              
                    | 22 | 
           | 
          -GET | 
        
              
                    | 23 | 
           | 
          -)))|((( | 
        
              
                    | 24 | 
           | 
          -{{{/api/v1/shops/<shopId>/sellables?page=<page>}}} | 
        
              
                    | 25 | 
           | 
          -)))|((( | 
        
              
                    | 26 | 
           | 
          -(% 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"]] | 
        
              
                    | 27 | 
           | 
          -))) | 
        
              
                     | 
          32 | 
          += REST Resources = | 
        
              
                    | 28 | 
          28 | 
            | 
        
              
                     | 
          34 | 
          +== Base URLs == | 
        
              
                    | 29 | 
          29 | 
            | 
        
              
                     | 
          36 | 
          +As always, use [[https:~~/~~/api.spreadshirt.com>>url:https://api.spreadshirt.com||shape="rect"]] if your shop is based on the North American Spreadshirt platform or use [[https:~~/~~/api.spreadshirt.net>>url:https://api.spreadshirt.net||shape="rect"]] if your shop runs on the European platform. | 
        
              
                     | 
          37 | 
          + | 
        
              
                     | 
          38 | 
          +== Authentication == | 
        
              
                     | 
          39 | 
          + | 
        
              
                     | 
          40 | 
          +Please provide your API key as described [[here>>doc:Security]]. A signature or sessionId is not required. | 
        
              
                     | 
          41 | 
          +Remember to set a user agent header naming your application and including its version. Example: "MyApp-1.0" | 
        
              
                     | 
          42 | 
          + | 
        
              
                     | 
          43 | 
          +== Client / Server == | 
        
              
                     | 
          44 | 
          + | 
        
              
                     | 
          45 | 
          +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 policy interference and keeps your API key secure. | 
        
              
                     | 
          46 | 
          + | 
        
              
                     | 
          47 | 
          +== List Resource == | 
        
              
                     | 
          48 | 
          + | 
        
              
                     | 
          49 | 
          +\\ | 
        
              
                     | 
          50 | 
          + | 
        
              
                     | 
          51 | 
          +{{code title="Request"}} | 
        
              
                     | 
          52 | 
          +GET {baseUrl}/api/v1/shops/{shopId}/sellables?page=0 | 
        
              
                     | 
          53 | 
          + | 
        
              
                     | 
          54 | 
          +{{/code}} | 
        
              
                     | 
          55 | 
          + | 
        
              
                     | 
          56 | 
          +\\ | 
        
              
                     | 
          57 | 
          + | 
        
              
                    | 30 | 
          30 | 
           Returns a paginated list of the shop's sellables in a format like this: | 
        
              
                    | 31 | 
          31 | 
            | 
        
              
                    | 32 | 
          32 | 
           {{code language="js" title="Response Payload"}} | 
        
              
                    | 33 | 
          33 | 
           { | 
        
              
                    | 34 | 
           | 
          -   "count" : 4760, | 
        
              
                    | 35 | 
           | 
          -   "limit" : 48, | 
        
              
                    | 36 | 
           | 
          -   "offset" : 0, | 
        
              
                    | 37 | 
           | 
          -   "sellables" : | 
        
              
                    | 38 | 
           | 
          -      [ | 
        
              
                    | 39 | 
           | 
          -         { | 
        
              
                    | 40 | 
           | 
          -            "sellableId" : "praawgg73zU5gzZN0gaM-812-7", | 
        
              
                    | 41 | 
           | 
          -            "ideaId" : "5d22f8ebb264a16f6b87fb6f", | 
        
              
                    | 42 | 
           | 
          -            "productTypeId" : "812", | 
        
              
                    | 43 | 
           | 
          -            "price" : | 
        
              
                    | 44 | 
           | 
          -               { | 
        
              
                    | 45 | 
           | 
          -                  "amount" : 17.49, | 
        
              
                    | 46 | 
           | 
          -                  "currencyId" : "1" | 
        
              
                    | 47 | 
           | 
          -               }, | 
        
              
                    | 48 | 
           | 
          -            "name" : "I love you", | 
        
              
                    | 49 | 
           | 
          -            "tags" : | 
        
              
                    | 50 | 
           | 
          -               [ | 
        
              
                    | 51 | 
           | 
          -                  "Young wild and free", | 
        
              
                    | 52 | 
           | 
          -                  "shop api", | 
        
              
                    | 53 | 
           | 
          -                  "test", | 
        
              
                    | 54 | 
           | 
          -                  "Young money", | 
        
              
                    | 55 | 
           | 
          -                  "Loved", | 
        
              
                    | 56 | 
           | 
          -                  "Lovestruck", | 
        
              
                    | 57 | 
           | 
          -                  "Love with heart", | 
        
              
                    | 58 | 
           | 
          -                  "Love hurts", | 
        
              
                    | 59 | 
           | 
          -                  "Love", | 
        
              
                    | 60 | 
           | 
          -                  "Love me", | 
        
              
                    | 61 | 
           | 
          -                  "Youtube", | 
        
              
                    | 62 | 
           | 
          -                  "migration", | 
        
              
                    | 63 | 
           | 
          -                  "Your", | 
        
              
                    | 64 | 
           | 
          -                  "You", | 
        
              
                    | 65 | 
           | 
          -                  "Love parade" | 
        
              
                    | 66 | 
           | 
          -               ], | 
        
              
                    | 67 | 
           | 
          -            "previewImage" : | 
        
              
                    | 68 | 
           | 
          -               { | 
        
              
                    | 69 | 
           | 
          -                  "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", | 
        
              
                    | 70 | 
           | 
          -                  "type" : "MODEL" | 
        
              
                    | 71 | 
           | 
          -               }, | 
        
              
                    | 72 | 
           | 
          -            "appearanceIds" : | 
        
              
                    | 73 | 
           | 
          -               [ | 
        
              
                    | 74 | 
           | 
          -                  "411", | 
        
              
                    | 75 | 
           | 
          -                  "645", | 
        
              
                    | 76 | 
           | 
          -                  "648", | 
        
              
                    | 77 | 
           | 
          -                  "649", | 
        
              
                    | 78 | 
           | 
          -                  "719", | 
        
              
                    | 79 | 
           | 
          -                  "1", | 
        
              
                    | 80 | 
           | 
          -                  "2", | 
        
              
                    | 81 | 
           | 
          -                  "366", | 
        
              
                    | 82 | 
           | 
          -                  "348", | 
        
              
                    | 83 | 
           | 
          -                  "387", | 
        
              
                    | 84 | 
           | 
          -                  "92", | 
        
              
                    | 85 | 
           | 
          -                  "39", | 
        
              
                    | 86 | 
           | 
          -                  "231", | 
        
              
                    | 87 | 
           | 
          -                  "317", | 
        
              
                    | 88 | 
           | 
          -                  "3", | 
        
              
                    | 89 | 
           | 
          -                  "29", | 
        
              
                    | 90 | 
           | 
          -                  "328", | 
        
              
                    | 91 | 
           | 
          -                  "339" | 
        
              
                    | 92 | 
           | 
          -               ], | 
        
              
                    | 93 | 
           | 
          -            "defaultAppearanceId" : "2" | 
        
              
                    | 94 | 
           | 
          -         } | 
        
              
                    | 95 | 
           | 
          -      ] | 
        
              
                     | 
          62 | 
          +"count" : 473, | 
        
              
                     | 
          63 | 
          +"limit" : 48, | 
        
              
                     | 
          64 | 
          +"offset" : 0, | 
        
              
                     | 
          65 | 
          +"sellables" : | 
        
              
                     | 
          66 | 
          +[ | 
        
              
                     | 
          67 | 
          +{ | 
        
              
                     | 
          68 | 
          +"sellableId" : "74bYwmw5a3tXgyZpnw7j-812-7", | 
        
              
                     | 
          69 | 
          +"ideaId" : "5c7e78f95fd3e45786249fb0", | 
        
              
                     | 
          70 | 
          +"productTypeId" : "812", | 
        
              
                     | 
          71 | 
          +"price" : | 
        
              
                     | 
          72 | 
          +{ | 
        
              
                     | 
          73 | 
          +"amount" : 21.99, | 
        
              
                     | 
          74 | 
          +"currencyId" : "1" | 
        
              
                     | 
          75 | 
          +}, | 
        
              
                     | 
          76 | 
          +"name" : "Boss in black", | 
        
              
                     | 
          77 | 
          +"description" : "Be your own boss in black and printed by real people in black!", | 
        
              
                     | 
          78 | 
          +"tags" : | 
        
              
                     | 
          79 | 
          +[ | 
        
              
                     | 
          80 | 
          +"Fanwear", | 
        
              
                     | 
          81 | 
          +"SpreadShop", | 
        
              
                     | 
          82 | 
          +"Awesome" | 
        
              
                     | 
          83 | 
          +], | 
        
              
                     | 
          84 | 
          +"previewImage" : | 
        
              
                     | 
          85 | 
          +{ | 
        
              
                     | 
          86 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/1,width=500,height=500,appearanceId=1,crop=list,modelId=85,version=1554885779/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          87 | 
          +"type" : "MODEL" | 
        
              
                     | 
          88 | 
          +}, | 
        
              
                     | 
          89 | 
          +"appearanceIds" : | 
        
              
                     | 
          90 | 
          +[ | 
        
              
                     | 
          91 | 
          +"411", | 
        
              
                     | 
          92 | 
          +"645", | 
        
              
                     | 
          93 | 
          +"649", | 
        
              
                     | 
          94 | 
          +"1", | 
        
              
                     | 
          95 | 
          +"366", | 
        
              
                     | 
          96 | 
          +"92", | 
        
              
                     | 
          97 | 
          +"39", | 
        
              
                     | 
          98 | 
          +"231", | 
        
              
                     | 
          99 | 
          +"317", | 
        
              
                     | 
          100 | 
          +"3", | 
        
              
                     | 
          101 | 
          +"29", | 
        
              
                     | 
          102 | 
          +"328" | 
        
              
                     | 
          103 | 
          +], | 
        
              
                     | 
          104 | 
          +"defaultAppearanceId" : "1" | 
        
              
                     | 
          105 | 
          +}, | 
        
              
                     | 
          106 | 
          +// more sellables | 
        
              
                     | 
          107 | 
          +] | 
        
              
                    | 96 | 
          96 | 
           } | 
        
              
                    | 97 | 
          97 | 
           {{/code}} | 
        
              
                    | 98 | 
          98 | 
            | 
        
              
                    | 99 | 
          99 | 
           The fields are to be interpreted as follows: | 
        
              
                    | 100 | 
          100 | 
            | 
        
              
                    | 101 | 
           | 
          -(% class="wrapped" %) | 
        
              
                    | 102 | 
          102 | 
           |=((( | 
        
              
                    | 103 | 
           | 
          -Fiel | 
        
              
                     | 
          114 | 
          +Field name | 
        
              
                    | 104 | 
          104 | 
           )))|=((( | 
        
              
                    | 105 | 
           | 
          -Description | 
        
              
                     | 
          116 | 
          +Meaning | 
        
              
                    | 106 | 
          106 | 
           ))) | 
        
              
                    | 107 | 
          107 | 
           |((( | 
        
              
                    | 108 | 
          108 | 
           sellableId | 
        
                      
        | ... | 
        ... | 
                @@ -117,7 +117,7 @@ | 
      
              
                    | 117 | 
          117 | 
           |((( | 
        
              
                    | 118 | 
          118 | 
           productTypeId | 
        
              
                    | 119 | 
          119 | 
           )))|((( | 
        
              
                    | 120 | 
           | 
          -Identifies the 'type of garment' used. Can be used to lookup additional meta data from the product type resources described [[here>>doc:ProductType]]. | 
        
              
                     | 
          131 | 
          +Identifies the 'type of garment' used. Can be used to lookup additional meta data from the product type resources described [[here>>doc:Inventory Resources]]. | 
        
              
                    | 121 | 
          121 | 
           ))) | 
        
              
                    | 122 | 
          122 | 
           |((( | 
        
              
                    | 123 | 
          123 | 
           price | 
        
                      
        | ... | 
        ... | 
                @@ -145,12 +145,12 @@ | 
      
              
                    | 145 | 
          145 | 
           An image we deem best suited to represent the sellable on a list page. | 
        
              
                    | 146 | 
          146 | 
           ))) | 
        
              
                    | 147 | 
          147 | 
           |((( | 
        
              
                    | 148 | 
           | 
          -previewImage/url | 
        
              
                     | 
          159 | 
          +previewImage.url | 
        
              
                    | 149 | 
          149 | 
           )))|((( | 
        
              
                    | 150 | 
          150 | 
           The image url you can embed directly into your page. | 
        
              
                    | 151 | 
          151 | 
           ))) | 
        
              
                    | 152 | 
          152 | 
           |((( | 
        
              
                    | 153 | 
           | 
          -previewImage/type | 
        
              
                     | 
          164 | 
          +previewImage.type | 
        
              
                    | 154 | 
          154 | 
           )))|((( | 
        
              
                    | 155 | 
          155 | 
           Describes the type of image available from the url using one of the following values: PRODUCT, DESIGN, MODEL, ALTERNATIVE_MODEL.  | 
        
              
                    | 156 | 
          156 | 
           ))) | 
        
                      
        | ... | 
        ... | 
                @@ -159,7 +159,7 @@ | 
      
              
                    | 159 | 
          159 | 
           appearanceIds | 
        
              
                    | 160 | 
          160 | 
           )))|(% colspan="1" %)(% colspan="1" %) | 
        
              
                    | 161 | 
          161 | 
           ((( | 
        
              
                    | 162 | 
           | 
          -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.  | 
        
              
                     | 
          173 | 
          +The 'colors' a sellable currently has available for purchase. If you need more information on the colors, the product type resource [[here>>doc:Inventory Resources]] is useful.  | 
        
              
                    | 163 | 
          163 | 
           ))) | 
        
              
                    | 164 | 
          164 | 
           |(% colspan="1" %)(% colspan="1" %) | 
        
              
                    | 165 | 
          165 | 
           ((( | 
        
                      
        | ... | 
        ... | 
                @@ -173,122 +173,97 @@ | 
      
              
                    | 173 | 
          173 | 
           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). | 
        
              
                    | 174 | 
          174 | 
           This allows you to implement a custom navigation structure, filters, etc. according to your needs. | 
        
              
                    | 175 | 
          175 | 
            | 
        
              
                    | 176 | 
           | 
          -= Detail Resource = | 
        
              
                     | 
          187 | 
          +== Detail Resource == | 
        
              
                    | 177 | 
          177 | 
            | 
        
              
                    | 178 | 
           | 
          -|=((( | 
        
              
                    | 179 | 
           | 
          -Method | 
        
              
                    | 180 | 
           | 
          -)))|=((( | 
        
              
                    | 181 | 
           | 
          -URL | 
        
              
                    | 182 | 
           | 
          -)))|=((( | 
        
              
                    | 183 | 
           | 
          -Example | 
        
              
                    | 184 | 
           | 
          -))) | 
        
              
                    | 185 | 
           | 
          -|((( | 
        
              
                    | 186 | 
           | 
          -GET | 
        
              
                    | 187 | 
           | 
          -)))|((( | 
        
              
                    | 188 | 
           | 
          -{{{/api/v1/shops/<shopId>/sellables/<sellableId>?appearanceId=<appearanceId>&ideaId=<ideaId>}}} | 
        
              
                    | 189 | 
           | 
          -)))|((( | 
        
              
                    | 190 | 
           | 
          -(% 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"]] | 
        
              
                    | 191 | 
           | 
          -))) | 
        
              
                     | 
          189 | 
          +{{code title="Request"}} | 
        
              
                     | 
          190 | 
          +GET {baseUrl}/api/v1/shops/{shopId}/sellables/{sellableId}?appearanceId={appearanceId}&ideaId={ideaId} | 
        
              
                    | 192 | 
          192 | 
            | 
        
              
                    | 193 | 
           | 
          -\\ | 
        
              
                     | 
          192 | 
          +{{/code}} | 
        
              
                    | 194 | 
          194 | 
            | 
        
              
                    | 195 | 
          195 | 
           Returns detailed information on a specific sellable in a specific appearance in a format like this: | 
        
              
                    | 196 | 
          196 | 
            | 
        
              
                    | 197 | 
          197 | 
           {{code language="js" title="Response Payload"}} | 
        
              
                    | 198 | 
          198 | 
           { | 
        
              
                    | 199 | 
           | 
          -   "sizeIds" : | 
        
              
                    | 200 | 
           | 
          -      [ | 
        
              
                    | 201 | 
           | 
          -         "2", | 
        
              
                    | 202 | 
           | 
          -         "3", | 
        
              
                    | 203 | 
           | 
          -         "4", | 
        
              
                    | 204 | 
           | 
          -         "5", | 
        
              
                    | 205 | 
           | 
          -         "6", | 
        
              
                    | 206 | 
           | 
          -         "38", | 
        
              
                    | 207 | 
           | 
          -         "94", | 
        
              
                    | 208 | 
           | 
          -         "102" | 
        
              
                    | 209 | 
           | 
          -      ], | 
        
              
                    | 210 | 
           | 
          -   "images" : | 
        
              
                    | 211 | 
           | 
          -      [ | 
        
              
                    | 212 | 
           | 
          -         { | 
        
              
                    | 213 | 
           | 
          -            "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", | 
        
              
                    | 214 | 
           | 
          -            "type" : "MODEL" | 
        
              
                    | 215 | 
           | 
          -         }, | 
        
              
                    | 216 | 
           | 
          -         { | 
        
              
                    | 217 | 
           | 
          -            "url" : "https://image.spreadshirtmedia.net/image-server/v1/compositions/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=650,height=650,appearanceId=411.jpg", | 
        
              
                    | 218 | 
           | 
          -            "type" : "DESIGN" | 
        
              
                    | 219 | 
           | 
          -         }, | 
        
              
                    | 220 | 
           | 
          -         { | 
        
              
                    | 221 | 
           | 
          -            "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", | 
        
              
                    | 222 | 
           | 
          -            "type" : "MODEL" | 
        
              
                    | 223 | 
           | 
          -         }, | 
        
              
                    | 224 | 
           | 
          -         { | 
        
              
                    | 225 | 
           | 
          -            "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/3,width=650,height=650,appearanceId=411.jpg", | 
        
              
                    | 226 | 
           | 
          -            "type" : "PRODUCT" | 
        
              
                    | 227 | 
           | 
          -         }, | 
        
              
                    | 228 | 
           | 
          -         { | 
        
              
                    | 229 | 
           | 
          -            "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/4,width=650,height=650,appearanceId=411.jpg", | 
        
              
                    | 230 | 
           | 
          -            "type" : "PRODUCT" | 
        
              
                    | 231 | 
           | 
          -         }, | 
        
              
                    | 232 | 
           | 
          -         { | 
        
              
                    | 233 | 
           | 
          -            "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", | 
        
              
                    | 234 | 
           | 
          -            "type" : "ALTERNATIVE_MODEL" | 
        
              
                    | 235 | 
           | 
          -         } | 
        
              
                    | 236 | 
           | 
          -      ], | 
        
              
                    | 237 | 
           | 
          -   "sellableId" : "praawgg73zU5gzZN0gaM-812-7", | 
        
              
                    | 238 | 
           | 
          -   "ideaId" : "5d22f8ebb264a16f6b87fb6f", | 
        
              
                    | 239 | 
           | 
          -   "productTypeId" : "812", | 
        
              
                    | 240 | 
           | 
          -   "price" : | 
        
              
                    | 241 | 
           | 
          -      { | 
        
              
                    | 242 | 
           | 
          -         "amount" : 17.49, | 
        
              
                    | 243 | 
           | 
          -         "currencyId" : "1" | 
        
              
                    | 244 | 
           | 
          -      }, | 
        
              
                    | 245 | 
           | 
          -   "name" : "112016603 143175205 I love you", | 
        
              
                    | 246 | 
           | 
          -   "tags" : | 
        
              
                    | 247 | 
           | 
          -      [ | 
        
              
                    | 248 | 
           | 
          -         "Young wild and free", | 
        
              
                    | 249 | 
           | 
          -         "shop api", | 
        
              
                    | 250 | 
           | 
          -         "test", | 
        
              
                    | 251 | 
           | 
          -         "Young money", | 
        
              
                    | 252 | 
           | 
          -         "Loved", | 
        
              
                    | 253 | 
           | 
          -         "Lovestruck", | 
        
              
                    | 254 | 
           | 
          -         "Love with heart", | 
        
              
                    | 255 | 
           | 
          -         "Love hurts", | 
        
              
                    | 256 | 
           | 
          -         "Love", | 
        
              
                    | 257 | 
           | 
          -         "Love me", | 
        
              
                    | 258 | 
           | 
          -         "Youtube", | 
        
              
                    | 259 | 
           | 
          -         "migration", | 
        
              
                    | 260 | 
           | 
          -         "Your", | 
        
              
                    | 261 | 
           | 
          -         "You", | 
        
              
                    | 262 | 
           | 
          -         "Love parade" | 
        
              
                    | 263 | 
           | 
          -      ], | 
        
              
                    | 264 | 
           | 
          -   "previewImage" : | 
        
              
                    | 265 | 
           | 
          -      { | 
        
              
                    | 266 | 
           | 
          -         "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", | 
        
              
                    | 267 | 
           | 
          -         "type" : "MODEL" | 
        
              
                    | 268 | 
           | 
          -      }, | 
        
              
                    | 269 | 
           | 
          -   "appearanceIds" : | 
        
              
                    | 270 | 
           | 
          -      [ | 
        
              
                    | 271 | 
           | 
          -         "411", | 
        
              
                    | 272 | 
           | 
          -         "645", | 
        
              
                    | 273 | 
           | 
          -         "648", | 
        
              
                    | 274 | 
           | 
          -         "649", | 
        
              
                    | 275 | 
           | 
          -         "719", | 
        
              
                    | 276 | 
           | 
          -         "1", | 
        
              
                    | 277 | 
           | 
          -         "2", | 
        
              
                    | 278 | 
           | 
          -         "366", | 
        
              
                    | 279 | 
           | 
          -         "348", | 
        
              
                    | 280 | 
           | 
          -         "387", | 
        
              
                    | 281 | 
           | 
          -         "92", | 
        
              
                    | 282 | 
           | 
          -         "39", | 
        
              
                    | 283 | 
           | 
          -         "231", | 
        
              
                    | 284 | 
           | 
          -         "317", | 
        
              
                    | 285 | 
           | 
          -         "3", | 
        
              
                    | 286 | 
           | 
          -         "29", | 
        
              
                    | 287 | 
           | 
          -         "328", | 
        
              
                    | 288 | 
           | 
          -         "339" | 
        
              
                    | 289 | 
           | 
          -      ], | 
        
              
                    | 290 | 
           | 
          -   "defaultAppearanceId" : "2" | 
        
              
                     | 
          198 | 
          +"sizeIds" : | 
        
              
                     | 
          199 | 
          +[ | 
        
              
                     | 
          200 | 
          +"2", | 
        
              
                     | 
          201 | 
          +"3", | 
        
              
                     | 
          202 | 
          +"4", | 
        
              
                     | 
          203 | 
          +"5", | 
        
              
                     | 
          204 | 
          +"6", | 
        
              
                     | 
          205 | 
          +"38", | 
        
              
                     | 
          206 | 
          +"94", | 
        
              
                     | 
          207 | 
          +"102" | 
        
              
                     | 
          208 | 
          +], | 
        
              
                     | 
          209 | 
          +"images" : | 
        
              
                     | 
          210 | 
          +[ | 
        
              
                     | 
          211 | 
          +{ | 
        
              
                     | 
          212 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/1,width=650,height=650,appearanceId=411,crop=detail,modelId=85,version=1554885779/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          213 | 
          +"type" : "MODEL" | 
        
              
                     | 
          214 | 
          +}, | 
        
              
                     | 
          215 | 
          +{ | 
        
              
                     | 
          216 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/2,width=650,height=650,appearanceId=411,crop=detail,modelId=91,version=1554885805/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          217 | 
          +"type" : "MODEL" | 
        
              
                     | 
          218 | 
          +}, | 
        
              
                     | 
          219 | 
          +{ | 
        
              
                     | 
          220 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/compositions/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/1,width=650,height=650,appearanceId=411/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          221 | 
          +"type" : "DESIGN" | 
        
              
                     | 
          222 | 
          +}, | 
        
              
                     | 
          223 | 
          +{ | 
        
              
                     | 
          224 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/compositions/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/2,width=650,height=650,appearanceId=411/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          225 | 
          +"type" : "DESIGN" | 
        
              
                     | 
          226 | 
          +}, | 
        
              
                     | 
          227 | 
          +{ | 
        
              
                     | 
          228 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/3,width=650,height=650,appearanceId=411/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          229 | 
          +"type" : "PRODUCT" | 
        
              
                     | 
          230 | 
          +}, | 
        
              
                     | 
          231 | 
          +{ | 
        
              
                     | 
          232 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/4,width=650,height=650,appearanceId=411/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          233 | 
          +"type" : "PRODUCT" | 
        
              
                     | 
          234 | 
          +}, | 
        
              
                     | 
          235 | 
          +{ | 
        
              
                     | 
          236 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/1,width=650,height=650,appearanceId=411,crop=detail,modelId=1111,version=1554884899/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          237 | 
          +"type" : "ALTERNATIVE_MODEL" | 
        
              
                    | 291 | 
          291 | 
           } | 
        
              
                     | 
          239 | 
          +], | 
        
              
                     | 
          240 | 
          +"sellableId" : "74bYwmw5a3tXgyZpnw7j-812-7", | 
        
              
                     | 
          241 | 
          +"ideaId" : "5c7e78f95fd3e45786249fb0", | 
        
              
                     | 
          242 | 
          +"productTypeId" : "812", | 
        
              
                     | 
          243 | 
          +"price" : | 
        
              
                     | 
          244 | 
          +{ | 
        
              
                     | 
          245 | 
          +"amount" : 21.99, | 
        
              
                     | 
          246 | 
          +"currencyId" : "1" | 
        
              
                     | 
          247 | 
          +}, | 
        
              
                     | 
          248 | 
          +"name" : "Boss in black", | 
        
              
                     | 
          249 | 
          +"description" : "Be your own boss in black and printed by real people in black!", | 
        
              
                     | 
          250 | 
          +"tags" : | 
        
              
                     | 
          251 | 
          +[ | 
        
              
                     | 
          252 | 
          +"Fanwear", | 
        
              
                     | 
          253 | 
          +"SpreadShop", | 
        
              
                     | 
          254 | 
          +"Awesome" | 
        
              
                     | 
          255 | 
          +], | 
        
              
                     | 
          256 | 
          +"previewImage" : | 
        
              
                     | 
          257 | 
          +{ | 
        
              
                     | 
          258 | 
          +"url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A1PA3811PT17X49Y84D142648902FS2951PA3813PT17X60Y17D142648934FS2706/views/1,width=500,height=500,appearanceId=1,crop=list,modelId=85,version=1554885779/be-your-own-boss-in-black-and-printed-by-real-people-in-black.jpg", | 
        
              
                     | 
          259 | 
          +"type" : "MODEL" | 
        
              
                     | 
          260 | 
          +}, | 
        
              
                     | 
          261 | 
          +"appearanceIds" : | 
        
              
                     | 
          262 | 
          +[ | 
        
              
                     | 
          263 | 
          +"411", | 
        
              
                     | 
          264 | 
          +"645", | 
        
              
                     | 
          265 | 
          +"649", | 
        
              
                     | 
          266 | 
          +"1", | 
        
              
                     | 
          267 | 
          +"366", | 
        
              
                     | 
          268 | 
          +"92", | 
        
              
                     | 
          269 | 
          +"39", | 
        
              
                     | 
          270 | 
          +"231", | 
        
              
                     | 
          271 | 
          +"317", | 
        
              
                     | 
          272 | 
          +"3", | 
        
              
                     | 
          273 | 
          +"29", | 
        
              
                     | 
          274 | 
          +"328" | 
        
              
                     | 
          275 | 
          +], | 
        
              
                     | 
          276 | 
          +"defaultAppearanceId" : "1" | 
        
              
                     | 
          277 | 
          +} | 
        
              
                    | 292 | 
          292 | 
           {{/code}} | 
        
              
                    | 293 | 
          293 | 
            | 
        
              
                    | 294 | 
          294 | 
           \\ | 
        
                      
        | ... | 
        ... | 
                @@ -295,7 +295,6 @@ | 
      
              
                    | 295 | 
          295 | 
            | 
        
              
                    | 296 | 
          296 | 
           Most of the fields are exactly the same as in the list resource and have the same semantics. Two additional fields are included: | 
        
              
                    | 297 | 
          297 | 
            | 
        
              
                    | 298 | 
           | 
          -(% class="wrapped" %) | 
        
              
                    | 299 | 
          299 | 
           |=((( | 
        
              
                    | 300 | 
          300 | 
           Field name | 
        
              
                    | 301 | 
          301 | 
           )))|=((( | 
        
                      
        | ... | 
        ... | 
                @@ -304,7 +304,7 @@ | 
      
              
                    | 304 | 
          304 | 
           |((( | 
        
              
                    | 305 | 
          305 | 
           sizeIds | 
        
              
                    | 306 | 
          306 | 
           )))|((( | 
        
              
                    | 307 | 
           | 
          -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]]. | 
        
              
                     | 
          292 | 
          +Describes the sizes available for purchase for the sellable in this appearance. For more information on sizes, check the product type resource [[here>>doc:Inventory Resources]]. | 
        
              
                    | 308 | 
          308 | 
           ))) | 
        
              
                    | 309 | 
          309 | 
           |((( | 
        
              
                    | 310 | 
          310 | 
           images | 
        
                      
        | ... | 
        ... | 
                @@ -316,4 +316,46 @@ | 
      
              
                    | 316 | 
          316 | 
           Implementation remarks: It is not feasible to import these detail resources into your own data base (because the number of entries can skyrocket quickly). | 
        
              
                    | 317 | 
          317 | 
           Instead, it is recommended to request the API dynamically in an ad-hoc manner once a customer visits a detail page. | 
        
              
                    | 318 | 
          318 | 
            | 
        
              
                    | 319 | 
           | 
          -\\ | 
        
              
                     | 
          304 | 
          +== Basket resources == | 
        
              
                     | 
          305 | 
          + | 
        
              
                     | 
          306 | 
          +The [[basket resources>>doc:Basket Resources]] generally still work as they used to. However, keep in mind that a sellable is a new domain entity and hence different from products and articles. | 
        
              
                     | 
          307 | 
          +To put a sellable into a basket, use this payload fragment instead: | 
        
              
                     | 
          308 | 
          + | 
        
              
                     | 
          309 | 
          +{{code language="xml" title="Payload Fragment"}} | 
        
              
                     | 
          310 | 
          +<element id="MLorqlGGrLhljORQ7old-1007-22" type="sprd:sellable"> | 
        
              
                     | 
          311 | 
          +<properties> | 
        
              
                     | 
          312 | 
          +<property key="appearance">539</property> | 
        
              
                     | 
          313 | 
          +<property key="size">3</property> | 
        
              
                     | 
          314 | 
          +</properties> | 
        
              
                     | 
          315 | 
          +<shop id="100229382" href="https://api.spreadshirt.net/api/v1/shops/100229382"/> | 
        
              
                     | 
          316 | 
          +</element> | 
        
              
                     | 
          317 | 
          +{{/code}} | 
        
              
                     | 
          318 | 
          + | 
        
              
                     | 
          319 | 
          + | 
        
              
                     | 
          320 | 
          +Note that the **type** property needs a different constant now and a **shop** tag needs to be sent as well. | 
        
              
                     | 
          321 | 
          + | 
        
              
                     | 
          322 | 
          +== Legacy article mapping resource == | 
        
              
                     | 
          323 | 
          + | 
        
              
                     | 
          324 | 
          +If your shop was subject to a migration from the old model (that was based on articles and was accessible through the User Area), you may still have deeplinks or internal data structures referencing these now-gone articles. | 
        
              
                     | 
          325 | 
          +To ease the transition phase, we provide the following resource that allows you to find the corresponding sellable your article was migrated to: | 
        
              
                     | 
          326 | 
          + | 
        
              
                     | 
          327 | 
          +{{code title="Request"}} | 
        
              
                     | 
          328 | 
          +GET {baseUrl}/api/v1/shops/{shopId}/sellables/findForArticle?articleId={articleId} | 
        
              
                     | 
          329 | 
          + | 
        
              
                     | 
          330 | 
          +{{/code}} | 
        
              
                     | 
          331 | 
          + | 
        
              
                     | 
          332 | 
          + | 
        
              
                     | 
          333 | 
          +The response contains the identifiers necessary to make the connection between old and new domain entities. | 
        
              
                     | 
          334 | 
          + | 
        
              
                     | 
          335 | 
          +{{code language="js" title="Response Payload"}} | 
        
              
                     | 
          336 | 
          +{ | 
        
              
                     | 
          337 | 
          +"ideaId": "5d0a19935fd3e41d7dd6900f", | 
        
              
                     | 
          338 | 
          +"productTypeId": "725", | 
        
              
                     | 
          339 | 
          +"sellableId": "R43XoE5rBATzxQnRNykG-725-9" | 
        
              
                     | 
          340 | 
          +} | 
        
              
                     | 
          341 | 
          +{{/code}} | 
        
              
                     | 
          342 | 
          + | 
        
              
                     | 
          343 | 
          +== Code example == | 
        
              
                     | 
          344 | 
          + | 
        
              
                     | 
          345 | 
          +There is an example integration of this API available [[here>>url:https://github.com/spreadshirt/shop-api-example-integration||shape="rect"]]. | 
        
              
                     | 
          346 | 
          +It shows a draft of a shop system written in php that might be helpful to understand the (list-page -> detail-page -> add-to-basket) workflow. |