List all articles

Retrieves a list of articles. The articles are returned sorted by article number with the lowest number appearing first.

Examples

Request

curl -X "GET" "https://api.fortnox.se/3/articles" \
     -H "Access-Token: 61cf63ae-4ab9-4a95-9db5-753781c4f41f" \
     -H "Client-Secret: 3Er4kHXZTJ" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"

Response

{
    "Articles": [
        {
            "@url": "https://api.fortnox.se/3/articles/BOKNINGSAVGIFT",
            "ArticleNumber": "BOKNINGSAVGIFT",
            "Description": "Bokningsavgift",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        },

        [...]

        {
            "@url": "https://api.fortnox.se/3/articles/TR01",
            "ArticleNumber": "TR01",
            "Description": "Transport",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        }
    ],
    "MetaInformation": {
        "@CurrentPage": 1,
        "@TotalPages": 1,
        "@TotalResources": 32
    }
}

Using Guzzle

Request

// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

function send_request() {
    // Articles (GET https://api.fortnox.se/3/articles)

    $client = new Client();
    $request = $client->createRequest('GET', 'https://api.fortnox.se/3/articles');

    try {
        $request->addHeaders([
            'Access-Token'=>'61cf63ae-4ab9-4a95-9db5-753781c4f41f',
            'Client-Secret'=>'3Er4kHXZTJ',
            'Content-Type'=>'application/json',
            'Accept'=>'application/json',
        ]);

        $response = $client->send($request);
        echo "Response HTTP : " . $response->getStatusCode();
    }
    catch (RequestException $e) {
        echo "HTTP Request failed\n";
        echo $e->getRequest();
        if ($e->hasResponse()) {
            echo $e->getResponse();
        }
    }
}

Response

{
    "Articles": [
        {
            "@url": "https://api.fortnox.se/3/articles/BOKNINGSAVGIFT",
            "ArticleNumber": "BOKNINGSAVGIFT",
            "Description": "Bokningsavgift",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        },

        [...]

        {
            "@url": "https://api.fortnox.se/3/articles/TR01",
            "ArticleNumber": "TR01",
            "Description": "Transport",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        }
    ],
    "MetaInformation": {
        "@CurrentPage": 1,
        "@TotalPages": 1,
        "@TotalResources": 32
    }
}

Request

require 'net/http'

def send_request
    # Articles (GET )

    begin
        uri = URI('https://api.fortnox.se/3/articles')

        # Create client          
        http = Net::HTTP.new(uri.host, uri.port)

        # Create Request
        req =  Net::HTTP::Get.new(uri)
        # Add headers
        req.add_field "Access-Token", "61cf63ae-4ab9-4a95-9db5-753781c4f41f"
        # Add headers
        req.add_field "Client-Secret", "3Er4kHXZTJ"
        # Add headers
        req.add_field "Content-Type", "application/json"
        # Add headers
        req.add_field "Accept", "application/json"

        # Fetch Request
        res = http.request(req)
        puts "Response HTTP Status Code: #{res.code}"
        puts "Response HTTP Response Body: #{res.body}"
    rescue Exception => e
        puts "HTTP Request failed (#{e.message})"
    end
end

Response

{
    "Articles": [
        {
            "@url": "https://api.fortnox.se/3/articles/BOKNINGSAVGIFT",
            "ArticleNumber": "BOKNINGSAVGIFT",
            "Description": "Bokningsavgift",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        },

        [...]

        {
            "@url": "https://api.fortnox.se/3/articles/TR01",
            "ArticleNumber": "TR01",
            "Description": "Transport",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        }
    ],
    "MetaInformation": {
        "@CurrentPage": 1,
        "@TotalPages": 1,
        "@TotalResources": 32
    }
}

Request

# Install the Python Requests library:
# `pip install requests`

import requests

def send_request():
    # Articles (GET https://api.fortnox.se/3/articles)

    try:
        r = requests.get(
            url="https://api.fortnox.se/3/articles",
            headers = {
                "Access-Token":"61cf63ae-4ab9-4a95-9db5-753781c4f41f",
                "Client-Secret":"3Er4kHXZTJ",
                "Content-Type":"application/json",
                "Accept":"application/json",
            },
        )
        print('Response HTTP Status Code : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response

{
    "Articles": [
        {
            "@url": "https://api.fortnox.se/3/articles/BOKNINGSAVGIFT",
            "ArticleNumber": "BOKNINGSAVGIFT",
            "Description": "Bokningsavgift",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        },

        [...]

        {
            "@url": "https://api.fortnox.se/3/articles/TR01",
            "ArticleNumber": "TR01",
            "Description": "Transport",
            "DisposableQuantity": "0",
            "EAN": "",
            "Housework": false,
            "PurchasePrice": "0",
            "QuantityInStock": "0",
            "ReservedQuantity": "0",
            "SalesPrice": 10,
            "StockPlace": "",
            "StockValue": "0",
            "Unit": null,
            "WebshopArticle": false
        }
    ],
    "MetaInformation": {
        "@CurrentPage": 1,
        "@TotalPages": 1,
        "@TotalResources": 32
    }
}

Using our .NET SDK

Request

ArticleConnector connector = new ArticleConnector();
Articles result = connector.Find();

Retrieve an article

Retrieves the details of an article. You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.

Examples

Request

curl -X "GET" "https://api.fortnox.se/3/articles/TR01" \
     -H "Access-Token: 61cf63ae-4ab9-4a95-9db5-753781c4f41f" \
     -H "Client-Secret: 3Er4kHXZTJ" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/TR01",
        "Active": true,
        "ArticleNumber": "TR01",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": null,
        "Description": "Transport",
        "DisposableQuantity": -8,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": null,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": null,
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 8,
        "SalesPrice": 10,
        "SalesAccount": 3011,
        "SalesPrice": 35,
        "StockGoods": false,
        "StockPlace": "",
        "StockValue": 0,
        "StockWarning": null,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": null,
        "Width": null
    }
}

Using Guzzle

Request

// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

function send_request() {
    // Article (GET https://api.fortnox.se/3/articles/TR01)

    $client = new Client();
    $request = $client->createRequest('GET', 'https://api.fortnox.se/3/articles/TR01');

    try {
        $request->addHeaders([
            'Access-Token'=>'61cf63ae-4ab9-4a95-9db5-753781c4f41f',
            'Client-Secret'=>'3Er4kHXZTJ',
            'Content-Type'=>'application/json',
            'Accept'=>'application/json',
        ]);

        $response = $client->send($request);
        echo "Response HTTP : " . $response->getStatusCode();
    }
    catch (RequestException $e) {
        echo "HTTP Request failed\n";
        echo $e->getRequest();
        if ($e->hasResponse()) {
            echo $e->getResponse();
        }
    }
}

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/TR01",
        "ArticleNumber": "TR01",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": null,
        "Description": "Transport",
        "DisposableQuantity": -8,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": null,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": null,
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 8,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": "",
        "StockValue": 0,
        "StockWarning": null,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": null,
        "Width": null
    }
}

Request

require 'net/http'

def send_request
    # Article (GET )

    begin
        uri = URI('https://api.fortnox.se/3/articles/TR01')

        # Create client          
        http = Net::HTTP.new(uri.host, uri.port)

        # Create Request
        req =  Net::HTTP::Get.new(uri)
        # Add headers
        req.add_field "Access-Token", "61cf63ae-4ab9-4a95-9db5-753781c4f41f"
        # Add headers
        req.add_field "Client-Secret", "3Er4kHXZTJ"
        # Add headers
        req.add_field "Content-Type", "application/json"
        # Add headers
        req.add_field "Accept", "application/json"

        # Fetch Request
        res = http.request(req)
        puts "Response HTTP Status Code: #{res.code}"
        puts "Response HTTP Response Body: #{res.body}"
    rescue Exception => e
        puts "HTTP Request failed (#{e.message})"
    end
end

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/TR01",
        "ArticleNumber": "TR01",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": null,
        "Description": "Transport",
        "DisposableQuantity": -8,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": null,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": null,
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 8,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": "",
        "StockValue": 0,
        "StockWarning": null,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": null,
        "Width": null
    }
}

Request

# Install the Python Requests library:
# `pip install requests`

import requests

def send_request():
    # Article (GET https://api.fortnox.se/3/articles/TR01)

    try:
        r = requests.get(
            url="https://api.fortnox.se/3/articles/TR01",
            headers = {
                "Access-Token":"61cf63ae-4ab9-4a95-9db5-753781c4f41f",
                "Client-Secret":"3Er4kHXZTJ",
                "Content-Type":"application/json",
                "Accept":"application/json",
            },
        )
        print('Response HTTP Status Code : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/TR01",
        "ArticleNumber": "TR01",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": null,
        "Description": "Transport",
        "DisposableQuantity": -8,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": null,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": null,
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 8,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": "",
        "StockValue": 0,
        "StockWarning": null,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": null,
        "Width": null
    }
}

Using our .NET SDK

Request

ArticleConnector connector = new ArticleConnector();
Article result = connector.Get("TR01");

Create an article

The created article will be returned if everything succeeded, if there was any problems an error will be returned.

Examples

Request

curl -X "POST" "https://api.fortnox.se/3/articles" \
     -H "Access-Token: 61cf63ae-4ab9-4a95-9db5-753781c4f41f" \
     -H "Client-Secret: 3Er4kHXZTJ" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d $'{
     "Article": {
         "ArticleNumber": "FRPPLUS",
         "Description": "Extra förpackning"
     }
}'

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "Active": true,
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 20,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Using Guzzle

Request

// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Post\PostBody;
use GuzzleHttp\Stream\StreamInterface;
use GuzzleHttp\Exception\RequestException;

function send_request() {
    // Articles (POST https://api.fortnox.se/3/articles)

    $client = new Client();
    $request = $client->createRequest('POST', 'https://api.fortnox.se/3/articles');
    $postBody = $request->getBody();

    try {
        $request->addHeaders([
            'Access-Token'=>'61cf63ae-4ab9-4a95-9db5-753781c4f41f',
            'Client-Secret'=>'3Er4kHXZTJ',
            'Content-Type'=>'application/json',
            'Accept'=>'application/json',
        ]);
        $body = [
            "Article" => [
                "Description" => "Extra förpackning",
                "ArticleNumber" => "FRPPLUS"
            ]
        ];
        $request->setBody(GuzzleHttp\Stream\Stream::factory(json_encode($body)));

        $response = $client->send($request);
        echo "Response HTTP : " . $response->getStatusCode();
    }
    catch (RequestException $e) {
        echo "HTTP Request failed\n";
        echo $e->getRequest();
        if ($e->hasResponse()) {
            echo $e->getResponse();
        }
    }
}

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Request

require 'net/http'
require 'json'

def send_request
    # Articles (POST )

    begin
        uri = URI('https://api.fortnox.se/3/articles')

        # Create client          
        http = Net::HTTP.new(uri.host, uri.port)

        dict = {
            "Article" => {
                "Description" => "Extra förpackning",
                "ArticleNumber" => "FRPPLUS"
            }
        }
        body = JSON.dump(dict)

        # Create Request
        req =  Net::HTTP::Post.new(uri)
        # Add headers
        req.add_field "Access-Token", "61cf63ae-4ab9-4a95-9db5-753781c4f41f"
        # Add headers
        req.add_field "Client-Secret", "3Er4kHXZTJ"
        # Add headers
        req.add_field "Content-Type", "application/json"
        # Add headers
        req.add_field "Accept", "application/json"
        # Set header and body
        req.add_field "Content-Type", "application/json"
        req.body = body

        # Fetch Request
        res = http.request(req)
        puts "Response HTTP Status Code: #{res.code}"
        puts "Response HTTP Response Body: #{res.body}"
    rescue Exception => e
        puts "HTTP Request failed (#{e.message})"
    end
end

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Request

# Install the Python Requests library:
# `pip install requests`

import requests
import json

def send_request():
    # Articles (POST https://api.fortnox.se/3/articles)

    try:
        r = requests.post(
            url="https://api.fortnox.se/3/articles",
            headers = {
                "Access-Token":"61cf63ae-4ab9-4a95-9db5-753781c4f41f",
                "Client-Secret":"3Er4kHXZTJ",
                "Content-Type":"application/json",
                "Accept":"application/json",
            },
            data = json.dumps({
                "Article": {
                    "Description": "Extra förpackning",
                    "ArticleNumber": "FRPPLUS"
                }
            })
        )
        print('Response HTTP Status Code : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": null,
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Using our .NET SDK

Request

ArticleConnector connector = new ArticleConnector();
Article result = connector.Create(new Article() { ArticleNumber = "FRPPLUS", Description = "Extra förpackning" });

Update an article

Updates the specified article with the values provided in the properties. Any property not provided will be left unchanged.

You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.

Note that even though the article number is writeable you can’t change the number of an existing article.

Examples

Request

curl -X "PUT" "https://api.fortnox.se/3/articles/FRPPLUS" \
     -H "Access-Token: 61cf63ae-4ab9-4a95-9db5-753781c4f41f" \
     -H "Client-Secret: 3Er4kHXZTJ" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d $'{
     "Article": {
         "ArticleNumber": "FRPPLUS",
         "Unit": "st"
     }
}'

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "Active": true,
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": "st",
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Using Guzzle

Request

// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Post\PostBody;
use GuzzleHttp\Stream\StreamInterface;
use GuzzleHttp\Exception\RequestException;

function send_request() {
    // Article (PUT https://api.fortnox.se/3/articles/FRPPLUS)

    $client = new Client();
    $request = $client->createRequest('PUT', 'https://api.fortnox.se/3/articles/FRPPLUS');
    $postBody = $request->getBody();

    try {
        $request->addHeaders([
            'Access-Token'=>'61cf63ae-4ab9-4a95-9db5-753781c4f41f',
            'Client-Secret'=>'3Er4kHXZTJ',
            'Content-Type'=>'application/json',
            'Accept'=>'application/json',
        ]);
        $body = [
            "Article" => [
                "Unit" => "st",
                "ArticleNumber" => "FRPPLUS"
            ]
        ];
        $request->setBody(GuzzleHttp\Stream\Stream::factory(json_encode($body)));

        $response = $client->send($request);
        echo "Response HTTP : " . $response->getStatusCode();
    }
    catch (RequestException $e) {
        echo "HTTP Request failed\n";
        echo $e->getRequest();
        if ($e->hasResponse()) {
            echo $e->getResponse();
        }
    }
}

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": "st",
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Request

require 'net/http'
require 'json'

def send_request
    # Article (PUT )

    begin
        uri = URI('https://api.fortnox.se/3/articles/FRPPLUS')

        # Create client          
        http = Net::HTTP.new(uri.host, uri.port)

        dict = {
            "Article" => {
                "Unit" => "st",
                "ArticleNumber" => "FRPPLUS"
            }
        }
        body = JSON.dump(dict)

        # Create Request
        req =  Net::HTTP::Put.new(uri)
        # Add headers
        req.add_field "Access-Token", "61cf63ae-4ab9-4a95-9db5-753781c4f41f"
        # Add headers
        req.add_field "Client-Secret", "3Er4kHXZTJ"
        # Add headers
        req.add_field "Content-Type", "application/json"
        # Add headers
        req.add_field "Accept", "application/json"
        # Set header and body
        req.add_field "Content-Type", "application/json"
        req.body = body

        # Fetch Request
        res = http.request(req)
        puts "Response HTTP Status Code: #{res.code}"
        puts "Response HTTP Response Body: #{res.body}"
    rescue Exception => e
        puts "HTTP Request failed (#{e.message})"
    end
end

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": "st",
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Request

# Install the Python Requests library:
# `pip install requests`

import requests
import json

def send_request():
    # Article (PUT https://api.fortnox.se/3/articles/FRPPLUS)

    try:
        r = requests.put(
            url="https://api.fortnox.se/3/articles/FRPPLUS",
            headers = {
                "Access-Token":"61cf63ae-4ab9-4a95-9db5-753781c4f41f",
                "Client-Secret":"3Er4kHXZTJ",
                "Content-Type":"application/json",
                "Accept":"application/json",
            },
            data = json.dumps({
                "Article": {
                    "Unit": "st",
                    "ArticleNumber": "FRPPLUS"
                }
            })
        )
        print('Response HTTP Status Code : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response

{
    "Article": {
        "@url": "https://api.fortnox.se/3/articles/FRPPLUS",
        "ArticleNumber": "FRPPLUS",
        "Bulky": false,
        "ConstructionAccount": 0,
        "Depth": 0,
        "Description": "Extra f\u00f6rpackning",
        "DisposableQuantity": 0,
        "EAN": "",
        "EUAccount": 3018,
        "EUVATAccount": 3016,
        "Expired": false,
        "ExportAccount": 3015,
        "Height": 0,
        "Housework": false,
        "HouseworkType": null,
        "Manufacturer": null,
        "ManufacturerArticleNumber": "",
        "Note": "",
        "PurchaseAccount": 4011,
        "PurchasePrice": 0,
        "QuantityInStock": 0,
        "ReservedQuantity": 0,
        "SalesAccount": 3011,
        "SalesPrice": 10,
        "StockGoods": false,
        "StockPlace": null,
        "StockValue": 0,
        "StockWarning": 0,
        "SupplierName": null,
        "SupplierNumber": null,
        "Type": "STOCK",
        "Unit": "st",
        "VAT": 25,
        "WebshopArticle": false,
        "Weight": 0,
        "Width": 0
    }
}

Using our .NET SDK

Request

ArticleConnector connector = new ArticleConnector();
Article result = connector.Update(new Article() { ArticleNumber = "FRPPLUS", Unit = "st" });

Delete an article

Deletes the article permanently.

You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.

Examples

Request

curl -X "DELETE" "https://api.fortnox.se/3/articles/FRPPLUS" \
     -H "Access-Token: 61cf63ae-4ab9-4a95-9db5-753781c4f41f" \
     -H "Client-Secret: 3Er4kHXZTJ" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json"

Response

No response body will be returned

Using Guzzle

Request

// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

function send_request() {
    // Article (DELETE https://api.fortnox.se/3/articles/FRPPLUS)

    $client = new Client();
    $request = $client->createRequest('DELETE', 'https://api.fortnox.se/3/articles/FRPPLUS');

    try {
        $request->addHeaders([
            'Access-Token'=>'61cf63ae-4ab9-4a95-9db5-753781c4f41f',
            'Client-Secret'=>'3Er4kHXZTJ',
            'Content-Type'=>'application/json',
            'Accept'=>'application/json',
        ]);

        $response = $client->send($request);
        echo "Response HTTP : " . $response->getStatusCode();
    }
    catch (RequestException $e) {
        echo "HTTP Request failed\n";
        echo $e->getRequest();
        if ($e->hasResponse()) {
            echo $e->getResponse();
        }
    }
}

Response

No response body will be returned

Request

require 'net/http'

def send_request
    # Article (DELETE )

    begin
        uri = URI('https://api.fortnox.se/3/articles/FRPPLUS')

        # Create client          
        http = Net::HTTP.new(uri.host, uri.port)

        # Create Request
        req =  Net::HTTP::Delete.new(uri)
        # Add headers
        req.add_field "Access-Token", "61cf63ae-4ab9-4a95-9db5-753781c4f41f"
        # Add headers
        req.add_field "Client-Secret", "3Er4kHXZTJ"
        # Add headers
        req.add_field "Content-Type", "application/json"
        # Add headers
        req.add_field "Accept", "application/json"

        # Fetch Request
        res = http.request(req)
        puts "Response HTTP Status Code: #{res.code}"
        puts "Response HTTP Response Body: #{res.body}"
    rescue Exception => e
        puts "HTTP Request failed (#{e.message})"
    end
end

Response

No response body will be returned

Request

# Install the Python Requests library:
# `pip install requests`

import requests

def send_request():
    # Article (DELETE https://api.fortnox.se/3/articles/FRPPLUS)

    try:
        r = requests.delete(
            url="https://api.fortnox.se/3/articles/FRPPLUS",
            headers = {
                "Access-Token":"61cf63ae-4ab9-4a95-9db5-753781c4f41f",
                "Client-Secret":"3Er4kHXZTJ",
                "Content-Type":"application/json",
                "Accept":"application/json",
            },
        )
        print('Response HTTP Status Code : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response

No response body will be returned

Using our .NET SDK

Request

ArticleConnector connector = new ArticleConnector();
connector.Delete("FRPPLUS");

Filter

Filter the search on active or inactive articles.

?filter=active displays only active articles

?filter=inactive displays only inactive articles

  •  Example: https://api.fortnox.se/3/articles?filter=active

Properties

Property Description
Url string, read-only
Direct url to the record.
Active boolean, true/false
If the article is active
ArticleNumber string, 50 characters, searchable, sortable
Article number. If no article number is provided, the next number in the series will be used. Only alpha numeric characters, with the addition of + / and _, are allowed.
Bulky boolean
If the article is bulky.
ConstructionAccount integer, 4 digits
Account number for construction work (special VAT rules in Sweden). The number must be of an existing account.
Depth integer, 8 digits
The depth of the article in millimeters.
Description string, 200 characters, searchable, required
The description of the article.
DisposableQuantity float, read-only,
Disposable quantity of the article.
EAN string, 30 characters, searchable
EAN bar code.
EUAccount integer, 4 digits
Account number for the sales account to EU. The number must be of an existing account.
EUVATAccount integer, 4 digits
Account number for the sales account to EU with VAT. The number must be of an existing account.
ExportAccount integer, 4 digits
Account number for the sales account outside EU. The number must be of an existing account.
Height integer, 8 digits
The height of the article in millimeters.
Housework boolean
If the article is housework.
HouseworkType string
The type of house work. Can be CONSTRUCTION ELECTRICITY GLASSMETALWORK
GROUNDDRAINAGEWORK MASONRY PAINTINGWALLPAPERING
HVAC CLEANING TEXTILECLOTHING COOKING
SNOWPLOWING GARDENING BABYSITTING OTHERCARE
TUTORING OTHERCOSTS or empty.
Manufacturer string, 50 characters, searchable
The manufacturer of the article
ManufacturerArticleNumber string, 50 characters, searchable
The manufacturers article number.
Note string, 10 000 characters
Text note.
PurchaseAccount integer, 4 digits
Account number for purchase. The number must be of an existing account.
PurchasePrice float, 14 digits
Purchase price of the article.
QuantityInStock float, 14 digits, sortable
Quantity in stock of the article.
ReservedQuantity float, read-only, sortable
Reserved quantity of the article.
SalesAccount integer, 4 digits
Account number for the sales account in Sweden. The number must be of an existing account.
SalesPrice float, read-only
Price of article for its default price list.
StockGoods boolean
If the article is stock goods.
StockPlace string, 100 characters
Storage place for the article.
StockValue float, read-only, sortable
Value in stock of the article.
StockWarning float, 14 digits
When to start warning for low quantity in stock.
SupplierName string, read-only
Name of the supplier.
SupplierNumber string, searchable
Supplier number for the article. The number must be of an existing supplier.
Type string
The type of the article. Can be STOCK or SERVICE.
Unit string
Unit code for the article. The code must be of an existing unit.
VAT float
VAT percent, this is predefined by the VAT for the sales account.
WebshopArticle boolean
If the article is a webshop article.
Weight integer, 8 digits
Weight of the article in grams.
Width integer, 8 digits
Width of the article in millimeters.
Expired boolean
If the article has expired.