Contents
On this page

List Coupons - Plugixa Stream

GET /plugixa-stream/v1/admin/coupons

Every promo code, by code.

Needs a user with the plugixa_stream_manage_settings capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.

Request

GET https://your-site.example/wp-json/plugixa-stream/v1/admin/coupons

Responses

200 OK.

{
  "success": true,
  "data": [
    {
      "code": "SPRING20",
      "type": "percent",
      "value": 20,
      "applies": "all",
      "max_uses": 100,
      "uses": 12,
      "once_per_account": true,
      "expires": "2026-12-31"
    }
  ]
}
Field Type Meaning
data[].code string 3 to 40 letters, digits, - or _, in capitals
data[].type string percent or fixed
data[].value integer A percentage, or an amount in minor units
data[].applies string pack, vip or all
data[].max_uses integer 0 for no limit
data[].uses integer Paid orders that used it
data[].once_per_account boolean One use per account
data[].expires string Last day, Y-m-d, or empty

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks the capability.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-stream/v1/admin/coupons" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/coupons');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . 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-stream/v1/admin/coupons', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share