Contents
On this page
Save Pay by Link Provider - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/pay-links/providers/{provider}
Save a provider’s settings and switch it on or off.
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/pay-links/providers/mollie
Path parameters
| Name | Type | Description |
|---|---|---|
provider |
string |
stripe, paypal, mollie, adyen or klarna |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
enabled |
boolean |
No | On or off. Left out, unchanged. |
settings |
object |
No | The provider’s fields by key. |
{
"enabled": true,
"settings": {
"api_key": "test_ExampleMollieKey0000000000"
}
}
Responses
200 OK. data is the list, as in Get Pay by Link Setup.
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
Unknown provider. |
422 |
plugixa_pos_link_keys |
The keys are missing or have the wrong form. The message says which. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/pay-links/providers/mollie" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"settings":{"api_key":"test_ExampleMollieKey0000000000"}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/pay-links/providers/mollie');
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([
'enabled' => true,
'settings' => [
'api_key' => 'test_ExampleMollieKey0000000000',
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/pay-links/providers/mollie', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: true, settings: { api_key: 'test_ExampleMollieKey0000000000' } }),
});
const { data } = await response.json();
Quick Links
Share