Contents
List Fonts - Plugixa PDF Vouchers for WooCommerce
GET /plugixa-pdf-vouchers/v1/fonts
The fonts uploaded in Custom fonts.
Needs a user with the plugixa_pdfv_manage_settings capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers get it when the plugin is activated; see Staff access.
Note. Pro only: on the free plugin this route answers
404rest_no_route.
Request
GET https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/fonts
Responses
200 OK. An empty list when none was uploaded.
{
"success": true,
"data": [
{
"key": "custom-playfair-display",
"label": "Playfair Display",
"bold": true,
"url": "https://your-store.example/wp-content/uploads/plugixa-pdfv-fonts/custom-playfair-display.ttf"
}
]
}
| Field | Type | Meaning |
|---|---|---|
data[].key |
string |
The font key designs use, custom-... |
data[].label |
string |
Its name in font lists |
data[].bold |
boolean |
Whether a bold file was uploaded |
data[].url |
string |
The regular file |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_pdfv_forbidden |
The caller lacks the capability. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/fonts" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/fonts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/fonts', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share