Pobierz PDF faktury
GET
/invoices/{id}/pdf
Pobiera plik PDF wybranej faktury. Wymaga uwierzytelnienia; zwraca wyłącznie dokumenty należące do uwierzytelnionego użytkownika.
Authorizations
Dział zatytułowany „Authorizations ”Parameters
Dział zatytułowany „ Parameters ”Path Parameters
Dział zatytułowany „Path Parameters ” id
required
Document ID
integer
Identyfikator faktury
Responses
Dział zatytułowany „ Responses ”Invoice PDF file
Media type application/pdf
string format: binary
Identyfikator klienta lub klucz API nie jest aktywny albo jest nieprawidłowy!
Konto nie jest aktywowane. Poczekaj lub skontaktuj się z pomocą techniczną!
Nie znaleziono zasobu
Adres IP został tymczasowo zablokowany, ponieważ w krótkim czasie wysłano z niego wiele żądań z nieprawidłowymi danymi uwierzytelniającymi. Poczekaj i spróbuj ponownie później.
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')