Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

General Remarks

These resources only work for shops that are based on the (new) Partner Area, not for legacy User Area-based shops. Terminology:

  • 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.
  • 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.

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.

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:

Response Payload
{
   "count" : 4760,
   "limit" : 48,
   "offset" : 0,
   "sellables" :
      [
         {
            "sellableId" : "praawgg73zU5gzZN0gaM-812-7",
            "ideaId" : "5d22f8ebb264a16f6b87fb6f",
            "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"
         }
      ]
}

The fields are to be interpreted as follows:

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.
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:

Response 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",
   "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"
}


Most of the fields are exactly the same as in the list resource and have the same semantics. Two additional fields are included:

Field nameMeaning
sizeIdsDescribes the sizes available for purchase for the sellable in this appearance. For more information on sizes, check the product type resource here.
imagesA 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).


Implementation remarks: It is not feasible to import these detail resources into your own data base (because the number of entries can skyrocket quickly).
Instead, it is recommended to request the API dynamically in an ad-hoc manner once a customer visits a detail page.


  • No labels