GET

Description

Retrieves a list of contract templates or a single contract template.

URL structure

https://api.fortnox.se/3/contracttemplates/{TemplateNumber}

Method

GET

Version

3

Response

The contract template resource can return a list of records or a single record. By specifying a TemplateNumber in the URL, a single record will be returned. Not specifying a TemplateNumber will return a list of records.

<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplates TotalResources="3" TotalPages="1" CurrentPage="1">
  <ContractTemplateSubset url="https://api.fortnox.se/3/contracttemplates/1">
    <ContractLength>24</ContractLength>
    <ContractTemplate>1</ContractTemplate>
    <ContractTemplateName>Mall 1</ContractTemplateName>
    <InvoiceInterval>3</InvoiceInterval>
  </ContractTemplateSubset>

  [...]

  <ContractTemplateSubset url="https://api.fortnox.se/3/contracttemplates/3">
    <ContractLength>12</ContractLength>
    <ContractTemplate>3</ContractTemplate>
    <ContractTemplateName>Mall 3</ContractTemplateName>
    <InvoiceInterval>3</InvoiceInterval>
  </ContractTemplateSubset>
</ContractTemplates>
<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplate url="https://api.fortnox.se/3/contracttemplates/1">
  <AdministrationFee>29</AdministrationFee>
  <ContractLength>24</ContractLength>
  <Freight>99</Freight>
  <InvoiceInterval>3</InvoiceInterval>
  <InvoiceRows>
    <ContractTemplateRow>
      <AccountNumber>0</AccountNumber>
      <ArticleNumber>201</ArticleNumber>
      <CostCenter></CostCenter>
      <DeliveredQuantity>1</DeliveredQuantity>
      <Description>Abonnemang - 24 mån</Description>
      <Discount>0</Discount>
      <DiscountType>PERCENT</DiscountType>
      <Price>0</Price>
      <Project>0</Project>
      <Unit>st</Unit>
    </ContractTemplateRow>
  </InvoiceRows>
  <Continuous>false</Continuous>
  <OurReference></OurReference>
  <PrintTemplate>st</PrintTemplate>
  <Remarks></Remarks>
  <TemplateName>Mall 1</TemplateName>
  <TemplateNumber>1</TemplateNumber>
  <TermsOfDelivery>FVL</TermsOfDelivery>
  <TermsOfPayment>30</TermsOfPayment>
  <WayOfDelivery>HÄM</WayOfDelivery>
</ContractTemplate>
{
  "MetaInformation": {
    "@TotalResources": 3,
    "@TotalPages": 1,
    "@CurrentPage": 1
  },
  "ContractTemplates": [
    {
      "@url": "https://api.fortnox.se/3/contracttemplates/1",
      "ContractLength": 24,
      "ContractTemplate": 1,
      "ContractTemplateName": "Mall 1",
      "InvoiceInterval": 3
    },

    [...]

    {
      "@url": "https://api.fortnox.se/3/contracttemplates/3",
      "ContractLength": 12,
      "ContractTemplate": 3,
      "ContractTemplateName": "Mall 3",
      "InvoiceInterval": 3
    }
  ]
}
{
  "ContractTemplate": {
    "@url": "https://api.fortnox.se/3/contracttemplates/1",
    "AdministrationFee": 29,
    "ContractLength": 24,
    "Freight": 99,
    "InvoiceInterval": 3,
    "InvoiceRows": [
      {
        "AccountNumber": 0,
        "ArticleNumber": "201",
        "CostCenter": "",
        "DeliveredQuantity": 1,
        "Description": "Abonnemang - 24 mån",
        "Discount": 0,
        "DiscountType": "PERCENT",
        "Price": 0,
        "Project": "",
        "Unit": "st"
      }
    ],
    "Continuous": false,
    "OurReference": "",
    "PrintTemplate": "st",
    "Remarks": "",
    "TemplateName": "Mall 1",
    "TemplateNumber": 1,
    "TermsOfDelivery": "FVL",
    "TermsOfPayment": "30",
    "WayOfDelivery": "HÄM"
  }
}

POST

Description

Creates a contract template

URL structure

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

Method

POST

Version

3

Request

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

<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplate>
  <ContractLength>12</ContractLength>
  <Continuous>false</Continuous>
  <InvoiceInterval>3</InvoiceInterval>
  <InvoiceRows>
    <ContractTemplateRow>
      <ArticleNumber>11</ArticleNumber>
      <DeliveredQuantity>10</DeliveredQuantity>
    </ContractTemplateRow>
  </InvoiceRows>
  <TemplateName>6 Months</TemplateName>
</ContractTemplate>
{
  "ContractTemplate": {
    "ContractLength": 6,
    "Continuous": false,
    "InvoiceInterval": 3,
    "InvoiceRows": [
      {
        "ArticleNumber": "11",
        "DeliveredQuantity": 10
      }
    ],
    "TemplateName": "6 Months"
  }
}

Response

The response should contain the created contract template, in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplate url="https://api.fortnox.se/3/contracttemplates/5">
  <AdministrationFee>0</AdministrationFee>
  <ContractLength>12</ContractLength>
  <Freight>0</Freight>
  <InvoiceInterval>3</InvoiceInterval>
  <InvoiceRows>
    <ContractTemplateRow>
      <AccountNumber>0</AccountNumber>
      <ArticleNumber>11</ArticleNumber>
      <CostCenter></CostCenter>
      <DeliveredQuantity>10</DeliveredQuantity>
      <Description></Description>
      <Discount>0</Discount>
      <DiscountType>PERCENT</DiscountType>
      <Price>0</Price>
      <Project>0</Project>
      <Unit></Unit>
    </ContractTemplateRow>
  </InvoiceRows>
  <Continuous>false</Continuous>
  <OurReference></OurReference>
  <PrintTemplate></PrintTemplate>
  <Remarks></Remarks>
  <TemplateName>6 Months</TemplateName>
  <TemplateNumber>6</TemplateNumber>
  <TermsOfDelivery></TermsOfDelivery>
  <TermsOfPayment></TermsOfPayment>
  <WayOfDelivery></WayOfDelivery>
</ContractTemplate>
{
  "ContractTemplate": {
    "@url": "https://api.fortnox.se/3/contracttemplates/5",
    "AdministrationFee": 0,
    "ContractLength": 6,
    "Freight": 0,
    "InvoiceInterval": 3,
    "InvoiceRows": [
      {
        "AccountNumber": 0,
        "ArticleNumber": "11",
        "CostCenter": "",
        "DeliveredQuantity": 10,
        "Description": "",
        "Discount": 0,
        "DiscountType": "PERCENT",
        "Price": 0,
        "Project": "",
        "Unit": ""
      }
    ],
    "Continuous": false,
    "OurReference": null,
    "PrintTemplate": null,
    "Remarks": null,
    "TemplateName": "6 Mån",
    "TemplateNumber": "5",
    "TermsOfDelivery": null,
    "TermsOfPayment": null,
    "WayOfDelivery": null
  }
}

PUT

Description

Updates a contract template.

URL structure

https://api.fortnox.se/3/contracttemplates/{TemplateNumber}

Method

PUT

Version

3

Request

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

<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplate>
  <InvoiceRows>
    <ContractTemplateRow>
      <ArticleNumber>11</ArticleNumber>
      <DeliveredQuantity>5</DeliveredQuantity>
    </ContractTemplateRow>
  </InvoiceRows>
</ContractTemplate>
{
  "ContractTemplate": {
    "InvoiceRows": [
      {
        "ArticleNumber": "11",
        "DeliveredQuantity": 5
      }
    ]
  }
}

Response

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

<?xml version="1.0" encoding="UTF-8"?>
<ContractTemplate url="https://api.fortnox.se/3/contracttemplates/5">
  <AdministrationFee>0</AdministrationFee>
  <ContractLength>6</ContractLength>
  <Freight>0</Freight>
  <InvoiceInterval>3</InvoiceInterval>
  <InvoiceRows>
    <ContractTemplateRow>
      <AccountNumber>0</AccountNumber>
      <ArticleNumber>11</ArticleNumber>
      <CostCenter></CostCenter>
      <DeliveredQuantity>5</DeliveredQuantity>
      <Description></Description>
      <Discount>0</Discount>
      <DiscountType>PERCENT</DiscountType>
      <Price>0</Price>
      <Project>0</Project>
      <Unit></Unit>
    </ContractTemplateRow>
  </InvoiceRows>
  <Continuous>false</Continuous>
  <OurReference></OurReference>
  <PrintTemplate></PrintTemplate>
  <Remarks></Remarks>
  <TemplateName>6 Months</TemplateName>
  <TemplateNumber>5</TemplateNumber>
  <TermsOfDelivery></TermsOfDelivery>
  <TermsOfPayment></TermsOfPayment>
  <WayOfDelivery></WayOfDelivery>
</ContractTemplate>
{
  "ContractTemplate": {
    "@url": "https://api.fortnox.se/3/contracttemplates/5",
    "AdministrationFee": 0,
    "ContractLength": 6,
    "Freight": 0,
    "InvoiceInterval": 3,
    "InvoiceRows": [
      {
        "AccountNumber": 0,
        "ArticleNumber": "11",
        "CostCenter": "",
        "DeliveredQuantity": 5,
        "Description": "",
        "Discount": 0,
        "DiscountType": "PERCENT",
        "Price": 0,
        "Project": "",
        "Unit": ""
      }
    ],
    "Continuous": false,
    "OurReference": null,
    "PrintTemplate": null,
    "Remarks": null,
    "TemplateName": "6 Months",
    "TemplateNumber": 5,
    "TermsOfDelivery": null,
    "TermsOfPayment": null,
    "WayOfDelivery": null
  }
}

Fields

Contract Template

Field Description Limits Type Searchable Sortable Required R/W
Url Direct URL to the record String R
AdministrationFee Administration fee Float R/W
ContractLength Length of the contract 0 if Continuous is set to true Integer R/W
Freight Freight Float R/W
InvoiceInterval Invoice interval Integer Yes R/W
InvoiceRows Yes
Continuous If the contract is continuous Boolean Yes R/W
OurReference Our reference String R/W
PrintTemplate Print template code String R/W
Remarks Remarks String R/W
TemplateName Name of the template String Yes R/W
TemplateNumber Number of the template String R/W
TermsOfDelivery Terms of delivery code String R/W
TermsOfPayment Terms of payment code String R/W
WayOfDelivery Way of delivery code String R/W

Invoice Row

Field Description Limits Type Searchable Sortable R/W
AccountNumber Account number (If empty Fortnox will use setting on article) 4 digits Integer R/W
ArticleNumber Article number String R/W
CostCenter Cost center code String R/W
DeliveredQuantity Delivered quantity Float R/W
Description Description String R/W
Discount Discount amount Float R/W
DiscountType AMOUNT / PERCENT String R/W
Price Unit price Float R/W
Project Project code String R/W
Unit Code of unit String R/W