Contents
On this page

Update Payment Settings - Plugixa Stream

PUT /plugixa-stream/v1/admin/payments/settings

Save gateway credentials. A secret left empty keeps the saved one; clear_ and its name removes it. Secrets are stored encrypted.

Needs a user with the plugixa_stream_manage_settings capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.

Request

PUT https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/settings

Request body

Content type: application/json

Field Type Required Description
stripe_key string No Stripe secret or restricted key. Empty keeps the saved one.
stripe_webhook_secret string No The Stripe webhook signing secret. Empty keeps the saved one.
paypal_client_id string No PayPal client ID.
paypal_secret string No PayPal secret. Empty keeps the saved one.
paypal_webhook_id string No PayPal webhook ID.
paypal_sandbox boolean No PayPal sandbox mode. Defaults to true.
clear_stripe_key boolean No Remove the saved key. Also clear_stripe_webhook_secret and clear_paypal_secret.

On a server without OpenSSL, secrets cannot be stored encrypted and are saved empty.

{
  "paypal_client_id": "AbC123sandboxClientId",
  "paypal_secret": "EHx9sandboxSecret",
  "paypal_sandbox": true
}

Responses

200 OK. The settings as in Get Payment Settings.

{
  "success": true,
  "data": {
    "has_stripe_key": true,
    "stripe_mode": "test",
    "has_stripe_webhook_secret": true,
    "paypal_client_id": "AbC123sandboxClientId",
    "has_paypal_secret": true,
    "paypal_webhook_id": "4JH86294D6297924G",
    "paypal_sandbox": true,
    "stripe_webhook_url": "https://your-site.example/wp-json/plugixa-stream/v1/webhooks/stripe",
    "paypal_webhook_url": "https://your-site.example/wp-json/plugixa-stream/v1/webhooks/paypal",
    "webhooks_seen": {
      "stripe": {
        "ok": 1763368200
      }
    }
  }
}

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks the capability.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/settings" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"paypal_client_id":"AbC123sandboxClientId","paypal_secret":"EHx9sandboxSecret","paypal_sandbox":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/settings');
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([
        'paypal_client_id' => 'AbC123sandboxClientId',
        'paypal_secret'    => 'EHx9sandboxSecret',
        'paypal_sandbox'   => true,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/settings', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ paypal_client_id: 'AbC123sandboxClientId', paypal_secret: 'EHx9sandboxSecret', paypal_sandbox: true }),
});
const { data } = await response.json();

Quick Links

Share