Dart / Flutter SDK
The official efakturuj_api package is a typed Dart client generated from our OpenAPI spec, ready to drop into a Flutter mobile app or a server-side Dart service. Method names follow the <tag>Action() convention so they stay stable across regenerations.
Install
Add the package to pubspec.yaml by git ref (a published pub.dev release will follow once Plan 3 ships):
dependencies:
efakturuj_api:
git:
url: https://bitbucket.org/dreamtteam/efakturuj-sdk-dart
ref: v1.0.0Then run dart pub get (or flutter pub get). The package depends on dio for HTTP transport and json_annotation for serialisation — both are pulled in transitively.
Configure
Construct a single EfakturujClient at app startup and reuse it. Pass your API key via the X-Api-Key header on a shared Dio instance:
import 'package:dio/dio.dart';
import 'package:efakturuj_api/efakturuj_api.dart';
final client = EfakturujClient(
dio: Dio(BaseOptions(
baseUrl: 'https://api.efakturuj.sk/api/v1',
headers: {'X-Api-Key': '<YOUR_API_KEY>'},
connectTimeout: const Duration(seconds: 30),
receiveTimeout: const Duration(seconds: 30),
)),
);For sandbox testing swap the base URL to https://sandbox.efakturuj.sk/api/v1. For end-user-facing Flutter apps that act on behalf of an eFakturuj user, use a JWT bearer token instead of an API key (see Authentication guide).
List your invoices
final response = await client.invoices.invoicesList(
page: 1,
pageSize: 20,
);
print('You have ${response.total} invoices.');
for (final invoice in response.data) {
print('${invoice.invoiceNumber} — ${invoice.status} — ${invoice.totalGross} ${invoice.currencyCode}');
}Send an invoice
final draft = await client.invoices.invoicesCreate(
body: InvoiceCreate(
invoiceNumber: '2026-001',
issueDate: DateTime(2026, 5, 6),
dueDate: DateTime(2026, 6, 5),
currencyCode: 'EUR',
supplier: AddressBlock(
name: 'Vaša Firma s.r.o.',
vatId: 'SK0987654321',
ico: '87654321',
street: 'Mlynské nivy 5',
city: 'Bratislava',
postalCode: '821 09',
countryCode: 'SK',
peppolId: '0210:87654321',
),
buyer: AddressBlock(
name: 'Príklad s.r.o.',
vatId: 'SK1234567890',
ico: '12345678',
street: 'Hlavná 12',
city: 'Bratislava',
postalCode: '811 01',
countryCode: 'SK',
peppolId: '0210:12345678',
),
lines: [
InvoiceLineCreate(
lineNumber: 1,
itemName: 'Konzultačné služby — Apríl 2026',
quantity: '10',
unitCode: 'HUR',
unitPrice: '100.00',
vatRate: '23.00',
vatCategoryCode: 'S',
),
],
),
);
await client.invoices.invoicesSend(invoiceId: draft.id);Notes
- The package is regenerated from openapi.json on every release, so method signatures and types stay 1:1 with the API surface.
- Decimal-valued fields (
quantity,unit_price,vat_rate,total_*) are typed asStringin Dart to preserve exact precision — parse toDecimalfrom package:decimal for arithmetic. - Errors surface as
DioExceptionwith a structuredErrorResponsebody — wrap calls in try/catch and inspecte.response?.data.
Issues, pull requests, and SDK questions go to the SDK repo. For questions about the API itself rather than the SDK, see the reference.