Contents
On this page

Update Merchant Feed - Plugixa Multi Currency for WooCommerce

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

Save the feed settings. 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 404 rest_no_route.

Request

PUT https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/feed

Request body

Content type: application/json

Field Type Required Description
enabled boolean No The feed on or off.
currencies string[] No Currencies with a feed. Codes not in eligible are dropped.
new_key boolean No true makes a new secret key. Every old feed address stops working: update them in Merchant Center.
{
  "enabled": true,
  "currencies": ["EUR", "GBP"]
}

Responses

200 OK. data is the settings as saved, as in Get Merchant Feed.

{
  "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
  }
}

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/feed" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"currencies":["EUR","GBP"]}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/feed');
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([
        'enabled'    => true,
        'currencies' => ['EUR', 'GBP'],
    ]),
]);
$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', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ enabled: true, currencies: ['EUR', 'GBP'] }),
});
const { data } = await response.json();

Quick Links

Share