# F-sąskaita Developers > Public API documentation for integrators and AI agents. ## Pages - [F-sąskaita API](https://docs.fsaskaita.lt/) ([Markdown](https://docs.fsaskaita.lt/index.md)): Create and manage invoices and expenses for a Lithuanian business programmatically. REST, JSON, bearer tokens, webhooks. - [Integrating as an AI agent](https://docs.fsaskaita.lt/agents/) ([Markdown](https://docs.fsaskaita.lt/agents.md)): Compact, agent-oriented description of the F-sąskaita API. Base URL, authentication, spec location, pagination, error handling and rules that prevent common mistakes. - [Changelog](https://docs.fsaskaita.lt/changelog/) ([Markdown](https://docs.fsaskaita.lt/changelog.md)): Updates to the Public API and the details that matter to your integration. - [Guides](https://docs.fsaskaita.lt/guides/) ([Markdown](https://docs.fsaskaita.lt/guides.md)): Guides to the F-sąskaita API: authentication, invoices, expenses, webhooks and the conventions every endpoint shares. - [Authentication](https://docs.fsaskaita.lt/guides/authentication/) ([Markdown](https://docs.fsaskaita.lt/guides/authentication.md)): Create a Business token in the app, send it as a bearer token, and understand its scope and lifetime. - [Conventions, errors and rate limits](https://docs.fsaskaita.lt/guides/conventions/) ([Markdown](https://docs.fsaskaita.lt/guides/conventions.md)): Request and response formats, pagination, identifiers, dates and money, HTTP status codes, and the 60 requests per minute limit. - [Expenses](https://docs.fsaskaita.lt/guides/expenses/) ([Markdown](https://docs.fsaskaita.lt/guides/expenses.md)): Record purchase documents with their file, update them, replace the file, and download the original. - [Invoices](https://docs.fsaskaita.lt/guides/invoices/) ([Markdown](https://docs.fsaskaita.lt/guides/invoices.md)): The invoice model, invoice types, numbering and series, the create and update requests, and downloading the PDF. - [Webhooks](https://docs.fsaskaita.lt/guides/webhooks/) ([Markdown](https://docs.fsaskaita.lt/guides/webhooks.md)): Subscribe an HTTPS endpoint to invoice and expense events, verify the HMAC-SHA256 signature, and handle retries. - [Reference](https://docs.fsaskaita.lt/reference/) ([Markdown](https://docs.fsaskaita.lt/reference.md)): Every Public API operation, request and response, in one place. - [List currencies](https://docs.fsaskaita.lt/reference/currencies/listCurrencies/) ([Markdown](https://docs.fsaskaita.lt/reference/currencies/listCurrencies.md)): Returns every accepted currency code. Not paginated. - [Create an expense](https://docs.fsaskaita.lt/reference/expenses/createExpense/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/createExpense.md)): Creates an expense from a multipart/form-data body. file is required and must have one of the extensions jpeg, jpg, bmp, gif, pdf, png, tiff, xlsx, xls, doc, docx or odf. vat, invoice_number and the file are stored but not returned; fetch the file with the download endpoint. Fires the expense.created webhook. - [Delete an expense](https://docs.fsaskaita.lt/reference/expenses/deleteExpense/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/deleteExpense.md)): Deletes the expense and its file. Fires the expense.deleted webhook. - [Download the expense file](https://docs.fsaskaita.lt/reference/expenses/downloadExpenseFile/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/downloadExpenseFile.md)): Streams the stored file under its original name. Content-Length is not sent. - [Get an expense](https://docs.fsaskaita.lt/reference/expenses/getExpense/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/getExpense.md)) - [List expenses](https://docs.fsaskaita.lt/reference/expenses/listExpenses/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/listExpenses.md)): Returns the business's expenses, newest first, 50 per page. Use ?page= to paginate; the page size cannot be changed. - [Replace the expense file](https://docs.fsaskaita.lt/reference/expenses/replaceExpenseFile/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/replaceExpenseFile.md)): Replaces only the stored file; every other field is kept. Fires the expense.updated webhook. - [Replace an expense](https://docs.fsaskaita.lt/reference/expenses/updateExpense/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/updateExpense.md)): Replaces every field of the expense with the multipart/form-data body. file is optional here; when present it replaces the stored file. Fires the expense.updated webhook. - [expense.created](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseCreated/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseCreated.md)): Sent when an expense is created through the API or the app. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [expense.deleted](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseDeleted/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseDeleted.md)): Sent when an expense is deleted through the API or the app. The payload contains only the id of the deleted expense. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [expense.updated](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseUpdated/) ([Markdown](https://docs.fsaskaita.lt/reference/expenses/webhookExpenseUpdated.md)): Sent when an expense is replaced or its file is swapped. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [Create an invoice](https://docs.fsaskaita.lt/reference/invoices/createInvoice/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/createInvoice.md)): Creates a finalized invoice and queues its PDF. Fires the invoice.created webhook. - [Delete an invoice](https://docs.fsaskaita.lt/reference/invoices/deleteInvoice/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/deleteInvoice.md)): Deletes the invoice together with its PDF, lines, payment options, custom fields, payment records and e-mail history, and recalculates the series counter. Fires the invoice.deleted webhook. - [Download the invoice PDF](https://docs.fsaskaita.lt/reference/invoices/downloadInvoicePdf/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/downloadInvoicePdf.md)): Streams the invoice PDF. If the PDF is not ready yet, the request waits up to 20 seconds for it and then fails with 500. Content-Length is not sent. - [Get an invoice](https://docs.fsaskaita.lt/reference/invoices/getInvoice/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/getInvoice.md)) - [List invoices](https://docs.fsaskaita.lt/reference/invoices/listInvoices/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/listInvoices.md)): Returns the business's finalized invoices, newest first, 50 per page. Use ?page= to paginate; the page size cannot be changed. Drafts made in the app are never included. - [Replace an invoice](https://docs.fsaskaita.lt/reference/invoices/updateInvoice/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/updateInvoice.md)): Replaces every field of the invoice with the request body, under the same rules as create. Always resend the current invoice_number: when it is omitted the invoice is renumbered from the series counter. Items, payment options and custom fields are rewritten, totals recalculated and the PDF regenerated. Fires the invoice.updated webhook. - [invoice.created](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceCreated/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceCreated.md)): Sent when a finalized invoice is created, whether through the API, the app or a recurring invoice. The PDF is rendered asynchronously, so it may not exist yet when this event arrives; GET /invoices/{invoice}/download waits up to 20 seconds for it. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [invoice.deleted](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceDeleted/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceDeleted.md)): Sent when a finalized invoice is deleted. The payload contains only the id of the deleted invoice. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [invoice.updated](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceUpdated/) ([Markdown](https://docs.fsaskaita.lt/reference/invoices/webhookInvoiceUpdated.md)): Sent when an invoice is replaced, when its payment status changes (including a Stripe payment), or after any other save. Each event is attempted up to 3 times: the first delivery, then retries after 10 s and 100 s; only a 2xx response counts as success. The request times out after 10 seconds. - [Get the business profile](https://docs.fsaskaita.lt/reference/profile/getProfile/) ([Markdown](https://docs.fsaskaita.lt/reference/profile/getProfile.md)): Returns the business the token is scoped to. Companies include company_name and company_code; individual activities include first_name, last_name and individual_activity_id. ## Spec - [OpenAPI](https://docs.fsaskaita.lt/openapi.json): The OpenAPI specification for the F-sąskaita API. ## Prompt - [Instructions for agents](https://docs.fsaskaita.lt/agents/prompt.md): Ready-to-paste instructions for a coding agent implementing invoicing with the API.