Contents
On this page

Get Merchant Feed - Plugixa Multi Currency for WooCommerce

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

The Google Merchant feed settings and the feed address of each currency. See Google Merchant feed.

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

Responses

200 OK.

{
  "success": true,
  "data": {
    "enabled": true,
    "currencies": ["EUR", "GBP"],
    "eligible": ["USD", "EUR", "GBP", "CAD", "AUD", "JPY", "CHF", "INR"],
    "display_only": [],
    "urls": {
      "EUR": "https://your-store.example/?pmc_feed=google&currency=eur&key=YOUR_FEED_KEY",
      "GBP": "https://your-store.example/?pmc_feed=google&currency=gbp&key=YOUR_FEED_KEY"
    },
    "currency_urls": true
  }
}
Field Type Meaning
enabled boolean The feed on or off
currencies string[] Currencies with a feed
eligible string[] Currencies that can have one: those charged in their own currency
display_only string[] Currencies shown but charged in the store currency, which cannot have a feed
urls object Currency to its feed address. The key in it is secret
currency_urls boolean Whether currency URLs are on, so product links in the feed open in the right 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/feed" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/feed');
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/feed', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share