Contents
On this page

Cancel Membership - Plugixa Car Wash

POST /plugixa-carwash/v1/memberships/{id}/cancel

Cancel a membership at the end of its period, or at once. A stripe membership is cancelled at Stripe too.

Needs Plugixa Car Wash Pro with the Memberships app on, and the plugixa_carwash_edit capability.

Request

POST https://your-site.example/wp-json/plugixa-carwash/v1/memberships/14/cancel

Path parameters

Name Type Description
id integer The membership’s id

Request body

Content type: application/json

Field Type Required Description
at_period_end boolean No true (the default) keeps it working until current_period_end, then it becomes cancelled. false cancels it now.
{
  "at_period_end": true
}

Responses

200 OK. data is the membership.

{
  "success": true,
  "data": {
    "id": 14,
    "customer_id": 25,
    "plan_id": 2,
    "status": "active",
    "current_period_start": "2026-11-01",
    "current_period_end": "2026-11-30",
    "cancel_at_period_end": true,
    "provider": "manual",
    "provider_ref": "",
    "provider_customer": "",
    "notes": "",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-10 08:15:00",
    "modified_at": "2026-11-12 10:30:00",
    "deleted_at": null,
    "customer_name": "Lucas Bernard",
    "customer_email": "lucas@example.com",
    "plan_name": "Unlimited Monthly",
    "plan_color": "#6366F1",
    "washes": 0,
    "used": 3
  }
}
Field Type Meaning
data.cancel_at_period_end boolean true after a cancel at the period end
data.status string cancelled after a cancel now

Errors

Status Code When
404 plugixa_carwash_not_found No membership with that id, or it is in the trash.

For a stripe membership, an error from Stripe is passed back as it is, and nothing is changed here.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-carwash/v1/memberships/14/cancel" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"at_period_end":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/memberships/14/cancel');
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([
        'at_period_end' => true,
    ]),
]);
$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/memberships/14/cancel', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ at_period_end: true }),
});
const { data } = await response.json();

Quick Links

Share