Contents
On this page

Update Settings - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/settings

Save settings. Send only the keys that change. PUT works the same way.

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. Changing delete_data_on_uninstall also needs manage_options.

Request

POST https://your-site.example/wp-json/plugixa-pos/v1/settings

Request body

Content type: application/json

Field Type Required Description
(any setting) mixed No Keys as returned by Get Settings.
{
  "receipt_footer": "Exchanges within 30 days with this receipt.",
  "auto_print": true
}

Responses

200 OK. data.settings is every setting after the save.

{
  "success": true,
  "data": {
    "settings": {
      "currency": "USD",
      "currency_position": "before",
      "currency_decimals": 2,
      "decimal_places": 2,
      "decimal_separator": ".",
      "thousands_separator": ",",
      "date_format": "Y-m-d",
      "records_per_page": 50,
      "delete_data_on_uninstall": false,
      "invoice_company": "Maison Plugixa SAS",
      "invoice_prefix": "FA",
      "credit_note_prefix": "AV",
      "receipt_header": "Maison Plugixa\n12 rue des Archives, 75004 Paris",
      "receipt_footer": "Exchanges within 30 days with this receipt.",
      "auto_print": true,
      "require_customer": false,
      "email_receipts": false,
      "fiscal_year_end": 12
    }
  }
}

Errors

Status Code When
401 / 403 plugixa_pos_forbidden The caller lacks the capability, or changes delete_data_on_uninstall without manage_options.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/settings" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"receipt_footer":"Exchanges within 30 days with this receipt.","auto_print":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/settings');
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([
        'receipt_footer' => 'Exchanges within 30 days with this receipt.',
        'auto_print'     => true,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/settings', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ receipt_footer: 'Exchanges within 30 days with this receipt.', auto_print: true }),
});
const { data } = await response.json();

Quick Links

Share