Contents
On this page
Get Invoice - Plugixa Car Rental
GET /plugixa-car-rental/v1/bookings/{id}/invoice
Read the invoice issued for a booking, if there is one.
Needs the Invoices app on. The user needs the plugixa_car_rental_view capability.
Note. A booking without an invoice answers
200withdataset tonull, and so does an id that is not a booking at all.
Request
GET https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The booking’s id |
Responses
200 OK. data is the invoice, or null.
{
"success": true,
"data": {
"id": 7,
"number": "INV-2026-00007",
"issued_at": "2026-12-04 09:20:00",
"total": 197.1,
"currency": "EUR",
"url": "https://your-site.example/wp-admin/admin-post.php?action=plugixa_car_rental_invoice&invoice=7&_wpnonce=3f9a1c2b7d"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The invoice’s id |
data.number |
string |
Invoice number: your prefix, the year and a sequence that restarts each year |
data.issued_at |
string |
UTC datetime it was issued |
data.total |
number |
The booking’s total when it was issued |
data.currency |
string |
Currency code |
data.url |
string |
Address of the printable invoice in the admin |
url opens the printable invoice in wp-admin, for a signed-in user. It carries a nonce made for the session that asked, so a link fetched by a script may not open in someone else’s browser.
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/invoice');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
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', {
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data } = await response.json();
Quick Links
Share