Fakturor
Skapa, hämta och hantera kundfakturor. Alla belopp i öre (1 kr = 100 öre).
GET
invoicesscope: readLista alla fakturor med pagination och filtrering.
Query parameters
status, customer_id, from_date, to_date, project_id, limit (max 200), offset
Request
{
"endpoint": "invoices",
"method": "GET",
"params": {
"status": "sent",
"from_date": "2026-01-01",
"limit": 25,
"offset": 0
}
}Response
{
"data": [
{
"id": "6ced0274-3988-...",
"invoice_number": 10,
"invoice_date": "2026-04-01",
"due_date": "2026-05-01",
"status": "sent",
"currency": "SEK",
"subtotal": 1000000,
"vat_total": 250000,
"total": 1250000,
"ocr_number": "000010",
"customer_id": "a1d26e4b-...",
"customers": { "name": "Acme AB" },
"invoice_lines": [
{
"description": "Konsulttjänst",
"quantity": 10,
"unit_price": 100000,
"vat_rate": 25,
"line_total": 1000000,
"vat_amount": 250000,
"account_number": 3010
}
]
}
],
"meta": { "total": 42, "limit": 25, "offset": 0 }
}GET
invoices/:idscope: readHämta en enskild faktura med alla rader.
Request
{
"endpoint": "invoices",
"method": "GET",
"id": "6ced0274-3988-459e-8067-de4b475506ef"
}Response
{
"data": {
"id": "6ced0274-...",
"invoice_number": 10,
"status": "sent",
"total": 1250000,
"invoice_lines": [...]
}
}POST
invoicesscope: writeSkapa en ny faktura. Fakturanummer och OCR genereras automatiskt.
Fält
| Fält | Typ | Krav | Beskrivning |
|---|---|---|---|
customer_id | UUID | Nej | Kund-ID (om befintlig kund) |
invoice_date | string | Ja | Fakturadatum (YYYY-MM-DD) |
due_date | string | Ja | Förfallodatum (YYYY-MM-DD) |
payment_terms | integer | Nej | Betalningsvillkor i dagar (default 30) |
currency | string | Nej | Valutakod (default SEK) |
our_reference | string | Nej | Vår referens |
your_reference | string | Nej | Er referens |
notes | string | Nej | Anteckningar (visas på faktura) |
reverse_charge | boolean | Nej | Omvänd skattskyldighet |
bankgiro | string | Nej | Bankgiro för betalning |
plusgiro | string | Nej | Plusgiro för betalning |
subtotal | integer | Ja | Netto i öre |
vat_total | integer | Ja | Total moms i öre |
total | integer | Ja | Totalbelopp i öre (netto + moms) |
status | string | Nej | "draft" eller "sent" (default draft) |
lines | array | Ja | Fakturarader (se nedan) |
Request
{
"endpoint": "invoices",
"method": "POST",
"params": {
"customer_id": "a1d26e4b-...",
"invoice_date": "2026-04-14",
"due_date": "2026-05-14",
"payment_terms": 30,
"currency": "SEK",
"subtotal": 1000000,
"vat_total": 250000,
"total": 1250000,
"status": "draft",
"lines": [
{
"description": "Konsulttjänst april",
"quantity": 10,
"unit": "tim",
"unitPrice": 100000,
"discountPercent": 0,
"vatRate": 25,
"accountNumber": 3010
}
]
}
}Response
{
"data": {
"id": "new-uuid-...",
"invoice_number": 12,
"ocr_number": "0000127",
"status": "draft",
...
}
}