Contents
Get Currency Rules - Plugixa Multi Currency for WooCommerce
GET /plugixa-multi-currency/v1/pro/currencies/{code}/extras
The Pro rules for panel of a currency: its charm pricing, the payment methods offered in it and its order limits. See Charm pricing and Payment methods and order limits.
Needs a user with the plugixa_multi_currency_view 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
GET https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/currencies/EUR/extras
Path parameters
| Name | Type | Description |
|---|---|---|
code |
string |
The currency’s ISO code, any case |
Responses
200 OK.
{
"success": true,
"data": {
"charm": "0.99",
"charm_mode": "nearest",
"charm_bands": [
{
"from": "100",
"ending": "9"
}
],
"charm_shipping": false,
"charm_fee": false,
"gateways": ["bacs", "cod"],
"min_order": "20",
"max_order": ""
}
}
| Field | Type | Meaning |
|---|---|---|
charm |
string |
The price ending, for example 0.99, 9.90 or 990. Empty for none |
charm_mode |
string |
nearest, up or down |
charm_bands |
object[] |
Up to 10 price bands, each from (a price in this currency) and ending (empty for no ending from that price up), sorted by from |
charm_shipping |
boolean |
Also apply the ending to shipping costs |
charm_fee |
boolean |
Also apply the ending to fees |
gateways |
string[] |
Payment method ids offered in this currency. Empty offers all of them |
min_order |
string |
Smallest cart subtotal accepted in this currency, empty for none |
max_order |
string |
Largest cart subtotal accepted in this currency, empty for none |
A currency with no rules saved answers the defaults: no ending, nearest, every payment method, no limits. So does a code that is not in your list.
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 "https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/currencies/EUR/extras" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/currencies/EUR/extras');
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-multi-currency/v1/pro/currencies/EUR/extras', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share