GET

Description

Retrieves a list of price lists or a single price list.

URL structure

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

Method

GET

Version

3

Response

The price lists 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"?>
<PriceLists>
  <PriceListSubset url="https://api.fortnox.se/3/pricelists/A">
    <Code>A</Code>
    <Description>Prislista A</Description>
    <Comments></Comments>
    <PreSelected>true</PreSelected>
  </PriceListSubset>

  [...]

  <PriceListSubset url="https://api.fortnox.se/3/pricelists/B">
    <Code>B</Code>
    <Description>Prislista B</Description>
    <Comments></Comments>
    <PreSelected>false</PreSelected>
  </PriceListSubset>
</PriceLists>
<?xml version="1.0" encoding="UTF-8"?>
<PriceList url="https://api.fortnox.se/3/pricelists/A">
  <Code>A</Code>
  <Description>Prislista A</Description>
  <Comments>En prislista för privatpersoner</Comments>
  <PreSelected>true</PreSelected>
</PriceList>
{
  "PriceLists": {
    "PriceListSubset": [
      {
        "@url": "https://api.fortnox.se/3/pricelists/A",
        "Code": "A",
        "Description": "Prislista A",
        "Comments": "",
        "PreSelected": true
      },

      [...]

      {
        "@url": "https://api.fortnox.se/3/pricelists/B",
        "Code": "B",
        "Description": "Prislista B",
        "Comments": "",
        "PreSelected": false
      }
    ]
  }
}
{
    "PriceList": {
        "@url": "https://api.fortnox.se/3/pricelists/A",
        "Code": "A",
        "Description": "Prislista A",
        "Comments": "En prislista för privatpersoner"
    }
}

POST

Description

Creates a price list.

URL structure

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

Method

POST

Version

3

Request

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

<?xml version="1.0" encoding="UTF-8"?>
<PriceList>
  <Code>AB</Code>
  <Description>Prislista AB</Description>
  <Comments>En prislista för privatpersoner</Comments>
  <PreSelected>false</PreSelected>
</PriceList>
{
  "PriceList": {
    "Code": "AB",
    "Description": "Prislista AB",
    "Comments": "En prislista för privatpersoner",
    "PreSelected": false
  }
}

Response

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

<?xml version="1.0" encoding="UTF-8"?>
<PriceList url="https://api.fortnox.se/3/pricelists/AB">
  <Code>AB</Code>
  <Description>Prislista AB</Description>
  <Comments>En prislista för privatpersoner</Comments>
  <PreSelected>false</PreSelected>
</PriceList>
{
    "PriceList": {
        "@url": "https://api.fortnox.se/3/pricelists/AB",
        "Code": "AB",
        "Description": "Prislista AB",
        "Comments": "En prislista för privatpersoner",
        "PreSelected": false
    }
}

PUT

Description

Updates a price list.

URL structure

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

Method

PUT

Version

3

Request

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

<?xml version="1.0" encoding="UTF-8"?>
<PriceList>
  <Code>A</Code>
  <Description>Prislista A</Description>
  <Comments></Comments>
</PriceList>
{
  "PriceList": {
    "Code": "A",
    "Description": "Prislista A"
  }
}

Response

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

<?xml version="1.0" encoding="UTF-8"?>
<PriceList url="https://api.fortnox.se/3/pricelists/A">
  <Code>A</Code>
  <Description>Prislista A</Description>
  <Comments></Comments>
  <PreSelected>true</PreSelected>
</PriceList>
{
    "PriceList": {
        "@url": "https://api.fortnox.se/3/pricelists/A",
        "Code": "A",
        "Description": "Prislista A",
        "Comments": "",
        "PreSelected": false
    }
}

Fields

Field Description Limits Type Searchable Sortable Required R/W
Url Direct url to the record  – String R
Code Code of pricelist  – String Yes Yes Yes R/W*
Description Description of pricelist  – String Yes R/W
Comments Comments for pricelist  – String Yes Yes R/W
PreSelected If the price list is pre selected Boolean R

* Only writable during POST.