GET

Description

Retrieves a list of currencies or a single currency.

URL structure

https://api.fortnox.se/3/currencies/{Code}

Method

GET

Version

3

Response

The currency register can return a list of records or a single record. By specifying a Code in the URL, a single record will be returned. Not specifying a Code will return a list of records.

<?xml version="1.0" encoding="UTF-8"?>
<Currencies>
  <CurrencySubset url="https://api.fortnox.se/3/currencies/SEK">
    <BuyRate>1</BuyRate>
    <Code>SEK</Code>
    <Date>2012-02-27</Date>
    <Description>Svensk krona</Description>
    <SellRate>1</SellRate>
    <Unit>1</Unit>
  </CurrencySubset>

  [...]

  <CurrencySubset url="https://api.fortnox.se/3/currencies/USD">
    <BuyRate>6</BuyRate>
    <Code>USD</Code>
    <Date>2013-11-12</Date>
    <Description>US Dollar</Description>
    <SellRate>6</SellRate>
    <Unit>1</Unit>
  </CurrencySubset>
</Currencies>
<?xml version="1.0" encoding="UTF-8"?>
<Currency url="https://api.fortnox.se/3/currencies/SEK">
  <BuyRate>1</BuyRate>
  <Code>SEK</Code>
  <Date>2012-02-27</Date>
  <Description>Svensk krona</Description>
  <SellRate>1</SellRate>
  <Unit>1</Unit>
</Currency>
{
  "Currencies": [
    {
      "@url": "https://api.fortnox.se/3/currencies/SEK",
      "BuyRate": 1,
      "Code": "SEK",
      "Date": "2012-02-27",
      "Description": "Svensk krona",
      "SellRate": 1,
      "Unit": 1
    },

    [...]

    {
      "@url": "https://api.fortnox.se/3/currencies/USD",
      "BuyRate": 6,
      "Code": "USD",
      "Date": "2013-11-12",
      "Description": "US Dollar",
      "SellRate": 6,
      "Unit": 1
    }
  ]
}
{
  "Currency": {
    "@url": "https://api.fortnox.se/3/currencies/SEK",
    "BuyRate": 1,
    "Code": "SEK",
    "Date": "2012-02-27",
    "Description": "Svensk krona",
    "SellRate": 1,
    "Unit": 1
  }
}

POST

Description

Creates a currency.

URL structure

https://api.fortnox.se/3/currencies

Method

POST

Version

3

Request

The request body should contain a structure of a currency, either in JSON or XML.

<Currency>
  <Code>DKK</Code>
  <Description>Dansk krona</Description>
</Currency>
{
  "Currency": {
    "Code": "DKK",
    "Description": "Dansk krona"
  }
}

Response

The response should contain the created currency in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<Currency url="https://api.fortnox.se/3/currencies/DKK">
  <BuyRate>1</BuyRate>
  <Code>DKK</Code>
  <Date>2013-12-11</Date>
  <Description>Dansk krona</Description>
  <SellRate>1</SellRate>
  <Unit>1</Unit>
</Currency>
{
  "Currency": {
    "@url": "https://api.fortnox.se/3/currencies/DKK",
    "BuyRate": 1,
    "Code": "DKK",
    "Date": "2013-12-11",
    "Description": "Dansk krona",
    "SellRate": 1,
    "Unit": 1
  }
}

PUT

Description

Updates a currency.

URL structure

https://api.fortnox.se/3/currencies/{Code}

Method

PUT

Version

3

Request

The request body should contain a structure of a currency, either in JSON or XML.

<Currency>
  <Code>DKK</Code>
  <Description>Dansk krona</Description>
  <BuyRate>1.25</BuyRate>
</Currency>
{
  "Currency": {
    "Code": "DKK",
    "Description": "Dansk krona",
    "BuyRate": "1.25"
  }
}

Response

The response should contain the updated currency in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<Currency url="https://api.fortnox.se/3/currencies/DKK">
  <BuyRate>1.25</BuyRate>
  <Code>DKK</Code>
  <Date>2013-12-11</Date>
  <Description>Dansk krona</Description>
  <SellRate>1</SellRate>
  <Unit>1</Unit>
</Currency>
{
  "Currency": {
    "@url": "https://api.fortnox.se/3/currencies/DKK",
    "BuyRate": 1.25,
    "Code": "DKK",
    "Date": "2013-12-11",
    "Description": "Dansk krona",
    "SellRate": 1,
    "Unit": 1
  }
}

DELETE

Description

Removes a currency.

URL structure

https://api.fortnox.se/3/currencies/{Code}

Method

DELETE

Version

3

Request

The request body should be empty.

Response

The response body should be empty.

Fields

Field Description Limits Type Searchable Sortable Required R/W
Url Direct URL to the record String R
BuyRate The buy rate of the currency Float R/W
Code The code of the currency String Yes R/W*
Date The date of retrieval of the buy/sell rates Date R
Description The description of the currency String Yes R/W
SellRate The sell rate of the currency Float R/W
Unit The unit of the currency Float R/W

* Only writable during POST.