Page tree

Versions Compared

Key

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

The API space keeps you up to date on Spreadshirt API developments. It provides documentation, tutorials and examples for working with our Spreadshirt API.

Please read API Explained first to understand what features the API will provide to you and thus what you can do with our API in the future.
To get a grip on the actual business of printing designs and text on apparel and the data models you need to exchange with our API read the API Models Explained section.
To learn about the basics for using our API, such as used HTTP methods, used HTTP status codes and used query/header parameters read the API Basics section.
To understand which resources are provided by the REST interface and how you can use them read the API Resources section.

...

Column
width60%
Recently Updated

...

width5%
Column
width35%

Navigate space

Page Tree Search
Page Tree

Preface

Spreadshirt provides several ways to offer an online shop experience to your customers and earn money through commission:

  1. The standalone Spreadshop (this, 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.
  2. JavaScript integration (described here). 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.
  3. CMS plugins for WordPress and others (currently just Joomla) 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.
  4. 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.

Prerequisites

Spreadshirt runs a European and a North American platform that are independent from another. First, you need to register a Spreadshop on eu or na. Then, in order to use the API, you need to register an API Key on eu or na.

Basics

  • The API described here is loosely based on REST principles. This means among other things that all endpoints can be accessed via HTTPS and HTTP clients like curl or postman can be used directly to explore the API.
  • The base url for all requests is https://api.spreadshirt.net for eu or https://api.spreadshirt.com for na. (This only applies to REST resources, images are retrieved from https://image.spreadshirtmedia.net or https://image.spreadshirtmedia.com.)
  • All requests have to be made with HTTP headers "Authorization" and "User-Agent". The authorization header must include your API key and the user agent header must include the name of your application, then its version, followed by a domain and a contact email address: 

    Header KeyHeader Value FormatExample Header Value
    AuthorizationSprdAuth apiKey="<apikey>"SprdAuth apiKey="dd30b4db-8cd6-4fb8-86b3-e680984b9e18"
    User-Agent<YourApplication>/<YourApplicationVersion> (https://www.yourdomain.comyourname@yourdomain.com)WordPress-Plugin/1.0 (https://www.deinblog.comadmin@deinblog.com)

    Failing to provide this information may result in your requests getting blocked at any point in time because traffic of unknown source can be considered illegitimate.

  • All requests should be performed with a ?mediaType=json query parameter to get the responses in the recommended JSON format. Leaving the parameter out may or may not result in a response in XML format which is harder to work with.
  • All REST resources return HTTP status code 200 or 201 in case of successful requests. Status codes from the 4xx range indicate a mistake on your side while errors from the 5xx range indicate an error on ours.
  • Timestamps are returned in ISO8601 format. 

Next Steps

There is a tutorial available showing the use of this API in order to implement an own shop system.

Another tutorial explains how to adjust your existing implementation in case it broke due to the partner area migration


Legal Information