Contents
Get Settings - Plugixa PDF Vouchers for WooCommerce
GET /plugixa-pdf-vouchers/v1/settings
Every setting of the Settings screen, plus the lists the plugin’s screens choose from.
Needs a user with the plugixa_pdfv_view 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.
Request
GET https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/settings
Responses
200 OK.
{
"success": true,
"data": {
"settings": {
"currency": "USD",
"currency_position": "before",
"currency_decimals": 2,
"decimal_places": 2,
"decimal_separator": ".",
"thousands_separator": ",",
"date_format": "Y-m-d",
"records_per_page": 50,
"delete_data_on_uninstall": false,
"code_pattern": "PX-####-####",
"issue_status": "processing",
"default_expiry_days": 365,
"hold_minutes": 60,
"vouchers_buy_vouchers": false,
"email_copy_to_buyer": true,
"balance_rate_limit": 10,
"default_template_id": 0,
"campaigns": [],
"template_by_locale": [],
"vendor_redeem_any": false,
"reminder_days": "30,7",
"verify_threshold": 0
},
"choices": {
"currencies": ["USD", "EUR", "GBP"],
"currency_positions": ["before", "after"],
"date_formats": ["Y-m-d", "d/m/Y", "m/d/Y"],
"separators": [".", ",", " ", "'"],
"site_timezone": "+00:00",
"languages": [
{
"value": "en_US",
"label": "English (United States)"
},
{
"value": "fr_FR",
"label": "Français (France)"
}
]
}
}
}
| Field | Type | Meaning |
|---|---|---|
code_pattern |
string |
Each # becomes a random letter or digit, at least 7. Capital letters, digits and dashes, 4 to 40 characters. An invalid pattern saves the default PX-####-#### |
issue_status |
string |
processing (paid) or completed: when vouchers are created |
default_expiry_days |
integer |
0 to 3650, 0 never expires |
hold_minutes |
integer |
10 to 1440: when an unpaid hold is released |
vouchers_buy_vouchers |
boolean |
Allow paying for a voucher with another voucher |
email_copy_to_buyer |
boolean |
Send the buyer a copy of gift vouchers |
balance_rate_limit |
integer |
1 to 100 balance checks per minute per visitor |
default_template_id |
integer |
The default PDF design, 0 for the design marked as default |
delete_data_on_uninstall |
boolean |
Delete every voucher when the plugin is deleted |
campaigns |
object[] |
Pro campaigns: id, name, type (bonus_percent, bonus_fixed, discount), value, start, end, min. Up to 30 |
template_by_locale |
object |
Pro languages: a design per language |
vendor_redeem_any |
boolean |
Pro marketplaces: any vendor takes any voucher |
reminder_days |
string |
Pro expiry reminders: up to three numbers, 1 to 365, comma separated |
verify_threshold |
number |
Pro large vouchers: 0 off |
choices is shortened here. The keys currency, currency_position, currency_decimals, decimal_places, decimal_separator, thousands_separator, date_format and records_per_page are general display settings of the plugin’s framework: vouchers always use the WooCommerce currency and formats. The Pro keys are present only when Pro is active.
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/settings" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/settings');
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/settings', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share