Verifikationer
Verifikationer: utkast, bokföring, rättelser och underlag. En bokförd verifikation kan aldrig ändras.
Lista verifikationer
GET
/vouchers
listVouchers
Verifikationer med rader och underlag. Filtrera på status, serie, räkenskapsår och datum. Synka med updated_since.
Mer i detalj (på engelska)
Vouchers with their rows and attachment metadata, filtered by status, series, fiscal year and voucher date. Use updated_since to sync: posting a draft changes its updated_at, a posted voucher never changes again except that corrected_by_voucher_id is set once when it is corrected.
Behörighet
Parametrar
-
limitinteger frågaPage size, 1–200.
-
cursorstring frågaOpaque cursor from meta.next_cursor of the previous page.
-
updated_sincestring (date-time) frågaBara poster som ändrats efter den här tiden (ISO 8601). Listor sorteras på updated_at och id.
-
statusstring frågaDRAFT or POSTED.
-
seriesstring frågaSeries code, for example A.
-
fiscal_year_idinteger frågaOnly vouchers in this fiscal year.
-
date_fromstring (date) frågaVoucher date on or after (YYYY-MM-DD).
-
date_tostring (date) frågaVoucher date on or before (YYYY-MM-DD).
Svar
200 OK – A page of vouchers.
application/jsonobject
-
dataarray<Voucher> krävs18 fält · varje post
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
-
metaListMeta krävs3 fält
-
limitinteger krävs -
next_cursorstring krävs kan vara nullOpaque; pass as `cursor` for the next page. null on the last page.
-
has_moreboolean krävs
-
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl "https://nonox.app/api/v1/vouchers?limit=50&updated_since=2026-03-01T00%3A00%3A00%2B01%3A00" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->get('https://nonox.app/api/v1/vouchers', [
'limit' => 50,
'updated_since' => '2026-03-01T00:00:00+01:00',
]);
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('GET', 'https://nonox.app/api/v1/vouchers', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
'query' => [
'limit' => 50,
'updated_since' => '2026-03-01T00:00:00+01:00',
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const url = new URL('https://nonox.app/api/v1/vouchers');
url.searchParams.set('limit', '50');
url.searchParams.set('updated_since', '2026-03-01T00:00:00+01:00');
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://nonox.app/api/v1/vouchers",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
params={
"limit": 50,
"updated_since": "2026-03-01T00:00:00+01:00",
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 200
{
"data": [
{
"id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"series": "A",
"number": 57,
"reference": "A57",
"status": "POSTED",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"source": "MANUAL",
"corrects_voucher_id": null,
"corrected_by_voucher_id": null,
"posted_at": "2026-03-02T10:45:12+01:00",
"hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 0,
"credit_ore": 100000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 0,
"credit_ore": 25000,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [
{
"id": 311,
"name": "kvitto-kontorsmaterial.pdf",
"mime": "application/pdf",
"size": 48213,
"sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
"created_at": "2026-03-02T10:41:07+01:00"
}
],
"created_at": "2026-03-02T10:40:00+01:00",
"updated_at": "2026-03-02T10:45:12+01:00"
}
],
"meta": {
"limit": 50,
"next_cursor": "eyJ1cGRhdGVkX2F0IjoiMjAyNi0wMy0wMiAxMDo0NToxMiIsImlkIjoiMGI5ZjNjMWUiLCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
"has_more": true
}
}Fel
4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Skapa ett utkast
POST
/vouchers
createVoucher
Skapar ett utkast till verifikation (utan nummer). Raderna kontrolleras som i appen. Balansen kontrolleras när utkastet bokförs.
Mer i detalj (på engelska)
Creates a draft (status DRAFT, no number). Rows are validated as in the app: known active accounts, cost center/project when the account requires one, a row has either debit or credit. The fiscal year is chosen from voucher_date. Balance is checked when posting. Same Action as the app (SaveDraftVoucher).
Behörighet
Parametrar
-
Idempotency-Keystring huvud krävsKrävs på varje POST. Ett unikt värde per avsedd åtgärd (helst ett UUID). Sparas i 24 timmar per nyckel eller app, så att ett nytt försök aldrig bokför två gånger.
Innehåll i anropet
application/jsonVoucherInput krävs
The voucher. Amounts in öre (1 krona = 100 öre).
-
voucher_datestring (date) krävs -
descriptionstring krävs -
seriesstring -
rowsarray<VoucherRowInput> krävsA row has either debit_ore or credit_ore above zero, never both.
6 fält · varje post
-
accountinteger krävsAccount number (must exist and be active).
-
debit_oreinteger -
credit_oreinteger -
descriptionstring kan vara null -
cost_centerstring kan vara nullCode; required when the account requires a cost center.
-
projectstring kan vara nullCode; required when the account requires a project.
-
Svar
201 Created – The draft.
application/jsonobject
-
dataVoucher krävs18 fält
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
400 Bad Request – Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.
-
idempotency_key_requiredNo Idempotency-Key on a POSTSkicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.
-
idempotency_key_invalidIdempotency-Key too long or not visible ASCIIIdempotency-Key ska vara 1–255 synliga ASCII-tecken.
-
invalid_jsonMalformed JSONKroppen är inte giltig JSON (ett objekt).
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
409 Conflict – A request with the same Idempotency-Key is still running.
-
idempotency_in_progressSame key, first request not finishedEn begäran med samma Idempotency-Key pågår. Vänta och försök igen.
415 Unsupported Media Type – The body is not application/json (or multipart/form-data where a file is accepted).
-
unsupported_media_typeWrong Content-TypeSkicka JSON (application/json).
422 Unprocessable Content – Validation failed, or the Idempotency-Key was already used for a different request.
-
validation_failedField errorsUppgifterna kunde inte godtas. Se errors.
-
idempotency_key_reusedSame key, different bodyIdempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X POST "https://nonox.app/api/v1/vouchers" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"series": "A",
"rows": [
{
"account": 1930,
"debit_ore": 125000
},
{
"account": 3001,
"credit_ore": 100000
},
{
"account": 2611,
"credit_ore": 25000
}
]
}'use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
->post('https://nonox.app/api/v1/vouchers', [
'voucher_date' => '2026-03-02',
'description' => 'Kontantförsäljning',
'series' => 'A',
'rows' => [
[
'account' => 1930,
'debit_ore' => 125000,
],
[
'account' => 3001,
'credit_ore' => 100000,
],
[
'account' => 2611,
'credit_ore' => 25000,
],
],
]);
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('POST', 'https://nonox.app/api/v1/vouchers', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => [
'voucher_date' => '2026-03-02',
'description' => 'Kontantförsäljning',
'series' => 'A',
'rows' => [
[
'account' => 1930,
'debit_ore' => 125000,
],
[
'account' => 3001,
'credit_ore' => 100000,
],
[
'account' => 2611,
'credit_ore' => 25000,
],
],
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"series": "A",
"rows": [
{
"account": 1930,
"debit_ore": 125000
},
{
"account": 3001,
"credit_ore": 100000
},
{
"account": 2611,
"credit_ore": 25000
}
]
}),
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://nonox.app/api/v1/vouchers",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"series": "A",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
},
{
"account": 3001,
"credit_ore": 100000,
},
{
"account": 2611,
"credit_ore": 25000,
},
],
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 201
{
"data": {
"id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"series": "A",
"number": null,
"reference": null,
"status": "DRAFT",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"source": "MANUAL",
"corrects_voucher_id": null,
"corrected_by_voucher_id": null,
"posted_at": null,
"hash": null,
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 0,
"credit_ore": 100000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 0,
"credit_ore": 25000,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [],
"created_at": "2026-03-02T10:40:00+01:00",
"updated_at": "2026-03-02T10:40:00+01:00"
}
}Fel
4003 exempel
{
"type": "urn:nonox:problem:idempotency_key_required",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_required",
"detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:idempotency_key_invalid",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_invalid",
"detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:invalid_json",
"title": "Bad Request",
"status": 400,
"code": "invalid_json",
"detail": "Kroppen är inte giltig JSON (ett objekt).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4091 exempel
{
"type": "urn:nonox:problem:idempotency_in_progress",
"title": "Conflict",
"status": 409,
"code": "idempotency_in_progress",
"detail": "En begäran med samma Idempotency-Key pågår. Vänta och försök igen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4151 exempel
{
"type": "urn:nonox:problem:unsupported_media_type",
"title": "Unsupported Media Type",
"status": 415,
"code": "unsupported_media_type",
"detail": "Skicka JSON (application/json).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4222 exempel
{
"type": "urn:nonox:problem:validation_failed",
"title": "Unprocessable Content",
"status": 422,
"code": "validation_failed",
"detail": "Uppgifterna kunde inte godtas. Se errors.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"errors": {
"rows": [
"Verifikationen balanserar inte: debet och kredit skiljer sig åt."
],
"voucher_date": [
"Det finns inget räkenskapsår som omfattar 2031-01-01."
]
}
}{
"type": "urn:nonox:problem:idempotency_key_reused",
"title": "Unprocessable Content",
"status": 422,
"code": "idempotency_key_reused",
"detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Hämta en verifikation
GET
/vouchers/{voucher}
getVoucher
En verifikation med rader och underlag.
Mer i detalj (på engelska)
One voucher with rows and attachment metadata.
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
Svar
200 OK – The voucher.
application/jsonobject
-
dataVoucher krävs18 fält
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->get('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e');
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('GET', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', {
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 200
{
"data": {
"id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"series": "A",
"number": 57,
"reference": "A57",
"status": "POSTED",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"source": "MANUAL",
"corrects_voucher_id": null,
"corrected_by_voucher_id": null,
"posted_at": "2026-03-02T10:45:12+01:00",
"hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 0,
"credit_ore": 100000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 0,
"credit_ore": 25000,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [
{
"id": 311,
"name": "kvitto-kontorsmaterial.pdf",
"mime": "application/pdf",
"size": 48213,
"sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
"created_at": "2026-03-02T10:41:07+01:00"
}
],
"created_at": "2026-03-02T10:40:00+01:00",
"updated_at": "2026-03-02T10:45:12+01:00"
}
}Fel
4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Ändra ett utkast
PATCH
/vouchers/{voucher}
updateVoucherDraft
Ändrar ett utkast. Fält som utelämnas behåller sina värden; rows ersätter alla rader. En bokförd verifikation kan aldrig ändras (403); rätta den i stället.
Mer i detalj (på engelska)
Changes a draft. Fields left out keep their values; `rows`, when sent, replaces all rows. A posted voucher can never be changed: the answer is 403 (correct it instead).
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
Innehåll i anropet
application/jsonVoucherPatch krävs
Any subset of VoucherInput. `rows` replaces all rows.
-
voucher_datestring (date) -
descriptionstring -
seriesstring -
rowsarray<VoucherRowInput>A row has either debit_ore or credit_ore above zero, never both.
6 fält · varje post
-
accountinteger krävsAccount number (must exist and be active).
-
debit_oreinteger -
credit_oreinteger -
descriptionstring kan vara null -
cost_centerstring kan vara nullCode; required when the account requires a cost center.
-
projectstring kan vara nullCode; required when the account requires a project.
-
Svar
200 OK – The changed draft.
application/jsonobject
-
dataVoucher krävs18 fält
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
400 Bad Request – Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.
-
idempotency_key_requiredNo Idempotency-Key on a POSTSkicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.
-
idempotency_key_invalidIdempotency-Key too long or not visible ASCIIIdempotency-Key ska vara 1–255 synliga ASCII-tecken.
-
invalid_jsonMalformed JSONKroppen är inte giltig JSON (ett objekt).
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
415 Unsupported Media Type – The body is not application/json (or multipart/form-data where a file is accepted).
-
unsupported_media_typeWrong Content-TypeSkicka JSON (application/json).
422 Unprocessable Content – Validation failed, or the Idempotency-Key was already used for a different request.
-
validation_failedField errorsUppgifterna kunde inte godtas. Se errors.
-
idempotency_key_reusedSame key, different bodyIdempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X PATCH "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"description": "Kontantförsäljning, kassa 2"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->patch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', [
'description' => 'Kontantförsäljning, kassa 2',
]);
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('PATCH', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
'json' => [
'description' => 'Kontantförsäljning, kassa 2',
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"description": "Kontantförsäljning, kassa 2"
}),
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import requests
response = requests.patch(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
json={
"description": "Kontantförsäljning, kassa 2",
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 200
{
"data": {
"id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"series": "A",
"number": null,
"reference": null,
"status": "DRAFT",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning, kassa 2",
"source": "MANUAL",
"corrects_voucher_id": null,
"corrected_by_voucher_id": null,
"posted_at": null,
"hash": null,
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 0,
"credit_ore": 100000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 0,
"credit_ore": 25000,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [],
"created_at": "2026-03-02T10:40:00+01:00",
"updated_at": "2026-03-02T10:40:00+01:00"
}
}Fel
4003 exempel
{
"type": "urn:nonox:problem:idempotency_key_required",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_required",
"detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:idempotency_key_invalid",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_invalid",
"detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:invalid_json",
"title": "Bad Request",
"status": 400,
"code": "invalid_json",
"detail": "Kroppen är inte giltig JSON (ett objekt).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4151 exempel
{
"type": "urn:nonox:problem:unsupported_media_type",
"title": "Unsupported Media Type",
"status": 415,
"code": "unsupported_media_type",
"detail": "Skicka JSON (application/json).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4222 exempel
{
"type": "urn:nonox:problem:validation_failed",
"title": "Unprocessable Content",
"status": 422,
"code": "validation_failed",
"detail": "Uppgifterna kunde inte godtas. Se errors.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"errors": {
"rows": [
"Verifikationen balanserar inte: debet och kredit skiljer sig åt."
],
"voucher_date": [
"Det finns inget räkenskapsår som omfattar 2031-01-01."
]
}
}{
"type": "urn:nonox:problem:idempotency_key_reused",
"title": "Unprocessable Content",
"status": 422,
"code": "idempotency_key_reused",
"detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Ta bort ett utkast
DELETE
/vouchers/{voucher}
deleteVoucherDraft
Tar bort ett utkast. En bokförd verifikation kan aldrig tas bort (403).
Mer i detalj (på engelska)
Deletes a draft. A posted voucher can never be deleted (403).
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
Svar
204 No Content – Deleted.
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X DELETE "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->delete('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e');
$response->throw();$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('DELETE', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
]);const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}import os
import requests
response = requests.delete(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
timeout=30,
)
response.raise_for_status()Fel
4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Bokför en verifikation
POST
/vouchers/{voucher}/post
postVoucher
Bokför ett utkast: kontrollerar balans, räkenskapsår och låsta perioder, ger nästa nummer i serien utan luckor och skriver behandlingshistorik. Går inte att ångra, bara rätta.
Mer i detalj (på engelska)
Posts a draft (bokför): checks that it balances, that the date is in an open fiscal year and not in a locked period, assigns the next gapless number in its series and fiscal year, extends the hash chain and writes the audit log. Irreversible: a posted voucher is only ever corrected. Same Action as the app (PostVoucher). No body.
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
-
Idempotency-Keystring huvud krävsKrävs på varje POST. Ett unikt värde per avsedd åtgärd (helst ett UUID). Sparas i 24 timmar per nyckel eller app, så att ett nytt försök aldrig bokför två gånger.
Svar
200 OK – The posted voucher.
application/jsonobject
-
dataVoucher krävs18 fält
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
400 Bad Request – Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.
-
idempotency_key_requiredNo Idempotency-Key on a POSTSkicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.
-
idempotency_key_invalidIdempotency-Key too long or not visible ASCIIIdempotency-Key ska vara 1–255 synliga ASCII-tecken.
-
invalid_jsonMalformed JSONKroppen är inte giltig JSON (ett objekt).
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
409 Conflict – A request with the same Idempotency-Key is still running.
-
idempotency_in_progressSame key, first request not finishedEn begäran med samma Idempotency-Key pågår. Vänta och försök igen.
415 Unsupported Media Type – The body is not application/json (or multipart/form-data where a file is accepted).
-
unsupported_media_typeWrong Content-TypeSkicka JSON (application/json).
422 Unprocessable Content – Validation failed, or the Idempotency-Key was already used for a different request.
-
validation_failedField errorsUppgifterna kunde inte godtas. Se errors.
-
idempotency_key_reusedSame key, different bodyIdempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X POST "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/post" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-H "Idempotency-Key: $(uuidgen)"use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
->post('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/post');
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('POST', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/post', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/post', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/post",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 200
{
"data": {
"id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"series": "A",
"number": 57,
"reference": "A57",
"status": "POSTED",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Kontantförsäljning",
"source": "MANUAL",
"corrects_voucher_id": null,
"corrected_by_voucher_id": null,
"posted_at": "2026-03-02T10:45:12+01:00",
"hash": "3c1f0e9d8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d",
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 125000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 0,
"credit_ore": 100000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 0,
"credit_ore": 25000,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [],
"created_at": "2026-03-02T10:40:00+01:00",
"updated_at": "2026-03-02T10:45:12+01:00"
}
}Fel
4003 exempel
{
"type": "urn:nonox:problem:idempotency_key_required",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_required",
"detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:idempotency_key_invalid",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_invalid",
"detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:invalid_json",
"title": "Bad Request",
"status": 400,
"code": "invalid_json",
"detail": "Kroppen är inte giltig JSON (ett objekt).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4091 exempel
{
"type": "urn:nonox:problem:idempotency_in_progress",
"title": "Conflict",
"status": 409,
"code": "idempotency_in_progress",
"detail": "En begäran med samma Idempotency-Key pågår. Vänta och försök igen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4151 exempel
{
"type": "urn:nonox:problem:unsupported_media_type",
"title": "Unsupported Media Type",
"status": 415,
"code": "unsupported_media_type",
"detail": "Skicka JSON (application/json).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4222 exempel
{
"type": "urn:nonox:problem:validation_failed",
"title": "Unprocessable Content",
"status": 422,
"code": "validation_failed",
"detail": "Uppgifterna kunde inte godtas. Se errors.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"errors": {
"rows": [
"Verifikationen balanserar inte: debet och kredit skiljer sig åt."
],
"voucher_date": [
"Det finns inget räkenskapsår som omfattar 2031-01-01."
]
}
}{
"type": "urn:nonox:problem:idempotency_key_reused",
"title": "Unprocessable Content",
"status": 422,
"code": "idempotency_key_reused",
"detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Rätta en bokförd verifikation
POST
/vouchers/{voucher}/correct
correctVoucher
Skapar och bokför en rättelseverifikation som vänder originalet och, om rows skickas, bokför dem i stället. Båda länkas till varandra. En verifikation kan rättas en gång.
Mer i detalj (på engelska)
Creates and posts a correcting voucher (rättelseverifikation) that reverses the original and, if `rows` are given, books those instead. Both vouchers are linked. A voucher can be corrected once. Same Action as the app (CorrectVoucher).
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
-
Idempotency-Keystring huvud krävsKrävs på varje POST. Ett unikt värde per avsedd åtgärd (helst ett UUID). Sparas i 24 timmar per nyckel eller app, så att ett nytt försök aldrig bokför två gånger.
Innehåll i anropet
application/jsonCorrectionInput krävs
Why, when, and optionally the rows to book instead.
-
reasonstring krävsWhy the voucher is corrected (kept in the audit trail).
-
datestring (date)Date of the correcting voucher; defaults to today.
-
rowsarray<VoucherRowInput>Rows to book instead, after the reversal.
6 fält · varje post
-
accountinteger krävsAccount number (must exist and be active).
-
debit_oreinteger -
credit_oreinteger -
descriptionstring kan vara null -
cost_centerstring kan vara nullCode; required when the account requires a cost center.
-
projectstring kan vara nullCode; required when the account requires a project.
-
Svar
201 Created – The correcting voucher.
application/jsonobject
-
dataVoucher krävs18 fält
-
idstring (uuid) -
seriesstring -
numberinteger kan vara nullAssigned at posting; null for a draft.
-
referencestring kan vara nullSeries and number, e.g. A57; null for a draft.
-
statusstring -
fiscal_year_idinteger -
voucher_datestring (date) -
descriptionstring -
sourcestring -
corrects_voucher_idstring (uuid) kan vara null -
corrected_by_voucher_idstring (uuid) kan vara null -
posted_atstring (date-time) kan vara null -
hashstring kan vara nullSHA-256 in the company's hash chain (ledger integrity).
-
currencystring -
rowsarray<VoucherRow>6 fält · varje post
-
accountinteger krävsAccount number.
-
debit_oreinteger krävsDebit in öre.
-
credit_oreinteger krävsCredit in öre.
-
descriptionstring kan vara null -
cost_centerstring kan vara nullCost center code (kostnadsställe).
-
projectstring kan vara nullProject code.
-
-
attachmentsarray<Attachment>6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
-
created_atstring (date-time) -
updated_atstring (date-time)
-
400 Bad Request – Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.
-
idempotency_key_requiredNo Idempotency-Key on a POSTSkicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.
-
idempotency_key_invalidIdempotency-Key too long or not visible ASCIIIdempotency-Key ska vara 1–255 synliga ASCII-tecken.
-
invalid_jsonMalformed JSONKroppen är inte giltig JSON (ett objekt).
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
409 Conflict – A request with the same Idempotency-Key is still running.
-
idempotency_in_progressSame key, first request not finishedEn begäran med samma Idempotency-Key pågår. Vänta och försök igen.
415 Unsupported Media Type – The body is not application/json (or multipart/form-data where a file is accepted).
-
unsupported_media_typeWrong Content-TypeSkicka JSON (application/json).
422 Unprocessable Content – Validation failed, or the Idempotency-Key was already used for a different request.
-
validation_failedField errorsUppgifterna kunde inte godtas. Se errors.
-
idempotency_key_reusedSame key, different bodyIdempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X POST "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/correct" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"reason": "Fel konto",
"date": "2026-03-05"
}'use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
->post('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/correct', [
'reason' => 'Fel konto',
'date' => '2026-03-05',
]);
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('POST', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/correct', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => [
'reason' => 'Fel konto',
'date' => '2026-03-05',
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/correct', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"reason": "Fel konto",
"date": "2026-03-05"
}),
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/correct",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"reason": "Fel konto",
"date": "2026-03-05",
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 201
{
"data": {
"id": "4e8d2c1b-7f6a-4b3c-8d9e-0a1b2c3d4e5f",
"series": "A",
"number": 58,
"reference": "A58",
"status": "POSTED",
"fiscal_year_id": 7,
"voucher_date": "2026-03-02",
"description": "Rättelse av A57: fel konto",
"source": "CORRECTION",
"corrects_voucher_id": "0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e",
"corrected_by_voucher_id": null,
"posted_at": "2026-03-05T08:02:44+01:00",
"hash": "8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b",
"currency": "SEK",
"rows": [
{
"account": 1930,
"debit_ore": 0,
"credit_ore": 125000,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 3001,
"debit_ore": 100000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
},
{
"account": 2611,
"debit_ore": 25000,
"credit_ore": 0,
"description": null,
"cost_center": null,
"project": null
}
],
"attachments": [],
"created_at": "2026-03-05T08:02:44+01:00",
"updated_at": "2026-03-05T08:02:44+01:00"
}
}Fel
4003 exempel
{
"type": "urn:nonox:problem:idempotency_key_required",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_required",
"detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:idempotency_key_invalid",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_invalid",
"detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:invalid_json",
"title": "Bad Request",
"status": 400,
"code": "invalid_json",
"detail": "Kroppen är inte giltig JSON (ett objekt).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4091 exempel
{
"type": "urn:nonox:problem:idempotency_in_progress",
"title": "Conflict",
"status": 409,
"code": "idempotency_in_progress",
"detail": "En begäran med samma Idempotency-Key pågår. Vänta och försök igen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4151 exempel
{
"type": "urn:nonox:problem:unsupported_media_type",
"title": "Unsupported Media Type",
"status": 415,
"code": "unsupported_media_type",
"detail": "Skicka JSON (application/json).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4222 exempel
{
"type": "urn:nonox:problem:validation_failed",
"title": "Unprocessable Content",
"status": 422,
"code": "validation_failed",
"detail": "Uppgifterna kunde inte godtas. Se errors.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"errors": {
"rows": [
"Verifikationen balanserar inte: debet och kredit skiljer sig åt."
],
"voucher_date": [
"Det finns inget räkenskapsår som omfattar 2031-01-01."
]
}
}{
"type": "urn:nonox:problem:idempotency_key_reused",
"title": "Unprocessable Content",
"status": 422,
"code": "idempotency_key_reused",
"detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Lista underlag
GET
/vouchers/{voucher}/attachments
listVoucherAttachments
Underlagen till en verifikation (inte sidindelad).
Mer i detalj (på engelska)
Metadata of the voucher's underlag (not paginated).
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
Svar
200 OK – The attachments.
application/jsonobject
-
dataarray<Attachment> krävs6 fält · varje post
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->get('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments');
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('GET', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments', {
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 200
{
"data": [
{
"id": 311,
"name": "kvitto-kontorsmaterial.pdf",
"mime": "application/pdf",
"size": 48213,
"sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
"created_at": "2026-03-02T10:41:07+01:00"
}
]
}Fel
4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Lägg till underlag
POST
/vouchers/{voucher}/attachments
addVoucherAttachment
Laddar upp underlag som multipart/form-data i fältet file: PDF eller bild (JPG, PNG, WebP), högst 10 MB. Går på utkast och bokförda verifikationer; underlag tas aldrig bort från en bokförd verifikation.
Mer i detalj (på engelska)
Uploads underlag as multipart/form-data in the field `file`: a PDF or an image (JPG, PNG, WebP), at most 10 MB; the type is detected from the content, not the name. Allowed on drafts and on posted vouchers; an attachment is never removed from a posted voucher.
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
-
Idempotency-Keystring huvud krävsKrävs på varje POST. Ett unikt värde per avsedd åtgärd (helst ett UUID). Sparas i 24 timmar per nyckel eller app, så att ett nytt försök aldrig bokför två gånger.
Innehåll i anropet
multipart/form-dataobject krävs
-
filestring (binary) krävsPDF, JPG, PNG or WebP, max 10 MB.
Svar
201 Created – The attachment.
application/jsonobject
-
dataAttachment krävs6 fält
-
idinteger -
namestring -
mimestring -
sizeintegerBytes.
-
sha256string -
created_atstring (date-time)
-
400 Bad Request – Bad request: missing or invalid Idempotency-Key, or a body that is not a JSON object.
-
idempotency_key_requiredNo Idempotency-Key on a POSTSkicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.
-
idempotency_key_invalidIdempotency-Key too long or not visible ASCIIIdempotency-Key ska vara 1–255 synliga ASCII-tecken.
-
invalid_jsonMalformed JSONKroppen är inte giltig JSON (ett objekt).
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
409 Conflict – A request with the same Idempotency-Key is still running.
-
idempotency_in_progressSame key, first request not finishedEn begäran med samma Idempotency-Key pågår. Vänta och försök igen.
415 Unsupported Media Type – The body is not application/json (or multipart/form-data where a file is accepted).
-
unsupported_media_typeWrong Content-TypeSkicka JSON (application/json).
422 Unprocessable Content – Validation failed, or the Idempotency-Key was already used for a different request.
-
validation_failedField errorsUppgifterna kunde inte godtas. Se errors.
-
idempotency_key_reusedSame key, different bodyIdempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl -X POST "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-F "file=@kvitto.pdf;type=application/pdf"use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
->attach('file', file_get_contents('kvitto.pdf'), 'kvitto.pdf')
->post('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments');
$response->throw();
$data = $response->json('data');$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('POST', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'multipart' => [
['name' => 'file', 'contents' => fopen('kvitto.pdf', 'r'), 'filename' => 'kvitto.pdf'],
],
]);
$data = json_decode((string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR)['data'];import { readFile } from 'node:fs/promises';
const form = new FormData();
form.append('file', new Blob([await readFile('kvitto.pdf')], { type: 'application/pdf' }), 'kvitto.pdf');
const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: form,
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
files={"file": ("kvitto.pdf", open("kvitto.pdf", "rb"), "application/pdf")},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Svar · 201
{
"data": {
"id": 311,
"name": "kvitto-kontorsmaterial.pdf",
"mime": "application/pdf",
"size": 48213,
"sha256": "9f2b5c1d7e3a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
"created_at": "2026-03-02T10:41:07+01:00"
}
}Fel
4003 exempel
{
"type": "urn:nonox:problem:idempotency_key_required",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_required",
"detail": "Skicka en unik Idempotency-Key (till exempel ett UUID) med varje POST, så att ett nytt försök aldrig bokför två gånger.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:idempotency_key_invalid",
"title": "Bad Request",
"status": 400,
"code": "idempotency_key_invalid",
"detail": "Idempotency-Key ska vara 1–255 synliga ASCII-tecken.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:invalid_json",
"title": "Bad Request",
"status": 400,
"code": "invalid_json",
"detail": "Kroppen är inte giltig JSON (ett objekt).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4091 exempel
{
"type": "urn:nonox:problem:idempotency_in_progress",
"title": "Conflict",
"status": 409,
"code": "idempotency_in_progress",
"detail": "En begäran med samma Idempotency-Key pågår. Vänta och försök igen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4151 exempel
{
"type": "urn:nonox:problem:unsupported_media_type",
"title": "Unsupported Media Type",
"status": 415,
"code": "unsupported_media_type",
"detail": "Skicka JSON (application/json).",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4222 exempel
{
"type": "urn:nonox:problem:validation_failed",
"title": "Unprocessable Content",
"status": 422,
"code": "validation_failed",
"detail": "Uppgifterna kunde inte godtas. Se errors.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"errors": {
"rows": [
"Verifikationen balanserar inte: debet och kredit skiljer sig åt."
],
"voucher_date": [
"Det finns inget räkenskapsår som omfattar 2031-01-01."
]
}
}{
"type": "urn:nonox:problem:idempotency_key_reused",
"title": "Unprocessable Content",
"status": 422,
"code": "idempotency_key_reused",
"detail": "Idempotency-Key har redan använts för en annan begäran. Använd en ny nyckel för en ny begäran.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}Hämta underlagets fil
GET
/vouchers/{voucher}/attachments/{attachment}/content
downloadVoucherAttachment
Själva filen. X-Content-SHA256 låter dig kontrollera den mot sha256 i metadata.
Mer i detalj (på engelska)
The file itself, as stored. X-Content-SHA256 lets you verify it against the sha256 in the metadata.
Behörighet
Parametrar
-
voucherstring (uuid) sökväg krävsVoucher id (UUID).
-
attachmentinteger sökväg krävsAttachment id.
Svar
200 OK – The file.
application/pdfstring
image/jpegstring
image/pngstring
image/webpstring
401 Unauthorized – Missing, invalid, expired or revoked token or API key. Also returned when the person behind the credential has left the company (an OAuth grant is then revoked for good).
-
unauthenticatedNo valid credentialNyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.
403 Forbidden – The credential may not do this: a scope is missing, the granting person no longer has the permission, the address is not allowed, the company is archived (read-only) or no longer allows the app.
-
insufficient_scopeScope missing or permission lostNyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.
-
forbiddenThe action refuses (for example changing a posted voucher)Behörighet saknas för det här.
-
ip_not_allowedOutside the IP allowlistFöretaget tillåter inte anrop från den här adressen.
-
company_archivedWrite to an archived companyFöretaget är arkiverat och kan bara läsas.
-
app_not_allowedThe company no longer allows the appFöretaget tillåter inte längre den här appen.
404 Not Found – Not found. Also the answer for another company's ids (existence is never revealed) and for every call while NONOX Connect is turned off for the company.
-
not_foundUnknown id, other company's id, or module offDet du söker finns inte.
429 Too Many Requests – Rate limit exceeded (per credential, per company or per address). Wait Retry-After seconds.
-
rate_limitedOver the limitFör många anrop. Försök igen om 23 sekunder.
Kodexempel
curl "https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments/311/content" \
-H "Authorization: Bearer $NONOX_TOKEN" \
-H "Accept: application/json" \
-o kvitto.pdfuse Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.nonox.token'))
->acceptJson()
->get('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments/311/content');
$response->throw();
file_put_contents('kvitto.pdf', $response->body());$client = new \GuzzleHttp\Client(['timeout' => 30]);
$response = $client->request('GET', 'https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments/311/content', [
'headers' => [
'Authorization' => 'Bearer '.getenv('NONOX_TOKEN'),
'Accept' => 'application/json',
],
'sink' => 'kvitto.pdf',
]);const response = await fetch('https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments/311/content', {
headers: {
Authorization: `Bearer ${process.env.NONOX_TOKEN}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const file = Buffer.from(await response.arrayBuffer());import os
import requests
response = requests.get(
"https://nonox.app/api/v1/vouchers/0b9f3c1e-6a2d-4f7b-9c8e-1d2a3b4c5d6e/attachments/311/content",
headers={
"Authorization": f"Bearer {os.environ['NONOX_TOKEN']}",
"Accept": "application/json",
},
timeout=30,
)
response.raise_for_status()
with open("kvitto.pdf", "wb") as file:
file.write(response.content)Fel
4011 exempel
{
"type": "urn:nonox:problem:unauthenticated",
"title": "Unauthorized",
"status": 401,
"code": "unauthenticated",
"detail": "Nyckeln eller token saknas, är ogiltig, har gått ut eller har återkallats.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4035 exempel
{
"type": "urn:nonox:problem:insufficient_scope",
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"detail": "Nyckeln eller appen saknar behörigheten vouchers:post, eller så har personen som gav den inte längre den behörigheten i företaget.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17",
"required_scopes": [
"vouchers:post"
]
}{
"type": "urn:nonox:problem:forbidden",
"title": "Forbidden",
"status": 403,
"code": "forbidden",
"detail": "Behörighet saknas för det här.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:ip_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "ip_not_allowed",
"detail": "Företaget tillåter inte anrop från den här adressen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:company_archived",
"title": "Forbidden",
"status": 403,
"code": "company_archived",
"detail": "Företaget är arkiverat och kan bara läsas.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}{
"type": "urn:nonox:problem:app_not_allowed",
"title": "Forbidden",
"status": 403,
"code": "app_not_allowed",
"detail": "Företaget tillåter inte längre den här appen.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4041 exempel
{
"type": "urn:nonox:problem:not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "Det du söker finns inte.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}4291 exempel
{
"type": "urn:nonox:problem:rate_limited",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "För många anrop. Försök igen om 23 sekunder.",
"instance": "urn:nonox:request:7f3c2a9e-4b1d-4c8e-9a51-2d6f0e8b3c17"
}