Spreadshop Webservice

Documentation for the spreadshop webservice based on the SOAP protocol.


Overview

This document is designed for technical staff who are implementing spreadshop web services. It describes the interfaces, methods and properties offered by the web services and how they can be invoked by a calling application.


Known Issues

  • redeem_coupon does not work yet
  • articles do not contain list of available colors, if color is not fixed

Parameters

Locales

The Locale describes the formatting of numeric values and dates. It does not specify the language.
Following Locales are available for Spreadshirt.net:

Code

Description

AT

Austria

DE

Germany

ES

Spain

FI

Finnland

FR

France

GB

Great Britan

IE

Ireland

JP

Japan

NL

Netherlands

NO

Norway

PL

Poland

RU

Russia

SE

Sweden


Following locales are available for spreadshirt.com:

Code

Description

US

United States

CA

Canada

Languages

The language setting determines the language of the text responses (Note: All error messages are in English). Following languages are available on spreadshirt.net:

Code

Name

de

German

en

English

es

Spanish

fi

Finnish (Suomi)

fr

French

it

Italian

ja

Japanese

nl

Dutch

no

Norwegian

pl

Polish

ru

Russian

se

Swedish

zh

Chinese


Following Languages are available on Spreadshirt.com:

Code

Name

es

Spanish

fr

French

us

American English

Parameters for image base url

The functions get_article and get_articles return a parameter called “base_url”, for example
http://www.spreadshirt.net/image.php?type=image&product_id=2008898
You have to append serveral parameters to retrieve the desired article image.

Parameter

Possible Values

img_id

Depends on view_count. Most products have two printable sides, so use 1 for front view and 2 for back view.

Size

small = 42x42 px

medium = 130x130 px

big = 190x190 px

huge = 280x280 px


For example:
http://www.spreadshirt.net/image.php?type=image&product_id=2008898&img_id=1&size=big

Spreadshirt - SOAP functions

List of Functions

accept_tnc

What?

The SOAP web service is used by spreadshop websites to:
Accept the Spreadshirt Terms&Conditions. Without that, the order process cannot proceed.

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

accept_tnc (

string token

)

Parameters

token
session token (string)

Return Values

The return value is boolean.

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

Error messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

add_basketitem

What?

The SOAP web service is used by spreadshop websites to:
put an article into the shopping basket

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

add_basketitem (

string token,

int article_id,

int quantity,

int producttype_size_id,

int producttype_color_id

)

Parameters

token
session token (string)
article_id
article ID (int)
quantity
number of articles to store in basket (int)
producttype_size_id
size of articles to store in basket (int)
producttype_color_id
colour of articles to store in basket (int)

Return Values

The return value is a scalar that contains the following:

basketitem_id
basket item ID (int)

Error messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

103: Missing size

104: Missing quantity

105: Article is stockout

108: Article quantity exceeds limit

201: empty result set

get_article

What?

The SOAP web service is used by spreadshop websites to:
get an article object

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_article (

string token,

int article_id

)

Parameters

token
session token (string)
shop_id
spreadshirt shop ID (int)
 

Return Values

The return value is a complex response_object that contains the following:

article_id
article ID (int)
product_id
product ID (int)
producttype_id
product type ID (int)
producttype_color_id
colour ID (int)
producttype_sizes
array of size objects representing the available sizes (array)
producttype_size_id
producttype size ID (int)
weight
order weight (int)
name
producttype size ID (int)
producttype_size_id (int)
size name (string)
partner_id
partner ID (int)
shop_id
shop ID (int)
weight
order weight (int)
currency
article currency (decimal)
gross
article price (decimal)
vat
article vat (decimal)
name
article name (string)
description
article description (string)
image_url
article default image URL (string)
base_url
base URL to article image (string)
view_count
Shows how many printable sides the article has (i.e. Two for back/front). Necessary to append to the base_url. (int)
design_ids
array of design_id's representing the applied designs (array)
stockout
If this is set, the article is out of stock (not available) (boolean)
limited
Boolean value. If true, the article is limited to a specific amount. (boolean)
limited_available
If limited is true, this parameter shows, how many articles are left (int)

Error messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

102: Missing article_id

201: empty result set

get_articles

What?

The SOAP web service is used by spreadshop websites to:
get a list of article objects

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_articles (

string token,

int shop_id,

int producttype_id,

int design_id,

string order_by,

int position,

int limit,

string search_phrase

)

Parameters



token

session token (string)

shop_id

spreadshirt shop ID (int)

producttype_id

producttype ID (Optional) (int)

design_id

design ID (Optional) (int)

order_by

reorder the results, possible values: name, price, weight(default) (string)

position

start position in list (int)

limit

limit result set to # of elements (int)

search_phrase

full text search in article name and description (optional) (string)


Return Values


The return value is a list of complex response_objects that contain the following:



article_id

article ID (int)

product_id

product ID (int)

producttype_id

product type ID (int)

producttype_color_id

colour ID (int)

producttype_sizes

array of size objects representing the available sizes (array)


producttype_size_id

producttype size ID (int)

weight

order weight (int)

name

producttype size ID (int)

producttype_size_id (int)

size name (string)


partner_id

partner ID (int)

shop_id

shop ID (int)

weight

order weight (int)

currency

article currency (decimal)

gross

article price (decimal)

vat

article vat (decimal)

name

article name (string)

description

article description (string)

image_url

article default image URL (string)

base_url

base URL to article image (string)

view_count

Shows how many printable sides the article has (i.e. Two for back/front). Necessary to append to the base_url. (int)

design_ids

array of design_id's representing the applied designs (array)

stockout

If this is set, the article is out of stock (not available) (boolean)

limited

Boolean value. If true, the article is limited to a specific amount. (boolean)

limited_available

If limited is true, this parameter shows, how many articles are left (int)


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:



101: missing token


102: Missing shop_id


1201: empty result set



get_basket

What?

The SOAP web service is used by spreadshop websites to:
get a list of basket items

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_basket (

string token

)

Parameters

token
session token (string)

Return Values

The return value is a scalar that contains the following:

gross_basket
basket merchandise value (decimal)
gross_shipping
shipping costs (decimal)
gross_handling
handling costs (decimal)
gross_discount
discount (decimal)
gross_coupon
coupon value (decimal)
gross_total
basket total (decimal)
vat_basket
basket vat (decimal)
vat_total
total vat (decimal)
currency
basket currency (decimal)
basketitem
list of basketitems (array)
basketitem_id
basket item ID (int)
article_id
article ID (int)
quantity
number of articles to store in basket (int)
shop_id
shop ID (int)
producttype_id
product type ID (int)
producttype_size
size of articles to store in basket (int)
producttype_color
colour of articles to store in basket (int)
gross
article’s price (decimal)
vat
article vat (int)
name
article name (string)
description
article description (string)
image_url
article default image URL(string)

Error Messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

201: empty result set

get_designs

What?

The SOAP web service is used by spreadshop websites to:
get a list of design objects

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_designs (

string token,

int shop_id,

int position,

int limit,

string search_phrase

)

Parameters

token
session token (string)
shop_id
spreadshirt shop ID (int)
position
start position in list (int)
limit
limit result set to # of elements (int)
search_phrase
full text search in article name and description (optional) (string)
 

Return Values

The return value is a list of complex response_objects that contain the following:

design_id
design ID (int)
partner_id
partner ID (int)
weight
order weight (int)
name
design name (string)
image_url
design image URL (string)

Error Messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

102: Missing shop_id

201: empty result set

get_producttypes

What?

The SOAP web service is used by spreadshop websites to:
get a list of product type objects available in the specified shop

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_producttypes (

string token,

int shop_id,

int producttype_category_id,

int position,

int limit,

string search_phrase

)

Parameters



token

session token (string)

shop_id

spreadshirt shop ID (int)

producttype_category_id

category (int)

position

(int)

limit

(int)

search_phrase

search not yet available (string)

 


Return Values


The return value is a list of complex response_objects that contain the following:



producttype_id

product type ID (int)

producttype_category_id

product type category ID (int)

producttype_brand_id

product type brand ID (int)

producttype_colors

array of size objects representing the available colors

producttype_color_id

producttype color ID (int)

weight

order weight (int)

name

color name (string)

color_icon_url

icon for color (string)

image_url

image of producttype (string)



producttype_sizes

array of size objects representing the available sizes


producttype_size_id

producttype size ID (int)

weight

order weight (int)

name

color name (string)

 



delivery_period

delivery period in days (string)

name

product type name (string)

description_short

product type short description (string)

description

product type description (string)

image_url

product type image URL (string)

views

array of available view numbers (array)


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:



101: missing token


102: Missing shop_id


201: empty result set



get_producttype_categories

What?

The SOAP web service is used by spreadshop websites to:
get a list of producttype category objects

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_producttype_categories (

string token,

int shop_id,

)

Parameters



token

session token (string)

shop_id

spreadshirt shop ID (int)


Return Values


The return value is a list of complex response_objects that contain the following:



producttype_category_id

producttype category ID (int)

active

category is active or not (boolean)

weight

sort order (int)

name

category name (string)

name_plural

category name in plural (string)


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:



101: missing token


102: Missing shop_id


201: empty result set



get_tnc

What?

The SOAP web service is used by spreadshop websites to:
Retrieve the Spreadshirt Terms&Conditions in the language selected in the session.

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

get_tnc (

string token

)

Parameters



token

session token (string)



Return Values


The return value is a string.


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token



initialize_session

What?

The SOAP web service is used by spreadshop websites to: initialize a client session

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

initialize_session (

int shop_id

)

Parameters



shop_id

spreadshirt shop ID (int)


Return Values


The return value is a scalar that contains the following:



token

session token (string)


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:



101: missing shop_id


201: Shop not existing



redeem_coupon

What?

The SOAP web service is used by spreadshop websites to:
redeem a coupon by customer. You have to create a basket first!

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

redeem_coupon (

string token

string shop_id

string coupon_code

)

Parameters

token
session token (string)
shop_id
Shop ID (int)
coupon_code
code of the coupon (string)

Return Values

The return value is boolean.

Error Messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token

102: missing coupon_code

201: empty result set

300: coupon errors

update_basketitem

What?

The SOAP web service is used by spreadshop websites to:
update a basket item's quantity or size in shopping basket

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

update_basketitem (

string token,

int basketitem_id,

int quantity,

int producttype_size_id,

int producttype_color_id

)

Parameters



token

session token (string)

shop_id

spreadshirt shop ID (int)

quantity

number of articles to store in basket (int)

producttype_size_id

size of articles to store in basket (int)

producttype_color_id

colour of articles to store in basket (int)


Return Values


The return value is a scalar that contains the following:



basketitem_id

basket item ID (int)


Error Messages


The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing token


102: missing ship_id


103: Missing size


104: Missing quantity


105: Article is stockout


108: Article quantity exceeds limit


201: empty result set



update_session

What?

The SOAP web service is used by spreadshop websites to:
update a client session

Methods and Parameters

This section describes the method's signature, specifics about each parameter passed, and returned results.

WSDL

http://www.spreadshirt.net/services.php?wsdl

Definition

update_session (

string token,

string lang,

string locale

)

Parameters

token
session token (string)
lang
language code (string)
locale
locale code (string)

Return Values

The return value is a scalar that contains the following:

token
session token (string)

Error Messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

101: missing shop_id

107: missing language code

108: missing locale code

201: empty result set