Contents
On this page

Get Settings - Plugixa Chauffeur

GET /plugixa-chauffeur/v1/settings

Read every setting, with the default filled in for any key never saved.

Needs the WordPress manage_options capability (an administrator). The chauffeur capabilities are not enough.

Request

GET https://your-site.example/wp-json/plugixa-chauffeur/v1/settings

Responses

200 OK. data is the settings.

{
  "success": true,
  "message": "",
  "data": {
    "items_per_page": 20,
    "currency": "EUR",
    "currency_position": "left",
    "distance_unit": "km",
    "date_format": "M j, Y",
    "time_format": "H:i",
    "first_day_of_week": 1,
    "google_maps_api_key": "AIzaSyExampleKey123",
    "default_booking_status": "pending",
    "payment_cash_enabled": true,
    "payment_cash_label": "",
    "payment_cash_instructions": "Please pay the driver in cash at pickup.",
    "payment_wire_enabled": false,
    "payment_wire_label": "",
    "payment_wire_instructions": "",
    "payment_pickup_enabled": true,
    "payment_pickup_label": "",
    "payment_pickup_instructions": "You can pay by card to the driver at pickup.",
    "payment_stripe_enabled": true,
    "stripe_publishable_key": "pk_live_51ExampleKey",
    "stripe_secret_key": "",
    "stripe_webhook_secret": "",
    "email_enabled": true,
    "email_from_name": "Riviera Chauffeurs",
    "email_from_address": "bookings@your-site.example",
    "email_admin_recipients": "dispatch@your-site.example",
    "delete_data_on_uninstall": false,
    "stripe_secret_key_set": true,
    "stripe_webhook_secret_set": true
  }
}
Field Type Meaning
data.currency string Site currency, used when a form has none
data.distance_unit string km or mi
data.payment_*_enabled boolean Which payment methods the wizard offers. Stripe is offered only when it is enabled and a secret key is saved
data.stripe_secret_key string Always empty in a response
data.stripe_webhook_secret string Always empty in a response
data.stripe_secret_key_set boolean Whether a Stripe secret key is saved
data.stripe_webhook_secret_set boolean Whether a webhook signing secret is saved

The two Stripe secrets are never returned: they come back empty, and a _set flag says whether one is saved. The Google Maps key and the Stripe publishable key are returned as saved. With Pro, invoice_company_name, invoice_company_address, invoice_tax_number and invoice_prefix are added. Every key is described in Settings.

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-chauffeur/v1/settings" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/settings');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-chauffeur/v1/settings', {
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share