Invoices
The invoice model, invoice types, numbering and series, the create and update requests, and downloading the PDF.
An invoice in F-sąskaita is a finalized, numbered document issued by your business (the seller) to a buyer, with one or more lines (products) and optional payment options. The API only ever sees finalized invoices; drafts made in the app are invisible here.
Endpoints
/invoicesList invoicesPOST/invoicesCreate an invoiceGET/invoices/{invoice}Get an invoiceDELETE/invoices/{invoice}Delete an invoicePUT/invoices/{invoice}Replace an invoiceGET/invoices/{invoice}/downloadDownload the invoice PDFInvoice types
type | VAT | Use |
|---|---|---|
regular_invoice | no | Standard invoice for a non-VAT payer |
vat_invoice | yes | VAT invoice |
preliminary_invoice | no | Proforma |
preliminary_vat_invoice | yes | Proforma with VAT |
credit_invoice | no | Credit note |
credit_vat_invoice | yes | Credit note with VAT |
VAT types require a vat_percentage on every line and a seller VAT code. When you use your own profile as the seller, the VAT code comes from the profile.
Series and numbering
Every invoice belongs to a series, a short code such as SF, and has a number unique within that series for your business.
- Omit
invoice_numberon create and the API assigns the next number of the series. A series that does not exist yet starts at1. - Send
invoice_numberexplicitly when you manage numbering yourself. It must be unique in the series. Padded ("007") and unpadded ("7") forms are compared exactly as sent, so use one form consistently within a series. - On update, always send the current
invoice_number. An update without it assigns a fresh number from the series counter. - Responses return the number zero-padded to three digits (
"7"is returned as"007").
Create an invoice
The shortest useful request uses your own profile as the seller and prices per line:
curl -X POST https://app.fsaskaita.lt/api/invoices \
-H "Authorization: Bearer $FSASKAITA_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d @- <<'JSON'
{
"type": "vat_invoice",
"invoice_date": "2026-09-08",
"pay_until_date": "2026-09-22",
"series": "SF",
"currency": "EUR",
"language": "lt",
"use_default_seller_info": true,
"buyer": {
"type": "company",
"company_name": "Pirkėjas, UAB",
"company_code": "300000001",
"vat_code": "LT100000000011",
"address": "Konstitucijos pr. 7, Vilnius",
"email": "[email protected]"
},
"products": [
{ "name": "Konsultacija", "units": "val.", "quantity": 2, "price": 50, "vat_percentage": 21 }
],
"payment_options": [
{ "type": "bank", "bank_name": "Swedbank", "bank_account": "LT12 7300 0100 0000 0001", "swift_bic_code": "HABALT22" }
]
}
JSONKey rules:
buyer.typeiscompanyorindividual. Companies needcompany_name; individuals usefirst_nameandlast_name. Do not send company fields for an individual or personal names for a company.- Each line needs
name,units,quantityand exactly one ofprice(unit price excluding VAT),total(line total excluding VAT) ortotal_incl_vat. The server computes the others. payment_optionsentries are eithertype: "bank"withbank_accountandbank_name(plus optionalrouting_or_sort_number,swift_bic_code) ortype: "other"with afieldslist of{ "label", "value" }pairs.payment_statusdefaults tonot_paidon create and is left unchanged when omitted on update. Set"paid"to mark the invoice paid.language(lt,en,es,de,fr) decides the language of the PDF. Defaultlt.notesis free text up to 255 characters printed on the invoice.
Providing your own seller block
Set use_default_seller_info to false (or omit it) and send seller. The required seller fields depend on how your business is registered: companies send company_name and company_code; individual activity sends first_name, last_name and individual_activity_id. VAT types additionally require seller.vat_code. seller.custom_fields accepts extra { "label", "value" } pairs printed under the seller details.
The response
{
"data": {
"id": "6f1e9d2a-0b3c-4e5f-8a9b-1c2d3e4f5a6b",
"business_id": "9c1f7b2e-3a6d-4d5e-9f0a-2b7c8d9e0f11",
"invoice_type": "vat_invoice",
"series": "SF",
"invoice_number": "007",
"invoice_date": "2026-09-08",
"pay_until_date": "2026-09-22",
"language": "lt",
"subtotal": 100,
"vat": 21,
"total_incl_vat": 121,
"currency": "EUR",
"payment_status": "not_paid",
"notes": null,
"share_link": "https://app.fsaskaita.lt/invoice/share/…",
"seller": { "business_type": "small_partnership", "company_name": "Pavyzdys, MB", "…": "…", "custom_fields": [] },
"buyer": { "type": "company", "company_name": "Pirkėjas, UAB", "…": "…" },
"items": [
{ "id": "…", "name": "Konsultacija", "price": 50, "vat_percentage": 21, "quantity": 2, "units": "val." }
],
"payment_options": [
{ "type": "bank", "bank_account": "LT12 7300 0100 0000 0001", "bank_name": "Swedbank", "routing_or_sort_number": null, "swift_bic_code": "HABALT22", "fields": [] }
],
"created_at": 1757318400,
"updated_at": 1757318400
}
}share_link is a public page where the buyer can view and download the invoice without signing in. items[].price is the unit price excluding VAT; line totals are not returned.
Update an invoice
PUT /invoices/{id} takes the same body as create and replaces every part of the invoice: lines, payment options and seller block included. Read the invoice first, modify the fields you need, and send the whole document back with its invoice_number. Changing series moves the invoice and re-synchronises both series counters.
Download the PDF
curl -L https://app.fsaskaita.lt/api/invoices/$ID/download \
-H "Authorization: Bearer $FSASKAITA_TOKEN" \
-H "Accept: application/json" \
-o invoice.pdfThe response is application/pdf with a Content-Disposition: attachment file name built from the type label, series and number. If the PDF is not ready yet, the download waits up to about 20 seconds for it. There is no Content-Length header, so stream the body rather than preallocating.
Side effects to expect
- Creating or updating fires the
invoice.createdorinvoice.updatedwebhook. Deleting firesinvoice.deleted. - The buyer is saved to your client list in the app.
- API access requires the Premium plan.