Contents
On this page

Save Adyen Account - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/adyen-terminal/account

Save the Adyen account. The API key is stored encrypted.

Needs a user with the plugixa_pos_manage_settings capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; other roles only when you grant it.

Request

POST https://your-site.example/wp-json/plugixa-pos/v1/adyen-terminal/account

Request body

Content type: application/json

Field Type Required Description
api_key string No The API key. Empty keeps the saved one.
merchant_account string Yes Letters, digits, _ and -.
test_mode boolean No Defaults to true.
region string No eu (default), us, au or apse.
live_prefix string No Live mode: the live URL prefix from Adyen (Developers > API URLs).
{
  "merchant_account": "PlugixaECOM",
  "test_mode": true,
  "region": "eu"
}

Responses

200 OK. data is the setup, as in Get Adyen Terminal Setup.

Errors

Status Code When
422 plugixa_pos_adyen_incomplete No key or account, a malformed account, or live mode without the URL prefix.
409 plugixa_pos_adyen_auth Adyen refused the key, or it lacks the needed role.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/adyen-terminal/account" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"merchant_account":"PlugixaECOM","test_mode":true,"region":"eu"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/adyen-terminal/account');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'merchant_account' => 'PlugixaECOM',
        'test_mode'        => true,
        'region'           => 'eu',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/adyen-terminal/account', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ merchant_account: 'PlugixaECOM', test_mode: true, region: 'eu' }),
});
const { data } = await response.json();

Quick Links

Share