View Source

{excerpt}This document specifies the API of the shop service, that allows to retrieve shop data and manage shops.{excerpt}

{toc}

h1. Resources

h2. Retrieve User Shop List

This resource returns the shops that the user with the given user Id owns.

|| Url | .../v1/users/\{userId\}/shops ||
|| Sample | [http://api.spreadshirt.net/api/v1/users/40000/shops|http://api.spreadshirt.net/api/v1/users/40000/shops] ||
|| Type | List ||
|| Method | GET ||
|| Special Status Codes | ||

*Response Representation:*
{noformat}
<shops ...>
...
</shops>
{noformat}

See [Shop Representation|#Shop]

h2. Retrieve Shop Entity

This resource returns the data for a Spreadshirt platform shop. It is the entry point in case you want to work in the shop context on the platform. So please use the references provided with the user data to access user related entities, such as user products. Don't hard code any URLs into your source code\!

|| Url | .../v1/shops/\{shopId\} ||
|| Sample | [http://api.spreadshirt.net/api/v1/shops/40000|http://api.spreadshirt.net/api/v1/shops/40000] ||
|| Type | Entity ||
|| Method | GET ||
|| Special Status Codes | ||

*Response Representation:*
{noformat}
<shop ...>
...
</shop>
{noformat}

See [Shop Representation|#Shop]

h2. Retrieve Shop Address

Returns the default shop address.

|| Url | .../v1/shops/\{shopId\}/address ||
|| Sample | [http://api.spreadshirt.net/api/v1/shops/205909/address] ||
|| Type | ENTITY ||
|| Method | GET ||
|| Special Status Codes | ||
|| APIKey | false ||
|| SessionId | false ||

*Response Representation:*

{code}
<address ...>
...
</address>
{code}

See [Address Representation|#Address]

h2. Retrieve Shop Application Entity

|| Url | .../v1/shops/\{shopId\}/applications/\{applicationId\} ||
|| Sample | [http://api.spreadshirt.net/api/v1/shops/205909/applications/1] ||
|| Type | Entity ||
|| Method | GET ||
|| Special Status Codes | ||

*Payload:*

{noformat}
<application ...>
   ...
</application>
{noformat}

See [Application Representation|#Application]

h2. Retrieve Shop Applications List

|| Url | .../v1/shops/\{shopId\}/applications ||
|| Sample | [http://api.spreadshirt.net/api/v1/shops/205909/applications|http://api.spreadshirt.net/api/v1/shops/205909/applications] ||
|| Type | List ||
|| Method | GET ||
|| Special Status Codes | ||

*Payload:*

{noformat}
<applications...>
    <application...>
        <!-- see payload below -->
    </application>
    ...
</applications>
{noformat}

See [Application Representation|#Application]

h1. Representations

h2. Shop

|| Field || Description \\ ||
| shop \\ | Representation of a platform shop. \\ |
| shop/name \\ | The name of that shop on the platform, e.g. demoshop. \\ |
| shop/user \\ | Returns a reference of the user that owns that shop. \\ |
| shop/country \\ | The country configured for this shop. \\ |
| shop/language \\ | The language configured for this shop. \\ |
| shop/currency \\ | The currency configured for this shop. \\ |
| shop/address | The default shop address, e.g. for impress. |
| shop/passwordRestricted | Tells you whether this shop is password protected. |
| shop/hidden | Tells you whether this shop is hidden. |
| shop/discountSupported | Defines whether articles/products of this shop are included into basket discount calculation. |
| shop/discountScale | Reference to the default discount scale of this shop. |
| shop/defaultShippingType | Reference to the default shipping type. |
| shop/productTypes \\ | Reference to the shop's product types. \\ |
| shop/printTypes \\ | Reference to the shop's print types. \\ |
| shop/fontFamilies \\ | Reference to the shop's font families. \\ |
| shop/productTypeDepartments \\ | Reference to the shop's product type departments. \\ |
| shop/designCategories \\ | Reference to the shop's design categories. \\ |
| shop/designs \\ | Reference to the shop's designs. \\ |
| shop/articleCategories \\ | Reference to the shop's article categories. \\ |
| shop/articles \\ | Reference to the shop's articles. \\ |
| shop/products \\ | Reference to the shop's products. \\ |
| shop/currencies \\ | Reference to the platform currencies. \\ |
| shop/languages \\ | Reference to the platform languages. \\ |
| shop/countries \\ | Reference to the platform countries. \\ |
| shop/baskets \\ | Reference to the platform baskets. \\ |

Example:

{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<shop xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns="http://api.spreadshirt.net" 
xlink:href="http://api.spreadshirt.net/api/v1/shops/205909" id="205909">
<name>demoshop</name>
<user xlink:href="http://api.spreadshirt.net/api/v1/users/40000" id="40000"/>
<country xlink:href="http://api.spreadshirt.net/api/v1/countries/1" id="1"/>
<language xlink:href="http://api.spreadshirt.net/api/v1/languages/1" id="1"/>
<currency xlink:href="http://api.spreadshirt.net/api/v1/currencies/1" id="1"/>


<address xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/address"/>
    <passwordRestricted>false</passwordRestricted>
   <hidden>true</hidden>
<discountSupported>true</discountSupported>
<discountScale id="1" xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/discountScales/1"/>
    <defaultShippingType id="1"/>

<productTypes xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/productTypes"/>
<printTypes xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/printTypes"/>
<fontFamilies xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/fontFamilies"/>
<productTypeDepartments xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/productTypeDepartments"/>
<designCategories xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/designCategories"/>
<designs xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/designs"/>
<articleCategories xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/articleCategories"/>
<articles xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/articles"/>
<products xlink:href="http://api.spreadshirt.net/api/v1/shops/205909/products"/>
<currencies xlink:href="http://api.spreadshirt.net/api/v1/currencies"/>
<languages xlink:href="http://api.spreadshirt.net/api/v1/languages"/>
<countries xlink:href="http://api.spreadshirt.net/api/v1/countries"/>
<baskets xlink:href="http://api.spreadshirt.net/api/v1/baskets"/>
</shop>
{code}

h2. Application

|| Field || Description ||
| application | Representation of a shop application. |
| application/name | Name of the application. |
| application/properties | Application specific properties. |

Example:
{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns="http://api.spreadshirt.net" 
xlink:href="http://api.spreadshirt.net/api/v1/shops/591997" 
id="1">
<name>confomat7</name>
<properties>
<property key="uploadMode">communityMode</property>
<property key="showProductTypeGallery">true</property>
<property key="showAddText">true</property>
<property key="showDesignGallery">true</property>
<property key="showDesignSearch">true</property>
<property key="showDesignUpload">true</property>  
<property key="showMarketplaceDesigns">true</property>
</properties>
...
</application>
{code}

h2. Address

Example:&nbsp;

{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<address xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://api.spreadshirt.net"
type="private">
<company>BITBOOST SYSTEMS</company>
<person>
<firstName>John</firstName>
<lastName>Smith</lastName>
</person>
<street>E DRACHMAN</street>
<houseNumber>421</houseNumber>
<streetAnnex>Appartment 2</streetAnnex>
<city>Los Angeles</city>
<state code="CA">California</state>
<country code="US"/>
<zipCode>85705</zipCode>
<email>mbs@spreadshirt.net</email>
<phone>+49 341 789 123</phone>
<fax>+49 341 789 123</fax>
</address>
{code}