Contents
On this page

List Payment Methods - Plugixa Car Wash

GET /plugixa-carwash/v1/payments/methods

List every payment method the plugin knows, which ones are switched on, and how long an online payment may take.

Needs the plugixa_carwash_view capability.

Request

GET https://your-site.example/wp-json/plugixa-carwash/v1/payments/methods

Responses

200 OK.

{
  "success": true,
  "data": {
    "methods": [
      {
        "id": "cash",
        "label": "Pay at the wash",
        "description": "Pay by card or cash when you arrive.",
        "online": false
      },
      {
        "id": "bank_transfer",
        "label": "Bank transfer",
        "description": "",
        "online": false
      }
    ],
    "enabled": [
      "cash"
    ],
    "hold": 30
  }
}
Field Type Meaning
data.methods[].id string The id to send as payment_method
data.methods[].label string The name customers see
data.methods[].description string The text under it. For a bank transfer, your payment instructions
data.methods[].online boolean Paid online: a booking made with it waits on hold until paid
data.enabled array The ids switched on in Settings. Never empty: cash when nothing is chosen
data.hold integer Minutes an unpaid online booking is held before it is cancelled

With Plugixa Car Wash Pro and the Stripe payments app on, stripe is added as an online method. See Stripe.

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-carwash/v1/payments/methods" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/payments/methods');
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-carwash/v1/payments/methods', {
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share