v1.4 · StableREST · JSON

API Reference

Programmatic access to documents, rules, tenants, and webhooks. All endpoints are scoped by API key and tenant.

Quick start

curl -X POST https://api.fiscalflow.io/v1/documents \
  -H "Authorization: Bearer ff_live_••••••••" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@invoice.xml" \
  -F "type=invoice_xml" \
  -F "period=2026-Q2"

Authentication

All requests require a Bearer token in the Authorization header.

Authorization: Bearer ff_live_xxx
  • ✓ Per-tenant API keys
  • ✓ Scoped permissions
  • ✓ Rotation supported
  • ✓ Rate limit: 1000 rpm

Endpoints

MethodEndpointDescription
POST/v1/documentsUpload a fiscal document (XML or PDF).
GET/v1/documentsList documents with filters.
GET/v1/documents/{id}Retrieve a document with reconciliation results.
PATCH/v1/documents/{id}Update document metadata or status.
DELETE/v1/documents/{id}Delete a document.
GET/v1/rulesList rules in the engine.
POST/v1/rulesCreate a custom reconciliation rule.
POST/v1/rules/{id}/runRun a rule against a dataset.
GET/v1/tenantsAdmin: list tenants.
POST/v1/webhooksRegister a webhook endpoint.

Webhooks

Receive events when documents finish processing.

{
  "id": "evt_8a72f",
  "type": "document.processed",
  "data": {
    "document_id": "d-1001",
    "status": "processed",
    "rules_passed": 98,
    "rules_failed": 2
  },
  "tenant_id": "t-001",
  "created_at": "2026-04-30T09:21:00Z"
}

Errors

Standard HTTP codes with structured error bodies.

400Validation error
401Missing or invalid API key
403Tenant scope mismatch
404Resource not found
429Rate limit exceeded
500Internal server error