Fakturoid API v3
Czech invoicing service API integration - comprehensive reference for building integrations.
Quick Start
Environment Setup
export FAKTUROID_CLIENT_ID="your-client-id"
export FAKTUROID_CLIENT_SECRET="your-client-secret"
export FAKTUROID_ACCOUNT_SLUG="your-account-slug"
Authenticate
python scripts/auth.py credentials --save
Create Invoice
python scripts/invoice.py create --subject-id 123 --lines '[
{"name": "Consulting", "quantity": 8, "unit_name": "hours", "unit_price": 2000, "vat_rate": 21}
]'
API Basics
| Setting |
Value |
| Base URL |
https://app.fakturoid.cz/api/v3 |
| Account URL |
https://app.fakturoid.cz/api/v3/accounts/{slug} |
| Auth |
OAuth 2.0 (Client Credentials or Authorization Code) |
| Pagination |
40 records per page |
| Rate Limit |
400 requests per 60 seconds |
Required Headers
User-Agent: YourAppName (your@email.com)
Authorization: Bearer {access_token}
Content-Type: application/json
Accept: application/json
Scripts Reference
Core Scripts
| Script |
Commands |
Description |
auth.py |
credentials, refresh, revoke, status |
OAuth token management |
subject.py |
list, get, search, create, update, delete, lookup-ico |
Contact management |
invoice.py |
list, get, search, create, update, delete, action, pdf, pay, pay-delete |
Invoice operations |
expense.py |
list, get, search, create, update, delete, action, pay, pay-delete |
Expense tracking |
generator.py |
list, get, create, update, delete |
Invoice templates |
Additional Scripts
| Script |
Commands |
Description |
user.py |
get, list |
User and account info |
bank_account.py |
list |
Bank account listing |
inventory.py |
list-items, get-item, create-item, list-moves, create-move |
Inventory management |
recurring.py |
list, get, create, update, delete, pause, activate |
Recurring invoices |
inbox.py |
list, upload, send-to-ocr, download, delete |
OCR file processing |
event.py |
list, list-paid |
Activity log |
todo.py |
list, toggle |
Task management |
message.py |
send |
Send invoice emails |
webhook.py |
list, get, create, update, delete |
Webhook management |
Common Workflows
Create Invoice for New Customer
# 1. Create subject
python scripts/subject.py create --name "Acme s.r.o." --ico 12345678 --dic CZ12345678
# 2. Create invoice (use returned subject ID)
python scripts/invoice.py create --subject-id 456 --lines '[
{"name": "Web development", "quantity": 40, "unit_name": "hours", "unit_price": 1500, "vat_rate": 21}
]'
# 3. Mark as sent and download PDF
python scripts/invoice.py action 789 mark_as_sent
python scripts/invoice.py pdf 789 --output invoice.pdf
Record Expense from Supplier
# 1. Ensure supplier exists
python scripts/subject.py create --name "Supplier Ltd" --type supplier --ico 87654321
# 2. Create expense
python scripts/expense.py create --subject-id 321 --original-number "FV-2024-0456" --lines '[
{"name": "Office supplies", "quantity": 10, "unit_name": "ks", "unit_price": 450, "vat_rate": 21}
]'
Setup Monthly Recurring Invoice
python scripts/recurring.py create --name "Monthly Hosting" --subject-id 123 \
--start-date 2024-02-01 --months-period 1 --send-email \
--lines '[{"name": "Web hosting - {MMMM} {YYYY}", "unit_price": 500, "vat_rate": 21}]'
Process Inbox File with OCR
# Upload and send to OCR
python scripts/inbox.py upload invoice.pdf --send-to-ocr
# Check status
python scripts/inbox.py list
Enums Reference
Document Types
| Value |
Czech |
Description |
invoice |
Faktura |
Standard invoice |
proforma |
Zálohová faktura |
Advance payment request |
partial_proforma |
Částečná záloha |
Legacy partial advance |
correction |
Dobropis |
Credit note |
tax_document |
Daňový doklad |
Tax receipt for proforma payment |
final_invoice |
Vyúčtovací faktura |
Final invoice from tax documents |
Invoice Status
| Value |
Description |
open |
New, unpaid, not sent |
sent |
Sent to client, not overdue |
overdue |
Past due date |
paid |
Fully paid |
cancelled |
Cancelled (VAT payers only) |
uncollectible |
Marked as bad debt |
Expense Status
| Value |
Description |
open |
Received, not paid |
overdue |
Past due date |
paid |
Fully paid |
VAT Modes
| Value |
Czech |
Description |
vat_payer |
Plátce DPH |
Standard VAT payer |
non_vat_payer |
Neplátce DPH |
Non-VAT payer |
identified_person |
Identifikovaná osoba |
EU VAT identified person |
VAT Price Modes
| Value |
Description |
without_vat |
Prices entered without VAT |
from_total_with_vat |
Calculate VAT from total with VAT |
VAT Rates
| Value |
Rate |
Description |
standard |
21% |
Standard rate |
reduced |
12% |
First reduced rate |
reduced2 |
10% |
Second reduced rate |
zero |
0% |
Zero VAT |
Payment Methods
| Value |
Description |
bank |
Bank transfer |
cash |
Cash payment |
cod |
Cash on delivery |
card |
Card payment |
paypal |
PayPal |
custom |
Custom (see custom_payment_method) |
Languages
| Value |
Language |
cz |
Czech |
sk |
Slovak |
en |
English |
de |
German |
fr |
French |
it |
Italian |
es |
Spanish |
ru |
Russian |
pl |
Polish |
hu |
Hungarian |
ro |
Romanian |
Subject Types
| Value |
Description |
customer |
Customer only |
supplier |
Supplier only |
both |
Both customer and supplier |
Invoice Actions
| Action |
Description |
mark_as_sent |
Mark invoice as sent |
cancel |
Cancel invoice |
undo_cancel |
Revert cancellation |
lock |
Lock from editing |
unlock |
Unlock for editing |
mark_as_uncollectible |
Mark as bad debt |
undo_uncollectible |
Revert uncollectible |
Expense Actions
| Action |
Description |
lock |
Lock from editing |
unlock |
Unlock for editing |
OSS Modes (EU One Stop Shop)
| Value |
Description |
disabled |
OSS disabled |
service |
OSS for services |
goods |
OSS for goods |
Proforma Followup Documents
| Value |
Description |
final_invoice_paid |
Auto-create paid invoice |
final_invoice |
Manual invoice creation |
tax_document |
Auto-create tax document |
none |
No followup document |
OCR Status
| Value |
Description |
created |
OCR requested |
processing |
OCR in progress |
processing_failed |
OCR failed |
processing_rejected |
File rejected |
processed |
Successfully processed |
Czech-Specific Fields
| API Field |
Czech |
Example |
registration_no |
IČO |
12345678 |
vat_no |
DIČ |
CZ12345678 |
local_vat_no |
SK DIČ |
1234567890 |
taxable_fulfillment_due |
DUZP |
2024-01-15 |
transferred_tax_liability |
Přenesená daňová povinnost |
true |
supply_code |
Kód předmětu plnění |
4 |
Line Item Structure
{
"name": "Service description",
"quantity": 10,
"unit_name": "hours",
"unit_price": 1500,
"vat_rate": 21,
"inventory_item_id": 123,
"sku": "PROD-001"
}
Line Operations
| Operation |
Method |
| Add line |
Omit id |
| Update line |
Include id |
| Delete line |
Include id and _destroy: true |
References
Core Documentation
- api-reference.md - Complete endpoint catalog
- authentication.md - OAuth 2.0 guide with code examples
- error-handling.md - Error codes and handling
Resource Documentation
- invoices.md - Invoice management
- invoice-payments.md - Payment operations
- invoice-messages.md - Email sending
- subjects.md - Contact management
- expenses.md - Expense tracking
- expense-payments.md - Expense payments
- generators.md - Invoice templates
- recurring-generators.md - Automated invoicing
- inventory.md - Stock management
- webhooks.md - Event notifications
Additional Resources
- users.md - User and account info
- account.md - Account settings
- bank-accounts.md - Bank accounts
- number-formats.md - Invoice numbering
- inbox-files.md - OCR processing
- events.md - Activity log
- todos.md - Task management
- czech-invoicing.md - Czech tax compliance
Error Handling
| Status |
Meaning |
Action |
| 400 |
Bad Request |
Check date formats, User-Agent header |
| 401 |
Unauthorized |
Refresh OAuth token |
| 402 |
Payment Required |
Fakturoid account blocked |
| 403 |
Forbidden |
Permission denied, resource limits |
| 404 |
Not Found |
Resource doesn't exist |
| 422 |
Validation Error |
Check errors field for details |
| 429 |
Rate Limited |
Wait for X-RateLimit reset |
| 503 |
Unavailable |
Maintenance, retry later |
Token Management
# Get new token
python scripts/auth.py credentials --save
# Check token status
python scripts/auth.py status
# Refresh expired token (Authorization Code flow)
python scripts/auth.py refresh
# Revoke token
python scripts/auth.py revoke
Token file: ~/.fakturoid/token.json
Rate Limiting
Headers on every response:
X-RateLimit-Policy: default;q=400;w=60
X-RateLimit: default;r=398;t=55
q=400: Max 400 requests
w=60: Per 60 seconds window
r=398: Remaining requests
t=55: Seconds until reset
When exceeded: 429 Too Many Requests - wait for reset.
1---2name: fakturoid3description: Czech invoicing API integration for Fakturoid. Use when the user needs to create, manage, or retrieve invoices, contacts/subjects, or expenses from Fakturoid. Supports OAuth 2.0 authentication, invoice creation with Czech tax compliance (IČO, DIČ, VAT), PDF downloads, payment tracking, expense management, inventory, recurring invoices, webhooks, and invoice templates (generators). Triggers on mentions of Fakturoid, Czech invoicing, IČO/DIČ, or invoice management tasks.4---56# Fakturoid API v378Czech invoicing service API integration - comprehensive reference for building integrations.910## Quick Start1112### Environment Setup13```bash14export FAKTUROID_CLIENT_ID="your-client-id"15export FAKTUROID_CLIENT_SECRET="your-client-secret"16export FAKTUROID_ACCOUNT_SLUG="your-account-slug"17```1819### Authenticate20```bash21python scripts/auth.py credentials --save22```2324### Create Invoice25```bash26python scripts/invoice.py create --subject-id 123 --lines '[27 {"name": "Consulting", "quantity": 8, "unit_name": "hours", "unit_price": 2000, "vat_rate": 21}28]'29```3031---3233## API Basics3435| Setting | Value |36|---------|-------|37| **Base URL** | `https://app.fakturoid.cz/api/v3` |38| **Account URL** | `https://app.fakturoid.cz/api/v3/accounts/{slug}` |39| **Auth** | OAuth 2.0 (Client Credentials or Authorization Code) |40| **Pagination** | 40 records per page |41| **Rate Limit** | 400 requests per 60 seconds |4243### Required Headers4445```http46User-Agent: YourAppName (your@email.com)47Authorization: Bearer {access_token}48Content-Type: application/json49Accept: application/json50```5152---5354## Scripts Reference5556### Core Scripts5758| Script | Commands | Description |59|--------|----------|-------------|60| `auth.py` | credentials, refresh, revoke, status | OAuth token management |61| `subject.py` | list, get, search, create, update, delete, lookup-ico | Contact management |62| `invoice.py` | list, get, search, create, update, delete, action, pdf, pay, pay-delete | Invoice operations |63| `expense.py` | list, get, search, create, update, delete, action, pay, pay-delete | Expense tracking |64| `generator.py` | list, get, create, update, delete | Invoice templates |6566### Additional Scripts6768| Script | Commands | Description |69|--------|----------|-------------|70| `user.py` | get, list | User and account info |71| `bank_account.py` | list | Bank account listing |72| `inventory.py` | list-items, get-item, create-item, list-moves, create-move | Inventory management |73| `recurring.py` | list, get, create, update, delete, pause, activate | Recurring invoices |74| `inbox.py` | list, upload, send-to-ocr, download, delete | OCR file processing |75| `event.py` | list, list-paid | Activity log |76| `todo.py` | list, toggle | Task management |77| `message.py` | send | Send invoice emails |78| `webhook.py` | list, get, create, update, delete | Webhook management |7980---8182## Common Workflows8384### Create Invoice for New Customer85```bash86# 1. Create subject87python scripts/subject.py create --name "Acme s.r.o." --ico 12345678 --dic CZ123456788889# 2. Create invoice (use returned subject ID)90python scripts/invoice.py create --subject-id 456 --lines '[91 {"name": "Web development", "quantity": 40, "unit_name": "hours", "unit_price": 1500, "vat_rate": 21}92]'9394# 3. Mark as sent and download PDF95python scripts/invoice.py action 789 mark_as_sent96python scripts/invoice.py pdf 789 --output invoice.pdf97```9899### Record Expense from Supplier100```bash101# 1. Ensure supplier exists102python scripts/subject.py create --name "Supplier Ltd" --type supplier --ico 87654321103104# 2. Create expense105python scripts/expense.py create --subject-id 321 --original-number "FV-2024-0456" --lines '[106 {"name": "Office supplies", "quantity": 10, "unit_name": "ks", "unit_price": 450, "vat_rate": 21}107]'108```109110### Setup Monthly Recurring Invoice111```bash112python scripts/recurring.py create --name "Monthly Hosting" --subject-id 123 \113 --start-date 2024-02-01 --months-period 1 --send-email \114 --lines '[{"name": "Web hosting - {MMMM} {YYYY}", "unit_price": 500, "vat_rate": 21}]'115```116117### Process Inbox File with OCR118```bash119# Upload and send to OCR120python scripts/inbox.py upload invoice.pdf --send-to-ocr121122# Check status123python scripts/inbox.py list124```125126---127128## Enums Reference129130### Document Types131132| Value | Czech | Description |133|-------|-------|-------------|134| `invoice` | Faktura | Standard invoice |135| `proforma` | Zálohová faktura | Advance payment request |136| `partial_proforma` | Částečná záloha | Legacy partial advance |137| `correction` | Dobropis | Credit note |138| `tax_document` | Daňový doklad | Tax receipt for proforma payment |139| `final_invoice` | Vyúčtovací faktura | Final invoice from tax documents |140141### Invoice Status142143| Value | Description |144|-------|-------------|145| `open` | New, unpaid, not sent |146| `sent` | Sent to client, not overdue |147| `overdue` | Past due date |148| `paid` | Fully paid |149| `cancelled` | Cancelled (VAT payers only) |150| `uncollectible` | Marked as bad debt |151152### Expense Status153154| Value | Description |155|-------|-------------|156| `open` | Received, not paid |157| `overdue` | Past due date |158| `paid` | Fully paid |159160### VAT Modes161162| Value | Czech | Description |163|-------|-------|-------------|164| `vat_payer` | Plátce DPH | Standard VAT payer |165| `non_vat_payer` | Neplátce DPH | Non-VAT payer |166| `identified_person` | Identifikovaná osoba | EU VAT identified person |167168### VAT Price Modes169170| Value | Description |171|-------|-------------|172| `without_vat` | Prices entered without VAT |173| `from_total_with_vat` | Calculate VAT from total with VAT |174175### VAT Rates176177| Value | Rate | Description |178|-------|------|-------------|179| `standard` | 21% | Standard rate |180| `reduced` | 12% | First reduced rate |181| `reduced2` | 10% | Second reduced rate |182| `zero` | 0% | Zero VAT |183184### Payment Methods185186| Value | Description |187|-------|-------------|188| `bank` | Bank transfer |189| `cash` | Cash payment |190| `cod` | Cash on delivery |191| `card` | Card payment |192| `paypal` | PayPal |193| `custom` | Custom (see `custom_payment_method`) |194195### Languages196197| Value | Language |198|-------|----------|199| `cz` | Czech |200| `sk` | Slovak |201| `en` | English |202| `de` | German |203| `fr` | French |204| `it` | Italian |205| `es` | Spanish |206| `ru` | Russian |207| `pl` | Polish |208| `hu` | Hungarian |209| `ro` | Romanian |210211### Subject Types212213| Value | Description |214|-------|-------------|215| `customer` | Customer only |216| `supplier` | Supplier only |217| `both` | Both customer and supplier |218219### Invoice Actions220221| Action | Description |222|--------|-------------|223| `mark_as_sent` | Mark invoice as sent |224| `cancel` | Cancel invoice |225| `undo_cancel` | Revert cancellation |226| `lock` | Lock from editing |227| `unlock` | Unlock for editing |228| `mark_as_uncollectible` | Mark as bad debt |229| `undo_uncollectible` | Revert uncollectible |230231### Expense Actions232233| Action | Description |234|--------|-------------|235| `lock` | Lock from editing |236| `unlock` | Unlock for editing |237238### OSS Modes (EU One Stop Shop)239240| Value | Description |241|-------|-------------|242| `disabled` | OSS disabled |243| `service` | OSS for services |244| `goods` | OSS for goods |245246### Proforma Followup Documents247248| Value | Description |249|-------|-------------|250| `final_invoice_paid` | Auto-create paid invoice |251| `final_invoice` | Manual invoice creation |252| `tax_document` | Auto-create tax document |253| `none` | No followup document |254255### OCR Status256257| Value | Description |258|-------|-------------|259| `created` | OCR requested |260| `processing` | OCR in progress |261| `processing_failed` | OCR failed |262| `processing_rejected` | File rejected |263| `processed` | Successfully processed |264265---266267## Czech-Specific Fields268269| API Field | Czech | Example |270|-----------|-------|---------|271| `registration_no` | IČO | `12345678` |272| `vat_no` | DIČ | `CZ12345678` |273| `local_vat_no` | SK DIČ | `1234567890` |274| `taxable_fulfillment_due` | DUZP | `2024-01-15` |275| `transferred_tax_liability` | Přenesená daňová povinnost | `true` |276| `supply_code` | Kód předmětu plnění | `4` |277278---279280## Line Item Structure281282```json283{284 "name": "Service description",285 "quantity": 10,286 "unit_name": "hours",287 "unit_price": 1500,288 "vat_rate": 21,289 "inventory_item_id": 123,290 "sku": "PROD-001"291}292```293294### Line Operations295296| Operation | Method |297|-----------|--------|298| Add line | Omit `id` |299| Update line | Include `id` |300| Delete line | Include `id` and `_destroy: true` |301302---303304## References305306### Core Documentation307- [api-reference.md](references/api-reference.md) - Complete endpoint catalog308- [authentication.md](references/authentication.md) - OAuth 2.0 guide with code examples309- [error-handling.md](references/error-handling.md) - Error codes and handling310311### Resource Documentation312- [invoices.md](references/invoices.md) - Invoice management313- [invoice-payments.md](references/invoice-payments.md) - Payment operations314- [invoice-messages.md](references/invoice-messages.md) - Email sending315- [subjects.md](references/subjects.md) - Contact management316- [expenses.md](references/expenses.md) - Expense tracking317- [expense-payments.md](references/expense-payments.md) - Expense payments318- [generators.md](references/generators.md) - Invoice templates319- [recurring-generators.md](references/recurring-generators.md) - Automated invoicing320- [inventory.md](references/inventory.md) - Stock management321- [webhooks.md](references/webhooks.md) - Event notifications322323### Additional Resources324- [users.md](references/users.md) - User and account info325- [account.md](references/account.md) - Account settings326- [bank-accounts.md](references/bank-accounts.md) - Bank accounts327- [number-formats.md](references/number-formats.md) - Invoice numbering328- [inbox-files.md](references/inbox-files.md) - OCR processing329- [events.md](references/events.md) - Activity log330- [todos.md](references/todos.md) - Task management331- [czech-invoicing.md](references/czech-invoicing.md) - Czech tax compliance332333---334335## Error Handling336337| Status | Meaning | Action |338|--------|---------|--------|339| 400 | Bad Request | Check date formats, User-Agent header |340| 401 | Unauthorized | Refresh OAuth token |341| 402 | Payment Required | Fakturoid account blocked |342| 403 | Forbidden | Permission denied, resource limits |343| 404 | Not Found | Resource doesn't exist |344| 422 | Validation Error | Check `errors` field for details |345| 429 | Rate Limited | Wait for `X-RateLimit` reset |346| 503 | Unavailable | Maintenance, retry later |347348---349350## Token Management351352```bash353# Get new token354python scripts/auth.py credentials --save355356# Check token status357python scripts/auth.py status358359# Refresh expired token (Authorization Code flow)360python scripts/auth.py refresh361362# Revoke token363python scripts/auth.py revoke364```365366Token file: `~/.fakturoid/token.json`367368---369370## Rate Limiting371372Headers on every response:373```http374X-RateLimit-Policy: default;q=400;w=60375X-RateLimit: default;r=398;t=55376```377378- `q=400`: Max 400 requests379- `w=60`: Per 60 seconds window380- `r=398`: Remaining requests381- `t=55`: Seconds until reset382383When exceeded: `429 Too Many Requests` - wait for reset.