In our terminology, a shipping type defines the way Spreadshirt delivers an ordered item to a customer. Depending on whether the customer ordered a real item, like a t-shirt, or a virtual item, like a gift certificate, we either need to ship the item using a standard carrier, like Deutsche Post or UPS, or we can send it using e-mail.

List of available shipping types

MethodURLExample
GET/api/v1/shops/<shopId>/shippingTypeshttps://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes?mediaType=json


This resource will list all available shipping types for the given shop.


{
   "offset":0,
   "limit":50,
   "count":3,
   "sortField":"default",
   "sortOrder":"default",
   "shippingTypes":[
      {
         "href":"https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes/1",
         "id":"1"
      },
      {
         "href":"https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes/12",
         "id":"12"
      },
      {
         "href":"https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes/18",
         "id":"18"
      }
   ],
   "href":"https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes"
}



Detailed information about a shipping type

MethodURLExample
GET/api/v1/shops/<shopId>/shippingTypes/<shippingTypeId>https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes/1?mediaType=json


A shipping type has right now the following characteristics:



Example

{
   "href":"https://api.spreadshirt.net/api/v1/shops/100488332/shippingTypes/1",
   "id":"1",
   "lifeCycleState":"ACTIVATED",
   "weight":1.0,
   "isExpress":false,
   "phoneNumberRequired":false,
   "supportsPackstation":true,
   "name":"Standard",
   "description":"Tracking and delivery date not guaranteed. May be mailed via envelope.",
   "trackingLink":{
      "href":"http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc={trackingCode}&rfn=&extendedSearch=true"
   },
   "shippingProviderId":"@home",
   "shippingAccountId":"@HOME",
   "shippingCountries":[
      {
         "id":"60",
         "created":"1970-01-02T23:00:00.000+0000",
         "modified":"2019-02-19T09:18:47.000+0000",
         "lifeCycleState":"ACTIVATED",
         "name":"Bahamas",
         "isoCode":"BS",
         "shippingRegion":{
            "id":"1"
         },
         "shippingSupported":true,
         "externalFulfillmentSupported":true,
         "shippingStates":[

         ],
         "customs":true
      },
      {
         "id":"279",
         "created":"1970-01-02T23:00:00.000+0000",
         "modified":"2019-02-19T09:18:49.000+0000",
         "lifeCycleState":"ACTIVATED",
         "name":"British Virgin Islands",
         "isoCode":"VG",
         "shippingRegion":{
            "id":"1"
         },
         "shippingSupported":true,
         "externalFulfillmentSupported":true,
         "shippingStates":[

         ],
         "customs":true
      },
      {
         "id":"286",
         "created":"1970-01-02T23:00:00.000+0000",
         "modified":"2019-02-19T09:18:49.000+0000",
         "lifeCycleState":"ACTIVATED",
         "name":"Cayman Islands",
         "isoCode":"KY",
         "shippingRegion":{
            "id":"2"
         },
         "shippingSupported":true,
         "externalFulfillmentSupported":true,
         "shippingStates":[

         ],
         "customs":true
      },
   ],
   "shippingRegions":[
      {
         "id":"1",
         "shippingCosts":[
            {
               "orderValueRange":{
                  "from":0.00,
                  "to":0.01,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":0.00,
                  "vatIncluded":0.00,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":0.01,
                  "to":24.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":3.35,
                  "vatIncluded":3.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":24.99,
                  "to":59.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":4.19,
                  "vatIncluded":4.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":59.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":5.87,
                  "vatIncluded":6.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            }
         ]
      },
      {
         "id":"2",
         "shippingCosts":[
            {
               "orderValueRange":{
                  "from":0.00,
                  "to":0.01,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":0.00,
                  "vatIncluded":0.00,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":0.01,
                  "to":24.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":3.35,
                  "vatIncluded":3.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":24.99,
                  "to":59.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":5.03,
                  "vatIncluded":5.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            },
            {
               "orderValueRange":{
                  "from":59.99,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "cost":{
                  "vatExcluded":6.71,
                  "vatIncluded":7.99,
                  "vat":19.00,
                  "currency":{
                     "href":"https://api.spreadshirt.net/api/v1/currencies/1",
                     "id":"1"
                  }
               },
               "vatGroupId":"1"
            }
         ]
      },
   ]
}


Determining Shipping Costs

Keep in mind that for an existing basket, the basket resource already contains the assumed shipping costs. If you want to display shipping costs beforehand, it is possible to evaluate the ruleset shown above as follows:
The order value for the shipping cost calculation is always calculated based on a sellable's price and a sellable's product type. Each product type has a shipping factor between 0 and 1 (0-100%) that defines to which part the sellable price is used to calculate the order value. 0 means it is not used and 1 means the full sellable price is used for order value calculation. With the calculated order value, we now only need to find the right shipping region for the country we want to ship to and identify the shipping costs by finding the matching order value range for the shipping region.

Example

Let’s assume we have an order with 2 x Bud Spencer t-shirts (sellables at 12.90 € each) that we want to ship to Germany with the standard shipping type, which means we use shipping type 1, shipping country 148 and shipping region 1.  The shipping factor is 1 for that product type. Based on that data the order value calculation is as follows:

   2 (quantity) x 1.0 (shipping factor) x 12.90 € (sellable price)
---------------------------------------------------------------------
= 25.80 €

Using the hypothetical shipping cost order value ranges defined for shipping region 1,

  0.00 € -  24.89 €    -> 2.90 €
 24.89 € -  59.99 €    -> 3.90 €
 59.99 € - 500.00 €    -> 0.00 €
500.00 € -             -> 0.00 €

the shipping costs for the basket in our example are 3.90 €.