Contents
On this page

List Payment Methods - Plugixa Multi Currency for WooCommerce

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

Every payment method WooCommerce knows, enabled or not, with the id to use in gateways of Update Currency Rules.

Needs a user with the plugixa_multi_currency_view 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/gateways

Responses

200 OK.

{
  "success": true,
  "data": [
    {
      "id": "bacs",
      "title": "Direct bank transfer",
      "enabled": true
    },
    {
      "id": "cheque",
      "title": "Check payments",
      "enabled": false
    },
    {
      "id": "cod",
      "title": "Cash on delivery",
      "enabled": true
    }
  ]
}
Field Type Meaning
id string The payment method id
title string Its name in WooCommerce settings
enabled boolean Whether it is switched on in WooCommerce

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

Quick Links

Share