Introduction

This best practice example describes how to create supplier invoices in Fortnox.

A supplier invoice in Fortnox is built up by information from the following resources

All Fortnox accounts will have two (2) GB free storage area that can be used to connect images to most records in Fortnox, e.g. vouchers, supplier invoices, articles and assets.

If you have an image of the supplier invoice, we recommend that you always upload this and connect it to the supplier invoice in Fortnox. This creates a high user value in the software.

By connecting an image to a supplier invoice our users will be able to see it both when reviewing the supplier invoice and in some reports, e.g the performance report.

Supplier Invoice

Supplier Invoice

The resource “Supplier Invoices” requires that you have the scope for supplier invoices enabled.

Supplier invoices in Fortnox supports both foreign and domestic currencies. When using a foreign currency you’ve got the ability to provide a currency rate against the domestic currency. If no currency rate is provided Fortnox will automatically fill in the exchange rate.

Suppliers

The resource “Suppliers” requires that you have the scope for suppliers enabled.

Before creating a supplier invoice you need to create the supplier that the invoice is from.

You can choose if you want to set a supplier number yourself or if you want Fortnox to use the internal number series for suppliers.

Address, payment and bookkeeping information is stored by the supplier resource. In the payment information you can provide information about the recipient’s bank account. For Swedish domestic payments, Bankgiro and Plusgiro and account number can be used, for international payments only Iban with Bic code.

  1. Bankgiro (BG)
  2. Plusgiro (PG)
  3. Bank account number
  4. Iban and Bic

Supplier Invoice Accruals

The resource “Supplier Invoice Accruals” requires that you have the scope for suppliers invoices enabled.

Accruals on supplier invoices is supported by Fortnox, however this is not a mandatory function. Many users appreciate that they can use accruals on certain invoices.

Accruals means that you can divide the cost of a supplier invoice between different months. For example, if you have a rental cost for three month on a single supplier invoice, you can divide the cost on three months by using accruals.

Step by step

1. Is this a new supplier?

First of all you need to decide if this is a new supplier or not. A simple way of doing this is to see if the supplier exists by searching for email, name or organisation number.

1.1 If it’s a new supplier, create it

To create a new supplier you only need to provide a name, but we recommend that you have this as a standard.

  • Name
  • Address
  • Zip Code
  • City
  • BG, PG or a bank account

You can also choose to provide a supplier number, if no supplier number is provided the next available in the number series will be used.

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<?xml version="1.0" encoding="UTF-8"?>
<Supplier>
  <BG>4374558-7</BG>
  <Currency>SEK</Currency>
  <Name>DataTech</Name>
  <SupplierNumber>1001</SupplierNumber>
</Supplier>
<?xml version="1.0" encoding="UTF-8"?>
<Supplier url="https://api.fortnox.se/3/suppliers/1001">
    <Active>true</Active>
    <Address1></Address1>

    [...]

    <YourReference></YourReference>
    <ZipCode></ZipCode>
</Supplier>

1.2 If you think the supplier already exists in Fortnox

Verify that the supplier already exists by retrieving it by using it’s SupplierNumber.

METHOD

GET

URL STRUCTURE

https://api.fortnox.se/3/suppliers/{SupplierNumber}

Successful Response

If the supplier exists, proceed to step 2.

Unsuccessful Response

If the supplier didn’t exist, create it by following the step 1.1.

2. Verify that the cost account exists in Fortnox

The accounts that you use needs to exist in Fortnox and be active. By checking this prior to creating the supplier invoice, you save yourself a few error messages.

METHOD

GET

URL STRUCTURE

https://api.fortnox.se/3/accounts/{AccountNumber}

Successful Response

If the account exists, proceed to step 3.

Unsuccessful Response

If the account didn’t exist, create it by following the step 2.1.

2.1 Create a new account

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<?xml version="1.0" encoding="UTF-8"?>
<Account>
  <Description>Inköp av varor från Sverige</Description>
  <Number>4000</Number>
</Account>
<?xml version="1.0" encoding="UTF-8"?>
<Account url="https://api.fortnox.se/3/accounts/4000?financialyear=1">
  <Active>true</Active>
  <BalanceBroughtForward>0</BalanceBroughtForward>
  <CostCenter></CostCenter>
  <CostCenterSettings>ALLOWED</CostCenterSettings>
  <Description>Inköp av varor från Sverige</Description>
  <Number>4000</Number>
  <Project>0</Project>
  <ProjectSettings>ALLOWED</ProjectSettings>
  <SRU>0</SRU>
  <TransactionInformation></TransactionInformation>
  <TransactionInformationSettings>ALLOWED</TransactionInformationSettings>
  <VATCode></VATCode>
  <Year>1</Year>
</Account>

Repeat the same process as you did with accounts, for both the cost centers and the projects!

3. Create the supplier invoice

When validation has been made for the accounts, the cost centers and the projects, you’re ready to create the supplier invoice.

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoice>
  <Currency>SEK</Currency>
  <CurrencyRate>1</CurrencyRate>
  <CurrencyUnit>1</CurrencyUnit>
  <DisablePaymentFile>false</DisablePaymentFile>
  <DueDate>2014-01-15</DueDate>
  <GivenNumber></GivenNumber>
  <InvoiceDate>2014-01-15</InvoiceDate>
  <InvoiceNumber>1211</InvoiceNumber>
  <SupplierInvoiceRows>
    <SupplierInvoiceRow>
      <Account>4011</Account>
      <Debit>1000</Debit>
      <Credit></Credit>
      <Total>1000</Total>
    </SupplierInvoiceRow>
  </SupplierInvoiceRows>
  <SupplierNumber>101</SupplierNumber>
  <Total>1250.00</Total>
  <VAT>250.00</VAT>
</SupplierInvoice>
<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoice url="https://api.fortnox.se/3/supplierinvoices/7">
  <AdministrationFee>0</AdministrationFee>
  <Balance>1250</Balance>
  <Booked>false</Booked>
  <Cancelled>false</Cancelled>
  <Comments></Comments>
  <CostCenter></CostCenter>
  <Credit>false</Credit>
  <CreditReference></CreditReference>
  <Currency>SEK</Currency>
  <CurrencyRate>1</CurrencyRate>
  <CurrencyUnit>1</CurrencyUnit>
  <DisablePaymentFile>false</DisablePaymentFile>
  <DueDate>2014-01-15</DueDate>
  <ExternalInvoiceNumber></ExternalInvoiceNumber>
  <ExternalInvoiceSeries></ExternalInvoiceSeries>
  <Freight>0</Freight>
  <GivenNumber>7</GivenNumber>
  <InvoiceDate>2014-01-15</InvoiceDate>
  <InvoiceNumber>1211</InvoiceNumber>
  <OCR></OCR>
  <OurReference></OurReference>
  <Project></Project>
  <RoundOffValue>0</RoundOffValue>
  <SupplierInvoiceRows>
    <SupplierInvoiceRow>
      <Account>2440</Account>
      <ArticleNumber></ArticleNumber>
      <Code>TOT</Code>
      <CostCenter></CostCenter>
      <AccountDescription>Leverantörsskulder</AccountDescription>
      <ItemDescription></ItemDescription>
      <Debit>0</Debit>
      <DebitCurrency>0</DebitCurrency>
      <Credit>1250</Credit>
      <CreditCurrency>1250</CreditCurrency>
      <Project></Project>
      <Price>0</Price>
      <Quantity>0</Quantity>
      <Total>-1250</Total>
      <Unit></Unit>
    </SupplierInvoiceRow>
    <SupplierInvoiceRow>
      <Account>2641</Account>
      <ArticleNumber></ArticleNumber>
      <Code>VAT</Code>
      <CostCenter></CostCenter>
      <AccountDescription>Debiterad ingående moms</AccountDescription>
      <ItemDescription></ItemDescription>
      <Debit>250</Debit>
      <DebitCurrency>250</DebitCurrency>
      <Credit>0</Credit>
      <CreditCurrency>0</CreditCurrency>
      <Project></Project>
      <Price>0</Price>
      <Quantity>0</Quantity>
      <Total>250</Total>
      <Unit></Unit>
    </SupplierInvoiceRow>
    <SupplierInvoiceRow>
      <Account>4011</Account>
      <ArticleNumber></ArticleNumber>
      <Code>   </Code>
      <CostCenter></CostCenter>
      <AccountDescription></AccountDescription>
      <ItemDescription></ItemDescription>
      <Debit>1000</Debit>
      <DebitCurrency>1000</DebitCurrency>
      <Credit>0</Credit>
      <CreditCurrency>0</CreditCurrency>
      <Project></Project>
      <Price>0</Price>
      <Quantity>0</Quantity>
      <Total>1000</Total>
      <Unit></Unit>
    </SupplierInvoiceRow>
  </SupplierInvoiceRows>
  <SupplierNumber>101</SupplierNumber>
  <SupplierName>Telefoniföretaget AB</SupplierName>
  <Total>1250</Total>
  <VAT>250</VAT>
  <YourReference></YourReference>
  <VoucherNumber></VoucherNumber>
  <VoucherSeries></VoucherSeries>
  <VoucherYear></VoucherYear>
</SupplierInvoice>

4. Accruals

To create accruals for a supplier invoices you need to use the resource “SupplierInvoiceAccruals” after you’ve created the invoice.

4.1 Accruals without rows

If you only intend to use one cost account and not using any cost center or project, you can make a simple request without rows.

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<SupplierInvoiceAccrual>
  <AccrualAccount>1790</AccrualAccount>
  <CostAccount>5820</CostAccount>
  <EndDate>2014-07-01</EndDate>
  <Period>MONTHLY</Period>
  <SupplierInvoiceNumber>6</SupplierInvoiceNumber>
  <StartDate>2014-03-01</StartDate>
  <Total>800</Total>
</SupplierInvoiceAccrual>
<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoiceAccrual url="https://api.fortnox.se/3/supplierinvoiceaccruals/6">
  <AccrualAccount>1790</AccrualAccount>
  <CostAccount>5820</CostAccount>
  <Description></Description>
  <EndDate>2014-07-01</EndDate>
  <SupplierInvoiceNumber>6</SupplierInvoiceNumber>
  <Period>MONTHLY</Period>
  <SupplierInvoiceAccrualRows>
    <SupplierInvoiceAccrualRow>
      <Account>1790</Account>
      <CostCenter></CostCenter>
      <Credit>200</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
    <SupplierInvoiceAccrualRow>
      <Account>5820</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>200</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
  </SupplierInvoiceAccrualRows>
  <StartDate>2014-03-01</StartDate>
  <Times>4</Times>
  <Total>800</Total>
  <VATIncluded>false</VATIncluded>
</SupplierInvoiceAccrual>

4.2 Accruals with rows

If you only intend to use several cost account and using any cost center or project, you can make a request with rows.

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<SupplierInvoiceAccrual>
  <AccrualAccount>1790</AccrualAccount>
  <CostAccount>5820</CostAccount>
  <EndDate>2014-07-01</EndDate>
  <SupplierInvoiceNumber>7</SupplierInvoiceNumber>
  <Period>MONTHLY</Period>
  <SupplierInvoiceAccrualRows>
    <SupplierInvoiceAccrualRow>
      <Account>1790</Account>
      <CostCenter></CostCenter>
      <Credit>200</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
    <SupplierInvoiceAccrualRow>
      <Account>5820</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>100</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
    <SupplierInvoiceAccrualRow>
      <Account>6570</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>100</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
  </SupplierInvoiceAccrualRows>
  <StartDate>2014-03-01</StartDate>
  <Total>800</Total>
</SupplierInvoiceAccrual>
<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoiceAccrual url="https://api.fortnox.se/3/supplierinvoiceaccruals/7">
  <AccrualAccount>1790</AccrualAccount>
  <CostAccount>5820</CostAccount>
  <Description></Description>
  <EndDate>2014-07-01</EndDate>
  <SupplierInvoiceNumber>7</SupplierInvoiceNumber>
  <Period>MONTHLY</Period>
  <SupplierInvoiceAccrualRows>
    <SupplierInvoiceAccrualRow>
      <Account>1790</Account>
      <CostCenter></CostCenter>
      <Credit>200</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
    <SupplierInvoiceAccrualRow>
      <Account>5820</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>100</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
    <SupplierInvoiceAccrualRow>
      <Account>6570</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>100</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </SupplierInvoiceAccrualRow>
  </SupplierInvoiceAccrualRows>
  <StartDate>2014-03-01</StartDate>
  <Times>4</Times>
  <Total>800</Total>
  <VATIncluded>false</VATIncluded>
</SupplierInvoiceAccrual>

5. Upload an image

To connect an image to the supplier invoice, you first need to upload it to Fortnox.

METHOD

POST

URL STRUCTURE

https://api.fortnox.se/3/inbox?path=inbox_s

REQUEST BODY

The file should be sent as a data stream.

<?xml version="1.0" encoding="UTF-8"?>
<File url="https://api.fortnox.se/3/inbox/0df13d88-0686-49c8-987d-b9e384dedd7a">
  <Comments></Comments>
  <Id>0df13d88-0686-49c8-987d-b9e384dedd7a</Id>
  <Name>supplierinvoice.png</Name>
  <Path>inbox_s</Path>
  <Size>157445</Size>
</File>

6. Connect the uploaded image to the supplier invoice

METHOD

POST

URL STRUCTURE

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

REQUEST BODY

<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoiceFileConnection>
  <FileId>0df13d88-0686-49c8-987d-b9e384dedd7a</FileId>
  <SupplierInvoiceNumber>32</SupplierInvoiceNumber>
</SupplierInvoiceFileConnection>
<?xml version="1.0" encoding="UTF-8"?>
<SupplierInvoiceFileConnection url="https://api.fortnox.se/3/supplierinvoicefileconnections/0df13d88-0686-49c8-987d-b9e384dedd7a">
  <FileId>0df13d88-0686-49c8-987d-b9e384dedd7a</FileId>
  <Name>supplierinvoice.png</Name>
  <SupplierInvoiceNumber>32</SupplierInvoiceNumber>
  <SupplierName>Telefoniföretaget AB</SupplierName>
</SupplierInvoiceFileConnection>

7. Bookkeep the supplier invoice

The final step for the supplier invoice is to bookkeep it, after that it can be payed and a voucher appears in the accounting module. If supplier invoice approval is active, you can’t bookkeep the supplier invoice before it has been approved.

METHOD

PUT

URL STRUCTURE

https://api.fortnox.se/3/supplierinvoices/{GivenNumber}/bookkeep

REQUEST BODY

The request body should be empty.

The bookkept supplier invoice will be returned.