Contents
On this page

Record Payment - Plugixa Car Wash

POST /plugixa-carwash/v1/bookings/{id}/payments

Record money taken for a booking, or a refund with a negative amount. No money moves: this writes it down.

Needs the plugixa_carwash_edit capability.

Request

POST https://your-site.example/wp-json/plugixa-carwash/v1/bookings/42/payments

Path parameters

Name Type Description
id integer The booking’s id

Request body

Content type: application/json

Field Type Required Description
amount number Yes Positive for a payment, negative for a refund. Not zero.
provider string No How it was paid, as a short lowercase id. Defaults to cash.
note string No Cut to 255 characters.

After it is recorded, the booking’s payment_status is worked out again from all its payments: paid once the total is covered, partially_paid below it, refunded when everything was given back, unpaid when nothing was paid. A booking on hold that becomes fully paid is confirmed. The payment.recorded webhook PRO fires.

{
  "amount": 52.06,
  "provider": "cash",
  "note": "Paid at the desk"
}

Responses

201 Created. data is the booking’s whole payment list, the new one last.

{
  "success": true,
  "data": [
    {
      "id": 17,
      "provider": "cash",
      "amount": 52.06,
      "currency": "USD",
      "status": "paid",
      "reference": "",
      "note": "Paid at the desk",
      "created_at": "2026-11-14 16:05:00",
      "paid_at": "2026-11-14 16:05:00"
    }
  ]
}
Field Type Meaning
data[].id integer The payment’s id
data[].provider string How it was paid: cash, bank_transfer, stripe, gift_card or what you sent
data[].amount number Positive for a payment, negative for a refund
data[].currency string The booking’s currency
data[].status string paid, refunded, pending (an online payment not finished yet) or cancelled

Errors

Status Code When
404 plugixa_carwash_not_found No booking with that id, or it is in the trash.
400 rest_missing_callback_param amount is missing.
400 rest_invalid_param amount is not a number.
422 plugixa_carwash_invalid_amount amount is zero.
422 plugixa_carwash_refund_too_large A refund larger than what has been paid so far, less earlier refunds.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-carwash/v1/bookings/42/payments" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"amount":52.06,"provider":"cash","note":"Paid at the desk"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/bookings/42/payments');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'amount'   => 52.06,
        'provider' => 'cash',
        'note'     => 'Paid at the desk',
    ]),
]);
$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/bookings/42/payments', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ amount: 52.06, provider: 'cash', note: 'Paid at the desk' }),
});
const { data } = await response.json();

Quick Links

Share