Contents
On this page

List Fixed Prices - Plugixa Multi Currency for WooCommerce

GET /plugixa-multi-currency/v1/pro/prices/grid

The Fixed prices screen: products 20 at a time, sorted by name, each with the price you fixed per currency and the price conversion would give. A variable product is a group line followed by its variations. See Fixed prices.

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. The user also needs WooCommerce’s edit_products, because these routes change product prices.

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/prices/grid?search=beanie

Query parameters

Field Type Required Description
page integer No Page to return, from 1. Defaults to 1.
search string No Words to look for in product names and content, as the WordPress search does.

Responses

200 OK.

{
  "success": true,
  "data": {
    "rows": [
      {
        "id": 15,
        "parent_id": 0,
        "group": false,
        "name": "Beanie",
        "sku": "woo-beanie",
        "edit_url": "https://your-store.example/wp-admin/post.php?post=15&action=edit",
        "regular": "20",
        "sale": "18",
        "same": false,
        "prices": {
          "EUR": {
            "regular": "17.90",
            "sale": "15.90",
            "converted_regular": "18.38",
            "converted_sale": "16.54",
            "has_dates": false
          },
          "GBP": {
            "regular": "",
            "sale": "",
            "converted_regular": "15.39",
            "converted_sale": "13.85",
            "has_dates": false
          },
          "...": "..."
        }
      }
    ],
    "total": 1,
    "pages": 1,
    "currencies": [
      {
        "code": "EUR",
        "symbol": "€"
      },
      {
        "code": "GBP",
        "symbol": "£"
      },
      "..."
    ],
    "base": "USD"
  }
}
Field Type Meaning
rows[].id integer Product or variation id
rows[].parent_id integer The variable product of a variation, 0 otherwise
rows[].group boolean true for the line of a variable product, which has no prices of its own
rows[].name string The product name, or the variation’s attributes
rows[].sku string SKU
rows[].edit_url string The product’s edit screen
rows[].regular string Regular price in the store currency
rows[].sale string Sale price in the store currency
rows[].same boolean The product is excluded from conversion: it costs the same number in every currency
rows[].prices object Per currency: regular and sale you fixed (empty when none), converted_regular and converted_sale the price conversion gives, and has_dates when the sale has its own dates
total integer Products found, variations not counted
pages integer Number of pages
currencies object[] Your currencies except the store currency, with code and symbol
base string The store 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/prices/grid?search=beanie" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-multi-currency/v1/pro/prices/grid?search=beanie');
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/prices/grid?search=beanie', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share