Developer docsv1
FOR AI AGENTS

Integrating as an AI agent

Compact, agent-oriented description of the F-sąskaita API. Base URL, authentication, spec location, pagination, error handling and rules that prevent common mistakes.

This page is written for LLM agents and coding assistants. It is intentionally dense. Humans may prefer the guides.

Facts

  • Base URL: https://app.fsaskaita.lt/api
  • OpenAPI 3.1 specification: https://docs.fsaskaita.lt/openapi.json
  • Full documentation as text: https://docs.fsaskaita.lt/llms-full.txt
  • Authentication: Authorization: Bearer <token>. The token belongs to one business; there is no user-level or multi-business token.
  • Always send Accept: application/json. Without it, unauthenticated and rate-limited requests return an HTML redirect or page instead of JSON.
  • Content type for invoices and profile: application/json. Expenses use multipart/form-data because they carry a file.
  • Rate limit: 60 requests per minute per business, shared by all of its tokens. Read X-RateLimit-Remaining; on 429 wait for Retry-After seconds.
  • Pagination: ?page=N, fixed 50 items per page, no filtering or sorting parameters. Response shape { "data": [...], "meta": { "current_page", "last_page", "per_page", "total", "from", "to", "path" } }.
  • Single resources are wrapped: { "data": { ... } }.
  • Identifiers are UUID strings. Dates are YYYY-MM-DD. created_at and updated_at are Unix timestamps in seconds. Money values are JSON numbers. Currency codes are uppercase ISO 4217 and must exist in GET /currencies.
  • Deleting returns 200 with an empty body.
  • Validation errors return 422 with { "message": "...", "errors": { "field.path": ["..."] } }. Messages are in Lithuanian.
  • Resources that belong to another business return 404.

Rules that prevent mistakes

  1. When updating an invoice with PUT /invoices/{id}, send the full invoice, including its current invoice_number. Omitting the number assigns a new one from the series counter.
  2. For each invoice line send exactly one of price, total or total_incl_vat. The server derives the other two.
  3. type values ending in vat_invoice are VAT invoices. They require vat_percentage on every line and a seller vat_code (yours from the profile when use_default_seller_info is true).
  4. Prefer use_default_seller_info: true unless the caller explicitly wants to override seller details.
  5. Draft invoices never appear in the API. Everything the API creates is a finalized, numbered invoice.
  6. If the PDF is not ready yet, GET /invoices/{id}/download waits up to about 20 seconds for it, so call it after creation rather than expecting the file inside the create response.
  7. Webhook payloads are { "event": "<name>", "data": { ... } }, signed with HMAC-SHA256 of the raw body in the Signature header. Verify with the subscription secret before trusting the payload. Deliveries are attempted up to 3 times (two retries, after 10 s and 100 s); treat them as at-least-once.
  8. There is no API for managing tokens or webhook subscriptions. Both are created by a human in the app under Settings, Integrations.
  9. There is no idempotency key. Do not retry a POST that returned a network error without first listing recent invoices.

Instructions for your agent

Paste this into your coding agent, or point it at https://docs.fsaskaita.lt/agents/prompt.md.

Instructions for agentOpen as text

Minimal request

curl https://app.fsaskaita.lt/api/profile \
  -H "Authorization: Bearer $FSASKAITA_TOKEN" \
  -H "Accept: application/json"

Where to look next

F-sąskaita / DevelopersWhat’s new

On this page