Skip to content

Faktury Online Source

The Faktury Online source monitors your Faktury-online.com account (a Slovak invoicing service) and emits events when invoices are created or updated. It uses periodic polling with local state caching to detect changes.

Use this source to keep your accounting or ERP system in sync with your invoices — automatically pull new invoices or react when an invoice is marked as paid.

Getting Started

1. Set up credentials

Provide your API key and email either in config.yaml or via environment variables:

  • FAKTURY_ONLINE_KEY — your 32-character API key from Faktury Online.
  • FAKTURY_ONLINE_EMAIL — your login email.

2. Add the source to config.yaml

With environment variables:

yaml
sources:
  my_invoices:
    type: faktury_online

Or with credentials in config:

yaml
sources:
  my_invoices:
    type: faktury_online
    api_key: "your-32-char-api-key"
    email: "your-email@example.com"

Core Concepts

Change Detection

The source maintains a local cache of each invoice's last known state. On each poll, it fetches recently created invoices and compares them against the cache:

  • New invoicefaktury.invoice.created
  • Changed fieldsfaktury.invoice.updated (includes before/after values for each changed field)

Configuration

Minimal Configuration

yaml
sources:
  my_invoices:
    type: faktury_online

Defaults: poll_interval: "6h", max_days_back: 30.

Full Configuration

yaml
sources:
  my_invoices:
    type: faktury_online
    api_key: "your-32-char-api-key"
    email: "your-email@example.com"
    poll_interval: "15m"
    max_days_back: 60

Configuration Reference

ParameterTypeDefaultDescription
api_keystringEnv var32-character API key. Defaults to FAKTURY_ONLINE_KEY environment variable.
emailstringEnv varLogin email. Defaults to FAKTURY_ONLINE_EMAIL environment variable.
poll_intervalstring"6h"How often to check for changes. Supports human-readable intervals (e.g. "15m", "1h").
max_days_backint30How many days back to look for created/updated invoices during each poll.

Event Definitions

TypeEntity IDDescription
faktury.invoice.createdInvoice CodeA new invoice was discovered.
faktury.invoice.updatedInvoice CodeAn existing invoice's properties changed.

Event Examples

faktury.invoice.created

Contains the full invoice detail as returned by the Faktury Online API:

json
{
  "id": 1,
  "event_id": "faktury-2024-001-created",
  "event_type": "faktury.invoice.created",
  "entity_id": "2024-001",
  "created_at": "2024-03-15T10:00:00+00:00",
  "data": {
    "invoice": {
      "invoice_number": "2024-001",
      "supplier": "My Company s.r.o.",
      "customer": "John Doe",
      "invoice_amount": 120.50,
      "invoice_currency": "EUR",
      "invoice_paid": "nie"
    }
  },
  "meta": {}
}

faktury.invoice.updated

Contains the specific changes and the new full snapshot:

json
{
  "id": 2,
  "event_id": "faktury-2024-001-updated-1710500000",
  "event_type": "faktury.invoice.updated",
  "entity_id": "2024-001",
  "created_at": "2024-03-15T12:00:00+00:00",
  "data": {
    "changes": {
      "invoice_paid": { "before": "nie", "after": "ano" },
      "invoice_paid_amount": { "before": 0, "after": 120.50 }
    },
    "snapshot": {
      "invoice_number": "2024-001",
      "invoice_paid": "ano"
    }
  },
  "meta": {}
}