Contents
On this page
End Monthly Plan - Plugixa Car Parking
POST /plugixa-car-parking/v1/bookings/{id}/installments/end
Stop a booking’s monthly payment plan. A fixed plan stops at once; a rolling plan stops at the end of the month already paid for.
Needs Plugixa Car Parking Pro. The user needs the plugixa_carparking_edit capability.
Note. A booking id that does not exist, or a booking in the trash, is answered with
plugixa_carparking_forbidden(401or403), not with404.
Request
POST https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57/installments/end
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The booking’s id |
Request body
None.
What happens. When the ledger holds a monthly payment from Stripe (completed or not), the plugin asks Stripe to cancel the subscription behind it:
- Fixed plan. The subscription is cancelled now and the plan is marked ended:
ended_atis set. - Rolling plan. The subscription is set to stop at the end of the period already paid. The plan is not ended yet:
ended_atstaysnull, andending_atis filled in once Stripe confirms the cancellation.
When it holds none, nothing is sent to Stripe and the plan is marked ended at once, rolling or not. A plan that has already ended is returned unchanged.
Responses
200 OK. data is the plan.
{
"success": true,
"data": {
"booking_id": 57,
"gateway": "stripe",
"kind": "fixed",
"months": 6,
"first": 128,
"monthly": 120,
"overdue_ref": null,
"ending_at": null,
"ended_at": "2026-11-12 10:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.kind |
string |
fixed or rolling |
data.ending_at |
string|null |
UTC datetime a rolling plan stops, once Stripe has confirmed it |
data.ended_at |
string|null |
UTC datetime the plan stopped; null for a rolling plan that is set to stop |
A rolling plan that is set to stop also carries paid_count, last_paid, term_ends and held_until, as on Get Monthly Plan. A plan that has ended does not.
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_no_plan |
The booking is not paid by the month. |
409 |
plugixa_carparking_gateway_missing |
The ledger holds monthly payments, but the Stripe payment method is not available. |
502 |
plugixa_carparking_plan_not_ended |
Stripe refused the cancellation. The message carries Stripe’s reason. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57/installments/end" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57/installments/end');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57/installments/end', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share