norwegian-accounting-automation
これは、ノルウェーの中小企業の会計プロセスを自動化することを目的としたAIエージェントスキルです。Fiken、Folio API、Google Workspace CLIを統合することで、請求書処理、費用計上、銀行取引照合、添付ファイルアップロード、およびVAT処理を実現します。ノルウェーの会計を簡素化したい、効率を向上させたい、手作業を減らしたい、Fiken/Folioの取引を処理したい、またはGmailの請求書検索を統合したい企業に適しています。
git clone https://github.com/ahdrage/norwegian-accounting-automation.gitBefore / After 効果比較
1 组ノルウェーの中小企業の会計業務では、請求書の手動処理、経費入力、銀行取引の照合、VAT申告が必要で、時間がかかり、エラーが発生しやすく、Fiken、Folio、Gmailなどのプラットフォームを頻繁に切り替える必要があります。
AIエージェントを活用することで、請求書の自動処理、経費の計上、スマートな照合、VAT管理が可能になり、手作業が大幅に削減され、精度が向上し、会計プロセスがより効率的でシームレスになります。
description SKILL.md
name: norwegian-accounting-automation description: Automate Norwegian small business accounting using the Fiken API, Folio API, and Google Workspace CLI (gws). Covers processing invoices, matching bank transactions, booking expenses/sales, uploading attachments, and reconciling card charges. Use when the user wants to automate bookkeeping, process invoices, book expenses in Fiken, handle Folio card transactions, reconcile Vipps settlements, or integrate Gmail invoice search with accounting software. Also use when the user mentions Fiken, Folio, Norwegian accounting, regnskap, or MVA/VAT handling for Norwegian businesses.
Norwegian Accounting Automation
Automate bookkeeping for Norwegian small businesses (ENK/AS) using:
- Fiken — accounting software with REST API
- Folio — business card/banking with REST API
- Google Workspace CLI (gws) — search Gmail for invoices and download attachments
Prerequisites
1. Install Google Workspace CLI
npm install -g @googleworkspace/cli
gws auth setup
gws auth login -s gmail
See gws-setup.md for detailed setup instructions.
2. Fiken API Key
- Log in to fiken.no
- Go to Innstillinger → API and create an API token
- Store as
FIKEN_API_KEYin.env
Base URL: https://api.fiken.no/api/v2
Auth: Authorization: Bearer {FIKEN_API_KEY}
Docs: https://api.fiken.no/api/v2/docs
3. Folio API Key
- Log in to the Folio app
- Go to Settings → Integrations → API and create a key
- Store as
FOLIO_API_KEYin.env
Base URL: https://api.folio.no/v2
Auth: Authorization: Bearer {FOLIO_API_KEY}
Docs: https://dev.api.folio.no/v2/api
4. Find your Fiken company slug
curl -s "https://api.fiken.no/api/v2/companies" \
-H "Authorization: Bearer $FIKEN_API_KEY" | jq '.[].slug'
Use this slug in all Fiken API paths: /companies/{slug}/...
Core Concepts
Norwegian VAT Types in Fiken
| vatType | When to use | netPrice | vat |
|---|---|---|---|
HIGH | Norwegian 25% VAT | gross / 1.25 | gross - net |
HIGH_FOREIGN_SERVICE_DEDUCTIBLE | Foreign SaaS/services (USD/EUR/GBP). Triggers reverse charge. | Full NOK amount | 0 |
NONE | Foreign physical goods (import VAT via customs) | Full NOK amount | 0 |
All amounts in Fiken are in øre (1 NOK = 100). E.g. 438.00 NOK = 43800.
VAT types are account-specific. HIGH_FOREIGN_SERVICE_DEDUCTIBLE is NOT valid on all accounts. Check error messages for valid codes per account.
Common Fiken Expense Accounts
| Account | Description | Typical use |
|---|---|---|
6553 | Programvare | SaaS subscriptions |
7321 | Reklamekostnad | Marketing/advertising |
6100 | Frakt/transport | Shipping costs |
6800 | Kontorrekvisita | Office/packaging supplies |
1200 | Inventar/eiendeler | Physical equipment |
4300 | Varekjøp | Goods for resale |
3000 | Salgsinntekt | Revenue |
Payment Accounts
| Code | Description |
|---|---|
2062 | Privatutlegg (personal card reimbursement) |
1920:NNNNN | Business bank card (Folio-kort, DNB, etc.) |
1960:NNNNN | Payment service accounts (Vipps, Stripe) |
Find your payment account codes:
curl -s "https://api.fiken.no/api/v2/companies/{slug}/bankAccounts" \
-H "Authorization: Bearer $FIKEN_API_KEY" | jq '.[] | {name, accountCode}'
Workflows
A. Book an expense (purchase) in Fiken
curl -X POST "https://api.fiken.no/api/v2/companies/{slug}/purchases" \
-H "Authorization: Bearer $FIKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "2025-01-02",
"kind": "cash_purchase",
"currency": "NOK",
"paid": true,
"lines": [{
"description": "Service name (2025-01-02)",
"account": "6553",
"netPrice": 36970,
"vat": 0,
"vatType": "HIGH_FOREIGN_SERVICE_DEDUCTIBLE"
}],
"paymentAccount": "1920:10003",
"paymentDate": "2025-01-02"
}'
For Norwegian vendors with 25% VAT:
{
"lines": [{
"account": "6553",
"netPrice": 15920,
"vat": 3980,
"vatType": "HIGH"
}]
}
B. Attach a PDF to a Fiken purchase
curl -X POST "https://api.fiken.no/api/v2/companies/{slug}/purchases/{purchaseId}/attachments" \
-H "Authorization: Bearer $FIKEN_API_KEY" \
-F "filename=Invoice.pdf" \
-F "attachToSale=true" \
-F "file=@/path/to/Invoice.pdf;type=application/pdf"
C. Fetch and filter Folio card transactions
curl -s "https://api.folio.no/v2/events?startDate=2025-01-01&endDate=2025-06-30" \
-H "Authorization: Bearer $FOLIO_API_KEY"
The v2 REST API does not provide a search parameter on /events. Fetch by date range and filter client-side.
Prefer structured event fields such as cardAuthorization.merchantName when available. Use transactions[].description as a fallback for parsing card suffix, currency, foreign amount, and exchange rate.
D. Upload attachment to a Folio event
Folio uses raw binary body — NOT multipart/form-data:
curl -X POST "https://api.folio.no/v2/events/{eventId}/attachments" \
-H "Authorization: Bearer $FOLIO_API_KEY" \
-H "Content-Type: application/pdf" \
-H 'Content-Disposition: attachment; filename="Invoice.pdf"' \
--data-binary @/path/to/Invoice.pdf
E. Mark a Folio event complete
curl -X POST "https://api.folio.no/v2/events/{eventId}/complete" \
-H "Authorization: Bearer $FOLIO_API_KEY"
Returns HTTP 202 (Accepted).
F. Search Gmail for invoices
gws gmail users messages list --params '{"userId":"me","q":"vendor invoice 2025"}'
gws gmail users messages get --params '{"userId":"me","id":"MSG_ID","format":"full"}'
gws gmail users messages attachments get \
--params '{"userId":"me","messageId":"MSG_ID","id":"ATTACHMENT_ID"}'
Gmail attachment data is URL-safe base64: replace - with +, _ with /, add = padding before decoding.
G. Create a sale in Fiken (e.g. Vipps settlements)
curl -X POST "https://api.fiken.no/api/v2/companies/{slug}/sales" \
-H "Authorization: Bearer $FIKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "2025-11-06",
"kind": "external_invoice",
"currency": "NOK",
"lines": [{
"description": "Vipps settlement 2005799",
"netPrice": 159920,
"vat": 39980,
"account": "3000",
"vatType": "HIGH"
}],
"customerId": 12345678,
"paid": true,
"totalPaid": 199900,
"paymentAccount": "1960:10002",
"paymentDate": "2025-11-06"
}'
totalPaid is required when paid: true.
Automation Strategies
For detailed patterns on batch processing, dedup logic, and vendor classification, see automation-patterns.md.
For complete API reference and gotchas, see api-reference.md.
Batch booking card charges
The most powerful automation: classify all card charges by vendor keyword, determine the correct Fiken account and VAT type, and create purchases in bulk.
- Fetch all Folio events for the period (split into H1/H2 for large sets)
- Filter for card charges (outgoing, identified by card number prefix)
- Classify each by vendor keyword → Fiken account + VAT type
- Fetch existing Fiken purchases to avoid duplicates (match on date + amount)
- Create
cash_purchasefor each unbooked charge withpaymentAccountmatching the bank card account - Handle duplicate amounts on same date by counting occurrences
Folio → Fiken Superføring
When you create a Fiken purchase/sale with the correct paymentAccount, it auto-matches the bank line in Fiken's "Superføring" (bank feed matching). This eliminates manual bank reconciliation.
Personal card expenses (Privatutlegg)
For business expenses paid with a personal card, book in Fiken with paymentAccount: "2062". This creates a liability that can be reimbursed.
forumユーザーレビュー (0)
レビューを書く
レビューなし
統計データ
ユーザー評価
この Skill を評価