Invoices
Webhook įvykis
invoice.created
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.
2XXReturn any 2xx status to acknowledge the delivery. Any other status or a timeout schedules a retry.
- Bandymas 1: Dabar
- Bandymas 2: +10 s
- Bandymas 3: +100 s
Po 3 nesėkmių pranešimas nebesiunčiamas. Pristatymai gali kartotis ir atkeliauti ne iš eilės. Padarykite savo apdorojimo funkciją idempotentišką.
Lowercase hex HMAC-SHA256 of the raw request body, keyed with the webhook subscription's signing secret (whsec_…). Recompute it over the exact bytes received and compare with a constant-time function before trusting the payload. No timestamp or event-id header is sent.
Turinio laukai
{ event, data } · 60 laukų
eventstringVisada"invoice.created"dataInvoiceidstring (uuid)pvz.,"9c1e2d3f-4a5b-4c6d-8e7f-0a1b2c3d4e5f"business_idstring (uuid)pvz.,"3f7a1c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b"invoice_typeInvoiceTypepvz.,"vat_invoice"The three
*vat_invoicetypes requirevat_percentageon every line and, whenselleris sent,seller.vat_code.Viena išregular_invoicevat_invoicepreliminary_invoicepreliminary_vat_invoicecredit_invoicecredit_vat_invoiceseriesstringpvz.,"PVZ"invoice_numberstringpvz.,"012"Zero-padded to three digits, e.g.
"007". Send it back padded or unpadded on update; both are accepted.invoice_datestring (date)pvz.,"2026-03-02"Issue date,
Y-m-d.pay_until_datestring (date)gali būti nullpvz.,"2026-03-16"Due date,
Y-m-d.languageInvoiceLanguagepvz.,"lt"Language of the PDF and the public share page.
Viena išenltesdefrplsubtotalnumberpvz.,200Sum of the lines excluding VAT.
vatnumberpvz.,42total_incl_vatnumberpvz.,242currencystringpvz.,"EUR"payment_statusPaymentStatuspvz.,"not_paid"Viena išnot_paidpaidnotesstringgali būti nullpvz.,"Apmokėti per 14 dienų."share_linkstring (uri)pvz.,"https://beta.fsaskaita.lt/invoice/share/7e4a9b2c-3d1f-4a5e-b6c7-d8e9f0a1b2c3"Public link to the invoice; anyone with the link can view it.
sellerobjectbuyerobjectitemsarray of InvoiceItempayment_optionsarray of PaymentOptioncreated_atintegerpvz.,1772435700Unix timestamp, seconds.
updated_atintegerpvz.,1772435700Unix timestamp, seconds.
Susiję
- Pakartotiniai siuntimaiPristatymai gali atkeliauti daugiau nei vieną kartą ir ne iš eilės; padarykite apdorojimo funkciją idempotentišką.
- Patikrinkite parašąPrieš pasitikėdami turiniu, patikrinkite antraštę
Signaturepagal neapdorotą užklausos turinį. - GET/invoices/{invoice}Gaukite dabartinę būseną
- EVENTinvoice.updatedSent when an invoice is replaced, when its payment status changes (including a Stripe payment), or after any other save.
- EVENTinvoice.deletedSent when a finalized invoice is deleted.
- Webhook pranešimų gidasPrenumerata, parašo tikrinimas, pakartotiniai siuntimai
Download the invoice PDF GET
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.
invoice.updated Webhook
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.