Contents
Update Other Price Display - Plugixa Multi Currency for WooCommerce
PUT /plugixa-multi-currency/v1/pro/price-extras
Save the tab. Only the fields you send change. PUT and POST work the same way.
Needs a user with the plugixa_multi_currency_manage_settings capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; see Capabilities.
Note. Pro only: on the free plugin this route answers
404rest_no_route.
Request
PUT https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/price-extras
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
other_prices |
string |
No | off, list (a line under the price) or details (a collapsed box). |
currencies |
string[] |
No | Currencies to show. Empty shows all of them. |
charged_notice |
boolean |
No | For currencies charged in the store currency, say what will be charged. |
Codes that are not enabled currencies are dropped from currencies.
{
"other_prices": "list",
"currencies": ["EUR", "GBP", "JPY"]
}
Responses
200 OK. data is the tab as saved.
{
"success": true,
"data": {
"other_prices": "list",
"currencies": ["EUR", "GBP", "JPY"],
"charged_notice": true
}
}
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
rest_forbidden |
The caller lacks the capability: Sorry, 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-multi-currency/v1/pro/price-extras" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"other_prices":"list","currencies":["EUR","GBP","JPY"]}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/price-extras');
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([
'other_prices' => 'list',
'currencies' => ['EUR', 'GBP', 'JPY'],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/price-extras', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ other_prices: 'list', currencies: ['EUR', 'GBP', 'JPY'] }),
});
const { data } = await response.json();
Quick Links
Share