View Source

{excerpt}This document specifies the API of common services, that allow for example to retrieve the valid languages, countries and currencies.{excerpt}

{toc}

h1. Resources

h2. Retrieve Country List

|| Url | .../v1/countries ||
|| Sample | [http://api.spreadshirt.net/api/v1/countries] ||
|| Type | List ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Country Representation|#Country]




h2. Retrieve Country Entity

|| Url | .../v1/countries/\{countryId\} ||
|| Sample | [http://api.spreadshirt.net/api/v1/countries/1] ||
|| Type | Entity ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Country Representation|#Country]




h2. Retrieve Currency List

|| Url | .../v1/currencies ||
|| Sample | [http://api.spreadshirt.net/api/v1/currencies] ||
|| Type | List ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Currency Representation|#Currency]




h2. Retrieve Currency Entity

|| Url | .../v1/currencies/\{currencyId\} ||
|| Sample | [http://api.spreadshirt.net/api/v1/currencies/1] ||
|| Type | Entity ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Currency Representation|#Currency]




h2. Retrieve Language List


|| Url | .../v1/languages ||
|| Sample | [http://api.spreadshirt.net/api/v1/languages] ||
|| Type | List ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Language Representation|#Language]




h2. Retrieve Language Entity

|| Url | .../v1/languages/\{languageId\} ||
|| Sample | [http://api.spreadshirt.net/api/v1/languages/1] ||
|| Type | Entity ||
|| Method | GET ||
|| Special Status Codes | ||

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

See [Language Representation|#Language]




h1. Representations


h2. Currency

|| Field \\ || Description \\ ||
| currency \\ | Represents a currency entity. \\ |
| currency/plain \\ | The name of the currency as it is used in written text. \\ |
| currency/isoCode \\ | The official ISO code for this currency, e.g. EUR. \\ |
| currency/symbol \\ | The currency symbol, e.g. €. \\ |
| currency/decimalCount \\ | The number of decimal places to be used when displaying prices in this currency, e.g. 2. \\ |
| currency/pattern \\ | The pattern for displaying prices for this currency. % is the price and $ the currency symbol, for example % $ for 2,00 €. \\ |
Example:

{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<currency xmlns:xlink="http://www.w3.org/1999/xlink"  
xmlns="http://api.spreadshirt.net"  
xlink:href="http://api.spreadshirt.net/api/v1/currencies/1" id="1">
<plain>EUR</plain>
   <isoCode>EUR</isoCode>
   <symbol>€</symbol>
   <decimalCount>2</decimalCount>
   <pattern>% $</pattern>
</currency>
{code}

h2. Country

|| Field || Description \\ ||
| country \\ | Represents a country entity. \\ |
| country/name | The country name. |
| country/isoCode \\ | The official ISO code of that country, e.g. DE. \\ |
| country/thousandsSeparator \\ | The thousands separator to be used when working with this country. \\ |
| country/decimalPoint \\ | The decimal point to be used when working with this country. \\ |
| country/length \\ | The length unit to be used when working with this country. \\ |
| country/length/unit \\ | |
| country/length/unitFactor \\ | |
| country/currency | Reference to the default currency for that country. \\ |

Example:

{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<country xmlns:xlink="http://www.w3.org/1999/xlink"  
xmlns="http://api.spreadshirt.net"  
xlink:href="http://api.spreadshirt.net/api/v1/countries/1" id="1">
<name>Germany</name>
<isoCode>DE</isoCode>
<thousandsSeparator>.</thousandsSeparator>
<decimalPoint>,</decimalPoint>
<length>
<unit>cm</unit>
<unitFactor>1.0</unitFactor>
</length>
<currency xlink:href="http://api.spreadshirt.net/api/v1/currencies/1" id="1"/>
</country>
{code}

h2. Language

|| Field \\ || Description \\ ||
| language \\ | Represents a language entity. \\ |
| language/isoCode \\ | The official ISO code of that language, e.g. de. \\ |
| language/name \\ | The name of the language, e.g. Deutsch. \\ |
Example:

{code}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<language xmlns:xlink="http://www.w3.org/1999/xlink"  
xmlns="http://api.spreadshirt.net"  
xlink:href="http://api.spreadshirt.net/api/v1/languages/1" id="1">
<isoCode>de</isoCode>
   <name>Deutsch</name>
</language>
{code}