Contents
On this page

Download Invoice PDF - Plugixa Car Rental

GET /plugixa-car-rental/v1/bookings/{id}/invoice/pdf

Download a booking’s invoice as a PDF file.

Needs Plugixa Car Rental Pro with the PDF invoices app on. The user needs the plugixa_car_rental_view capability. The PDF invoices app needs the Invoices app.

The invoice must have been issued first: see Issue Invoice.

Request

GET https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice/pdf

Path parameters

Name Type Description
id integer The booking’s id

Responses

200 OK. The body is the PDF itself, not JSON.

Headers: Content-Type: application/pdf, Content-Disposition: inline; filename="invoice-INV-2026-00007.pdf" (the invoice number), and Cache-Control: private, no-store.

Errors

Status Code When
404 plugixa_car_rental_not_found The booking has no invoice, or is not a booking.
500 plugixa_car_rental_no_pdf The PDF engine is missing from the Pro plugin.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice/pdf" \
  -u "admin:$WP_APP_PASSWORD" \
  -o invoice-INV-2026-00007.pdf
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice/pdf');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
file_put_contents('invoice-INV-2026-00007.pdf', curl_exec($ch));
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice/pdf', {
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const pdf = await response.blob();

Quick Links

Share