List accounts
curl --request GET \
--url https://api.envoi.no/v1/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.envoi.no/v1/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.envoi.no/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.envoi.no/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.envoi.no/v1/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.envoi.no/v1/accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.envoi.no/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"number": "1500",
"name": "Kundefordringer",
"class": 1,
"type": "Asset",
"nature": "Debit",
"acceptsVat": false,
"defaultVatCode": null,
"isCustom": false
},
{
"number": "1920",
"name": "Bankinnskudd",
"class": 1,
"type": "Asset",
"nature": "Debit",
"acceptsVat": false,
"defaultVatCode": null,
"isCustom": false
},
{
"number": "3000",
"name": "Salgsinntekt handelsvarer, avgiftspliktig, høy sats",
"class": 3,
"type": "Income",
"nature": "Credit",
"acceptsVat": true,
"defaultVatCode": "3",
"isCustom": false
}
]
}{
"code": "unauthorized",
"message": "A valid API client access token is required."
}{
"code": "insufficient_scope",
"message": "This API client needs bilag:read."
}{
"code": "accounting-not-enabled",
"message": "Accounting is not enabled for this account."
}{
"code": "rate_limited",
"message": "Too many requests; try again later."
}{
"code": "server-error",
"message": "The request could not be completed. It is safe to retry with the same Idempotency-Key."
}Accounting
List accounts
The account’s chart of accounts: the NS 4102 standard accounts and any accounts the company added
itself (isCustom). Not paged.
GET
https://api.envoi.no
/
v1
/
accounts
List accounts
curl --request GET \
--url https://api.envoi.no/v1/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.envoi.no/v1/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.envoi.no/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.envoi.no/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.envoi.no/v1/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.envoi.no/v1/accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.envoi.no/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"number": "1500",
"name": "Kundefordringer",
"class": 1,
"type": "Asset",
"nature": "Debit",
"acceptsVat": false,
"defaultVatCode": null,
"isCustom": false
},
{
"number": "1920",
"name": "Bankinnskudd",
"class": 1,
"type": "Asset",
"nature": "Debit",
"acceptsVat": false,
"defaultVatCode": null,
"isCustom": false
},
{
"number": "3000",
"name": "Salgsinntekt handelsvarer, avgiftspliktig, høy sats",
"class": 3,
"type": "Income",
"nature": "Credit",
"acceptsVat": true,
"defaultVatCode": "3",
"isCustom": false
}
]
}{
"code": "unauthorized",
"message": "A valid API client access token is required."
}{
"code": "insufficient_scope",
"message": "This API client needs bilag:read."
}{
"code": "accounting-not-enabled",
"message": "Accounting is not enabled for this account."
}{
"code": "rate_limited",
"message": "Too many requests; try again later."
}{
"code": "server-error",
"message": "The request could not be completed. It is safe to retry with the same Idempotency-Key."
}Authorizations
oauth2bearerAuth
OAuth 2.0 client credentials. The token request also needs the audience form field (the Account ID), which OAuth tooling does not always send; see POST /v1/oauth/token.
Response
Every account in the chart.
A list that is not paged.
Every item.
Show child attributes
Show child attributes