Contents
On this page

Get Currency URLs - Plugixa Multi Currency for WooCommerce

GET /plugixa-multi-currency/v1/pro/seo

Whether each currency has its own address, such as /eur/shop/, and the hreflang tag of each. See Currency URLs.

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/seo

Responses

200 OK.

{
  "success": true,
  "data": {
    "enabled": true,
    "hreflang": {
      "EUR": "fr-FR",
      "GBP": "en-GB"
    },
    "example": {
      "USD": "https://your-store.example/shop/",
      "EUR": "https://your-store.example/eur/shop/",
      "GBP": "https://your-store.example/gbp/shop/",
      "...": "..."
    }
  }
}
Field Type Meaning
enabled boolean Currency URLs on or off
hreflang object Currency code to hreflang tag, for example {"EUR": "fr-FR"}
example object The shop page’s address in each currency

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

Quick Links

Share