# F-sąskaita Developers > Public API documentation for integrators and AI agents. ## Pages - [F-sąskaita API](https://docs.fsaskaita.lt/llms.mdx/en/index/content.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/llms.mdx/en/agents/content.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/llms.mdx/en/changelog/content.md): Updates to the Public API and the details that matter to your integration. - [Authentication](https://docs.fsaskaita.lt/llms.mdx/en/guides/authentication/content.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/llms.mdx/en/guides/conventions/content.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/llms.mdx/en/guides/expenses/content.md): Record purchase documents with their file, update them, replace the file, and download the original. - [Invoices](https://docs.fsaskaita.lt/llms.mdx/en/guides/invoices/content.md): The invoice model, invoice types, numbering and series, the create and update requests, and downloading the PDF. - [Webhooks](https://docs.fsaskaita.lt/llms.mdx/en/guides/webhooks/content.md): Subscribe an HTTPS endpoint to invoice and expense events, verify the HMAC-SHA256 signature, and handle retries. - [Reference](https://docs.fsaskaita.lt/llms.mdx/en/reference/content.md): Every Public API operation, request and response, in one place. - [List currencies](https://docs.fsaskaita.lt/llms.mdx/en/reference/currencies/listCurrencies/content.md): Returns every accepted currency code. Not paginated. - [Create an expense](https://docs.fsaskaita.lt/llms.mdx/en/reference/expenses/createExpense/content.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/llms.mdx/en/reference/expenses/deleteExpense/content.md): Deletes the expense and its file. Fires the expense.deleted webhook. - [Download the expense file](https://docs.fsaskaita.lt/llms.mdx/en/reference/expenses/downloadExpenseFile/content.md): Streams the stored file under its original name. Content-Length is not sent. - [Get an expense](https://docs.fsaskaita.lt/llms.mdx/en/reference/expenses/getExpense/content.md): - [List expenses](https://docs.fsaskaita.lt/llms.mdx/en/reference/expenses/listExpenses/content.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/llms.mdx/en/reference/expenses/replaceExpenseFile/content.md): Replaces only the stored file; every other field is kept. Fires the expense.updated webhook. - [Replace an expense](https://docs.fsaskaita.lt/llms.mdx/en/reference/expenses/updateExpense/content.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/llms.mdx/en/reference/expenses/webhookExpenseCreated/content.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/llms.mdx/en/reference/expenses/webhookExpenseDeleted/content.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/llms.mdx/en/reference/expenses/webhookExpenseUpdated/content.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/llms.mdx/en/reference/invoices/createInvoice/content.md): Creates a finalized invoice and queues its PDF. Fires the invoice.created webhook. - [Delete an invoice](https://docs.fsaskaita.lt/llms.mdx/en/reference/invoices/deleteInvoice/content.md): Deletes the invoice together with its PDF, items, payment options and e-mail logs, and recalculates the series counter. Fires the invoice.deleted webhook. - [Download the invoice PDF](https://docs.fsaskaita.lt/llms.mdx/en/reference/invoices/downloadInvoicePdf/content.md): Streams the invoice PDF. The PDF is rendered asynchronously after create and update; if it does not exist yet the request waits for it for up to 20 seconds and then fails with 500. Content-Length is not sent. - [Get an invoice](https://docs.fsaskaita.lt/llms.mdx/en/reference/invoices/getInvoice/content.md): - [List invoices](https://docs.fsaskaita.lt/llms.mdx/en/reference/invoices/listInvoices/content.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/llms.mdx/en/reference/invoices/updateInvoice/content.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/llms.mdx/en/reference/invoices/webhookInvoiceCreated/content.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 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/llms.mdx/en/reference/invoices/webhookInvoiceDeleted/content.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/llms.mdx/en/reference/invoices/webhookInvoiceUpdated/content.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/llms.mdx/en/reference/profile/getProfile/content.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.