Contents
On this page
Get Coupon - Plugixa Car Parking
GET /plugixa-car-parking/v1/coupons/{id}
Read one coupon, including how many times it has been redeemed.
The signed-in user needs the plugixa_carparking_view capability (read records).
Request
GET https://your-site.example/wp-json/plugixa-car-parking/v1/coupons/5
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The coupon’s id |
Responses
200 OK. data is the coupon.
{
"success": true,
"data": {
"id": 5,
"code": "WINTER10",
"type": "percent",
"amount": 10,
"usage_limit": 100,
"used_count": 12,
"usage_limit_per_user": 1,
"min_amount": 20,
"valid_from": "2026-12-01 00:00:00",
"valid_to": "2027-02-28 23:59:00",
"applies_to": { "locations": [4], "space_types": [] },
"period_type": "both",
"status": "active",
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 09:30:00",
"deleted_at": null
}
}
| Field | Type | Meaning |
|---|---|---|
data.code |
string |
What the customer types |
data.type |
string |
percent or fixed |
data.amount |
number |
Percentage off, or the amount off |
data.usage_limit |
integer|null |
Redemptions allowed in total. null or 0 means no limit |
data.used_count |
integer |
Redemptions so far |
data.usage_limit_per_user |
integer|null |
Redemptions allowed per signed-in customer |
data.min_amount |
number|null |
Minimum subtotal for the coupon to apply |
data.valid_from, data.valid_to |
string|null |
Validity window, site time zone |
data.applies_to |
object|null |
locations and space_types id lists. An empty or missing list means no limit |
data.period_type |
string |
Stored, not used in 1.2.0 |
data.status |
string |
active or inactive |
data.modified_at |
string |
UTC datetime of the last change. Send it back on an update to detect conflicts |
To check whether a code would be accepted for a given stay, the booking form uses the public coupon check.
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_not_found |
No coupon with that id, or it is in the trash. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-car-parking/v1/coupons/5" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/coupons/5');
curl_setopt_array($ch, [
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/coupons/5', {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share