Contents
On this page

List Coupons - Plugixa Car Rental

GET /plugixa-car-rental/v1/coupons

List coupons, one page at a time.

Needs the Coupons app on. The user needs the plugixa_car_rental_view capability.

Request

GET https://your-site.example/wp-json/plugixa-car-rental/v1/coupons?search=winter

Query parameters

This list takes the list parameters every paged list accepts. search matches code and description. orderby accepts id, code, amount, valid_from, valid_until, status, created_at, modified_at.

Filters, as described in Filtering lists: status (in, ne, empty, not_empty), created_at and modified_at (dates).

Responses

200 OK. data is one page of coupons.

{
  "success": true,
  "data": [
    {
      "id": 7,
      "code": "WINTER10",
      "code_key": "WINTER10",
      "description": "Winter campaign",
      "discount_type": "percent",
      "amount": 10.0,
      "min_days": 2,
      "valid_from": "2026-12-01",
      "valid_until": "2027-02-28",
      "usage_limit": 100,
      "status": "published",
      "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,
      "used": 14
    }
  ],
  "meta": {
    "total": 4,
    "pages": 1
  }
}
Field Type Meaning
data[].id integer The coupon’s id
data[].code string The code as you wrote it
data[].discount_type string percent or fixed
data[].amount number Percentage, or amount off in the site’s currency
data[].used integer Confirmed bookings that used it. A cancelled booking gives its use back
data[].usage_limit integer Most uses, 0 for no limit
data[].status string published or unpublished. An unpublished code is refused
meta.total integer Coupons matching the search and filters, 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-rental/v1/coupons?search=winter" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query([
    'search' => 'winter',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/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 auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const query = new URLSearchParams({ search: 'winter' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-car-rental/v1/coupons?${query}`, {
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data, meta } = await response.json();

Quick Links

Share