Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

List Resource

MethodURLExample
GET
/api/v1/shops/<shopId>/sellables?page=<page>
https://api.spreadshirt.net/api/v1/shops/100488332/sellables?page=0


Returns a paginated list of the shop's sellables in a format like this:

Code Block
languagejs
titleResponse Payload
{
   "count" : 4760,
   "limit" : 48,
   "offset" : 0,
   "sellables" :
      [
         {
            "sellableId" : "praawgg73zU5gzZN0gaM-812-7",
            "ideaId" : "5d22f8ebb264a16f6b87fb6f",
            "mainDesignId": "142648902",
            "productTypeId" : "812",
            "price" :
               {
                  "amount" : 17.49,
                  "currencyId" : "1"
               },
            "name" : "I love you",
            "tags" :
               [
                  "Young wild and free",
                  "shop api",
                  "test",
                  "Young money",
                  "Loved",
                  "Lovestruck",
                  "Love with heart",
                  "Love hurts",
                  "Love",
                  "Love me",
                  "Youtube",
                  "migration",
                  "Your",
                  "You",
                  "Love parade"
               ],
            "previewImage" :
               {
                  "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",
                  "type" : "MODEL"
               },
            "appearanceIds" :
               [
                  "411",
                  "645",
                  "648",
                  "649",
                  "719",
                  "1",
                  "2",
                  "366",
                  "348",
                  "387",
                  "92",
                  "39",
                  "231",
                  "317",
                  "3",
                  "29",
                  "328",
                  "339"
               ],
            "defaultAppearanceId" : "2"
         }
      ]
}

...

FielDescription
sellableIdUnique identifier for the sellable. Necessary to query the detail resource mentioned below as well as for the add-to-basket request.
ideaIdIdentifies the uploaded design. Necessary to query the detail resource but also useful to group content by design if desired.
mainDesignIdIdentifies 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 in combination with this resource.
productTypeIdIdentifies the 'type of garment' used. Can be used to lookup additional meta data from the product type resources described here.
priceAlways in the currency of the shop. Check this for hints on how to format the price in a user-friendly way.
nameThe text you entered in the Partner Area.
descriptionThe text you entered in the Partner Area (optional).
tagsThe text you entered in the Partner Area (optional).
previewImageAn image we deem best suited to represent the sellable on a list page.
previewImage/urlThe image url you can embed directly into your page.
previewImage/typeDescribes the type of image available from the url using one of the following values: PRODUCT, DESIGN, MODEL, ALTERNATIVE_MODEL. 
appearanceIdsThe 'colors' a sellable currently has available for purchase. If you need more information on the colors, the product type resource here is useful. 
defaultAppearanceIdThe 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.


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).
This allows you to implement a custom navigation structure, filters, etc. according to your needs.

Detail Resource

MethodURLExample
GET
/api/v1/shops/<shopId>/sellables/<sellableId>?appearanceId=<appearanceId>&ideaId=<ideaId>
https://api.spreadshirt.net/api/v1/shops/100488332/sellables/praawgg73zU5gzZN0gaM-812-7?appearanceId=411&ideaId=5d22f8ebb264a16f6b87fb6f


Returns detailed information on a specific sellable in a specific appearance in a format like this:

Code Block
languagejs
titleResponse Payload
{
   "sizeIds" :
      [
         "2",
         "3",
         "4",
         "5",
         "6",
         "38",
         "94",
         "102"
      ],
   "images" :
      [
         {
            "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",
            "type" : "MODEL"
         },
         {
            "url" : "https://image.spreadshirtmedia.net/image-server/v1/compositions/T812A2PA3811PT17X50Y96D163261757FS2991/views/1,width=650,height=650,appearanceId=411.jpg",
            "type" : "DESIGN"
         },
         {
            "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",
            "type" : "MODEL"
         },
         {
            "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/3,width=650,height=650,appearanceId=411.jpg",
            "type" : "PRODUCT"
         },
         {
            "url" : "https://image.spreadshirtmedia.net/image-server/v1/products/T812A2PA3811PT17X50Y96D163261757FS2991/views/4,width=650,height=650,appearanceId=411.jpg",
            "type" : "PRODUCT"
         },
         {
            "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",
            "type" : "ALTERNATIVE_MODEL"
         }
      ],
   "sellableId" : "praawgg73zU5gzZN0gaM-812-7",
   "ideaId" : "5d22f8ebb264a16f6b87fb6f",
   "mainDesignId": "142648902",
   "productTypeId" : "812",
   "price" :
      {
         "amount" : 17.49,
         "currencyId" : "1"
      },
   "name" : "112016603 143175205 I love you",
   "tags" :
      [
         "Young wild and free",
         "shop api",
         "test",
         "Young money",
         "Loved",
         "Lovestruck",
         "Love with heart",
         "Love hurts",
         "Love",
         "Love me",
         "Youtube",
         "migration",
         "Your",
         "You",
         "Love parade"
      ],
   "previewImage" :
      {
         "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",
         "type" : "MODEL"
      },
   "appearanceIds" :
      [
         "411",
         "645",
         "648",
         "649",
         "719",
         "1",
         "2",
         "366",
         "348",
         "387",
         "92",
         "39",
         "231",
         "317",
         "3",
         "29",
         "328",
         "339"
      ],
   "defaultAppearanceId" : "2"
}

...