Contents
On this page

Apply Cache Preset - Plugixa Multi Currency for WooCommerce

POST /plugixa-multi-currency/v1/cache-preset/{plugin}

The Use the recommended setup button: it turns on cache-first mode and empties the page cache of every cache plugin found. See Cache-first mode.

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

POST https://your-store.example/wp-json/plugixa-multi-currency/v1/cache-preset/wp-rocket

Path parameters

Name Type Description
plugin string An active cache plugin’s id from plugins of Run Cache Diagnostics, or generic for a host or CDN cache

Request body

Content type: application/json

No body.

Responses

200 OK.

{
  "success": true,
  "data": {
    "mode": "cache_first",
    "purged": ["WP Rocket"],
    "manual": ""
  }
}
Field Type Meaning
mode string Always cache_first
purged string[] The caches emptied
manual string A step left for you, for example for generic: Purge your CDN, Varnish or hosting cache once, so no page saved before this change is served. Empty when none

Errors

Status Code When
401 / 403 plugixa_multi_currency_forbidden The caller lacks the capability.
404 plugixa_multi_currency_unknown_cache This cache plugin is not active on your site.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-store.example/wp-json/plugixa-multi-currency/v1/cache-preset/wp-rocket" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/cache-preset/wp-rocket');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    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/cache-preset/wp-rocket', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share