Contents
On this page
List Coupons - Plugixa Car Parking
GET /plugixa-car-parking/v1/coupons
List the discount coupons, one page at a time.
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?status__in=active&orderby=valid_to&order=asc
Query parameters
Takes the list parameters every paged list accepts. search matches the code. orderby accepts id, code, type, amount, used_count, status, valid_to, created_at and modified_at.
Filters on this list:
| Filter field | Type | Example |
|---|---|---|
status |
Choice: active, inactive |
status__in=active |
type |
Choice: percent, fixed |
type__in=fixed |
valid_to |
Date | valid_to__lt=2026-12-31 |
created_at |
Date (UTC) | created_at__gte=2026-11-01 |
modified_at |
Date (UTC) | modified_at__gte=2026-11-01 |
Responses
200 OK. data is one page of coupons.
{
"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
}
],
"meta": { "total": 3, "pages": 1 }
}
| Field | Type | Meaning |
|---|---|---|
data[].code |
string |
What the customer types. Unique across the site, trashed coupons included |
data[].type |
string |
percent or fixed |
data[].amount |
number |
Percentage off, or the amount off in the site’s currency |
data[].usage_limit |
integer|null |
Redemptions allowed in total, null for 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, in the site’s own time zone |
data[].applies_to |
object|null |
Location and space type ids the coupon is limited to. An empty or missing list means no limit |
data[].status |
string |
active or inactive |
meta.total |
integer |
Coupons matching, before paging |
meta.pages |
integer |
Number of pages at this per_page |
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-car-parking/v1/coupons?status__in=active&orderby=valid_to&order=asc" \
-u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query(['status__in' => 'active', 'orderby' => 'valid_to', 'order' => 'asc']);
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/coupons?' . $query);
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 query = new URLSearchParams({ status__in: 'active', orderby: 'valid_to', order: 'asc' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-car-parking/v1/coupons?${query}`, {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data, meta } = await response.json();
Quick Links
Share