Contents
On this page
Confirm Stripe Payment - Plugixa Chauffeur
POST /plugixa-chauffeur/v1/public/stripe-return
Ask the plugin to check a Stripe Checkout session with Stripe and record the payment if it is paid. The booking wizard calls it when the customer comes back from Stripe.
Public: no login and no capability. The session id must belong to the booking named by ref.
Request
POST https://your-site.example/wp-json/plugixa-chauffeur/v1/public/stripe-return
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
session_id |
string |
Yes | The Stripe Checkout session id (cs_...), from the return URL. |
ref |
string |
Yes | The booking number, from the return URL. |
The session is read from Stripe with the site’s own key; nothing the caller sends is trusted beyond the two ids. When the session is paid, the booking becomes paid and moves from pending to processing. Calling it again changes nothing. This works without a webhook, so a site without a signing secret still records card payments.
{
"session_id": "cs_live_a1B2c3D4e5F6",
"ref": "PXC-20261112-0815"
}
Responses
200 OK. data.payment_status is the booking’s payment status afterwards.
{
"success": true,
"message": "",
"data": {
"payment_status": "paid"
}
}
| Field | Type | Meaning |
|---|---|---|
data.payment_status |
string |
paid once Stripe has the money. unpaid or pending while a delayed method (a bank debit) is still processing |
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
The session id does not start with cs_, Stripe does not know it, it belongs to another booking, Stripe could not be reached or no Stripe secret key is set (“Unknown payment session.” or Stripe’s message). |
400 |
rest_missing_callback_param |
session_id or ref is missing. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-chauffeur/v1/public/stripe-return" \
-H "Content-Type: application/json" \
-d '{"session_id":"cs_live_a1B2c3D4e5F6","ref":"PXC-20261112-0815"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/public/stripe-return');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'session_id' => 'cs_live_a1B2c3D4e5F6',
'ref' => 'PXC-20261112-0815',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chauffeur/v1/public/stripe-return', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ session_id: 'cs_live_a1B2c3D4e5F6', ref: 'PXC-20261112-0815' }),
});
const { data } = await response.json();
Quick Links
Share