Shipping Types

Last modified by Shop Team on 2023/02/13 22:56

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

Method

URL

Example

GET

/api/v1/shops/<shopId>/shippingTypes


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


Example Payload
{
  "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

Method

URL

Example

GET

/api/v1/shops/<shopId>/shippingTypes/<shippingTypeId>


A shipping type has right now the following characteristics:

  • Each shipping type has a name and a description, that can be used for displaying shipping type information in a client application. For shipping types that denote a shipping of a real item with a standard carrier, there are the available shipping countries and the shipping regions with the shipping costs for different order values defined.
  • Shipping Country: A shipping country is a country that Spreadshirt ships items to using the specified standard carries, like UPS. A shipping country has a name that can be used for displaying country information in a client application. It also links to a specific shipping region that contains the actual shipping costs for different order values.
  • Shipping Region: A shipping region contains the shipping costs for different order value ranges for a set of shipping countries, like France or United Kingdom if your country of delivery is Germany. Each order value range defines a from *order value (lower bound), like 0.00 €, and might define a *to order value (upper bound), like 24.89 € or unbound (undefined). Depending on the order value of the order, the shipping costs of the matching order value range apply.


shipping-type-model.png


Example

Example Payload
{
  "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:

Unknown macro: noformat. Click on this message for details.

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

Unknown macro: noformat. Click on this message for details.

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



Tags: