Contents
On this page
Update Settings - Plugixa Extra Product Options
PUT /plugixa-epo/v1/settings
Change the settings. Send only the keys that change; unknown keys are ignored. PATCH and POST work the same.
Needs a user with the plugixa_epo_manage capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers hold it; see Permissions.
Request
PUT https://your-store.example/wp-json/plugixa-epo/v1/settings
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
show_totals |
boolean |
No | Show a live total under the options. |
totals_label |
string |
No | Total label: the name of the total’s last line. Empty: Total. |
options_label |
string |
No | Title above the options. Empty: no title. |
price_suffix |
string |
No | Prices beside options: plus shows them, none hides them. |
erase_on_uninstall |
boolean |
No | Delete all option groups when the plugin is uninstalled. |
{
"totals_label": "Your price",
"price_suffix": "none"
}
Responses
200 OK. data is every setting, as stored.
{
"success": true,
"data": {
"show_totals": true,
"totals_label": "Your price",
"options_label": "Personalise your order",
"price_suffix": "none",
"erase_on_uninstall": false
}
}
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_epo_forbidden |
The caller lacks the capability: You are not allowed to do that. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-store.example/wp-json/plugixa-epo/v1/settings" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"totals_label":"Your price","price_suffix":"none"}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-epo/v1/settings');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'totals_label' => 'Your price',
'price_suffix' => 'none',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-epo/v1/settings', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ totals_label: 'Your price', price_suffix: 'none' }),
});
const { data } = await response.json();
Quick Links
Share