Download invoice PDF
GET
/invoices/{id}/pdf
Downloads the PDF file for a specific invoice. Requires authentication; only returns documents belonging to the authenticated user.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
integer
Invoice ID
Responses
Section titled “ Responses ”Invoice PDF file
Media type application/pdf
string format: binary
Client ID or API key isn’t active or invalid!
Account isn’t activated. Please wait or contact to support!
Resource not found
IP address was temporary blocked, because during short time from it was sent many request with invalid credentials. Please wait and try later.
Code Samples
curl -s 'https://api.lox24.eu/invoices/34101/pdf' -H 'X-LOX24-AUTH-TOKEN: YOUR_API_TOKEN' --output invoice.pdfusing System;using System.Net.Http;using System.Net.Http.Headers;using System.IO;using System.Threading.Tasks;
class Program{ static async Task Main() { using var client = new HttpClient(); client.DefaultRequestHeaders.Add("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN");
var response = await client.GetByteArrayAsync("https://api.lox24.eu/invoices/34101/pdf"); await File.WriteAllBytesAsync("invoice.pdf", response); Console.WriteLine("PDF saved to invoice.pdf"); }}package main
import ( "fmt" "io" "net/http" "os")
func main() { req, _ := http.NewRequest("GET", "https://api.lox24.eu/invoices/34101/pdf", nil) req.Header.Set("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN")
resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) os.WriteFile("invoice.pdf", body, 0644) fmt.Println("PDF saved to invoice.pdf")}import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.nio.file.Files;import java.nio.file.Path;
public class Main { public static void main(String[] args) throws Exception { var client = HttpClient.newHttpClient(); var request = HttpRequest.newBuilder() .uri(URI.create("https://api.lox24.eu/invoices/34101/pdf")) .header("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN") .GET() .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofByteArray()); Files.write(Path.of("invoice.pdf"), response.body()); System.out.println("PDF saved to invoice.pdf"); }}fetch('https://api.lox24.eu/invoices/34101/pdf', { headers: { 'X-LOX24-AUTH-TOKEN': 'YOUR_API_TOKEN' }}).then(res => res.blob()).then(blob => { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'invoice.pdf'; a.click();});<?php
$ch = curl_init('https://api.lox24.eu/invoices/34101/pdf');curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-LOX24-AUTH-TOKEN: YOUR_API_TOKEN']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$pdf = curl_exec($ch);curl_close($ch);
file_put_contents('invoice.pdf', $pdf);echo "PDF saved to invoice.pdf\n";import requests
response = requests.get( 'https://api.lox24.eu/invoices/34101/pdf', headers={'X-LOX24-AUTH-TOKEN': 'YOUR_API_TOKEN'})with open('invoice.pdf', 'wb') as f: f.write(response.content)print('PDF saved to invoice.pdf')