Contents
On this page

Release Hold - Plugixa Car Rental

POST /plugixa-car-rental/v1/public/release

Give back the car a visitor is holding, for example when they go back to choose another one. A pending booking becomes expired.

Public: no sign-in and no nonce. Needs the Booking form app on. Rate limited to 30 requests an hour per visitor address: see Public routes.

The answer is the same whatever the token: an unknown token, or a booking that is no longer pending, is left alone and still answers released: true.

Request

POST https://your-site.example/wp-json/plugixa-car-rental/v1/public/release

Request body

Content type: application/json

Field Type Required Description
token string Yes The token Hold Car returned.
{
  "token": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
}

Responses

200 OK.

{
  "success": true,
  "data": {
    "released": true
  }
}
Field Type Meaning
data.released boolean Always true

Errors

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/public/release" \
  -H "Content-Type: application/json" \
  -d '{"token":"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/public/release');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'token' => 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-rental/v1/public/release', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    token: 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb',
  }),
});
const { data } = await response.json();

Quick Links

Share