Contents
On this page

List Rate Providers - Plugixa Multi Currency for WooCommerce

GET /plugixa-multi-currency/v1/pro/rates/providers

The rate sources and how often rates update, as Settings > Rate providers shows them. See Rate providers.

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 404 rest_no_route.

Request

GET https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/rates/providers

Responses

200 OK.

{
  "success": true,
  "data": {
    "providers": [
      {
        "id": "openexchangerates",
        "label": "Open Exchange Rates",
        "enabled": false,
        "needs_key": true,
        "has_key": false,
        "signup_url": "https://openexchangerates.org/signup"
      },
      {
        "id": "fixer",
        "label": "Fixer",
        "enabled": false,
        "needs_key": true,
        "has_key": false,
        "signup_url": "https://fixer.io/signup/free"
      },
      {
        "id": "exchangerateapi",
        "label": "ExchangeRate-API",
        "enabled": false,
        "needs_key": true,
        "has_key": false,
        "signup_url": "https://www.exchangerate-api.com/"
      },
      {
        "id": "wise",
        "label": "Wise",
        "enabled": false,
        "needs_key": true,
        "has_key": false,
        "signup_url": "https://wise.com/settings/api-tokens"
      },
      {
        "id": "ecb",
        "label": "European Central Bank",
        "enabled": true,
        "needs_key": false,
        "has_key": false,
        "signup_url": ""
      },
      {
        "id": "frankfurter",
        "label": "Frankfurter (ECB mirror)",
        "enabled": true,
        "needs_key": false,
        "has_key": false,
        "signup_url": ""
      },
      {
        "id": "nbp",
        "label": "National Bank of Poland (NBP)",
        "enabled": false,
        "needs_key": false,
        "has_key": false,
        "signup_url": ""
      },
      {
        "id": "bankofcanada",
        "label": "Bank of Canada",
        "enabled": false,
        "needs_key": false,
        "has_key": false,
        "signup_url": ""
      }
    ],
    "interval": "daily",
    "encryption": true
  }
}
Field Type Meaning
providers object[] Every provider, in the order they are tried
providers[].id string openexchangerates, fixer, exchangerateapi, wise, ecb, frankfurter, nbp or bankofcanada
providers[].label string Its name
providers[].enabled boolean Whether it is used
providers[].needs_key boolean Whether it needs an API key
providers[].has_key boolean Whether a key is saved. The key itself is never sent back
providers[].signup_url string Where to get a key
interval string How often rates update: 30min, hourly, 6h, daily or weekly
encryption boolean Whether the site can encrypt saved keys

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/rates/providers" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/rates/providers');
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/rates/providers', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share