Contents
On this page

Export Report - Plugixa PDF Vouchers for WooCommerce

GET /plugixa-pdf-vouchers/v1/reports/export

The Vouchers CSV, History CSV and Statement PDF buttons of Reports and exports.

Needs a user with the plugixa_pdfv_export capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers get it when the plugin is activated; see Staff access.

Note. Pro only: on the free plugin this route answers 404 rest_no_route.

Request

GET https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/reports/export?type=ledger&from=2026-11-01&to=2026-11-30

Query parameters

Field Type Required Description
type string No vouchers (default): vouchers created in the period. ledger: every history line of the period. statement: the liability statement PDF.
from string No YYYY-MM-DD, your store’s calendar day. Defaults to 29 days before to.
to string No YYYY-MM-DD, included. Defaults to today.

Responses

200 OK. A file, not JSON.

vouchers and ledger send text/csv; charset=utf-8 named vouchers-ledger-2026-11-01-2026-11-30.csv (or vouchers-vouchers-...), UTF-8 with a byte order mark, comma separated, every cell quoted, up to 50,000 rows. A cell that starts with =, +, -, @, a tab or a carriage return and is not a number gets a leading ', so a spreadsheet never runs it as a formula.

statement sends application/pdf named voucher-statement-2026-11-01-2026-11-30.pdf.

Columns of vouchers: id, code, type, status, currency, value, balance, recipient_name, recipient_email, buyer_email, order_id, product_id, expires_utc, created_utc.

Columns of ledger: id, date_utc, voucher_code, type, amount, balance_after, order_id, source, location, note.

Errors

Status Code When
401 / 403 plugixa_pdfv_forbidden The caller lacks the capability.
400 rest_invalid_param An unknown type, or a date not written YYYY-MM-DD.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/reports/export?type=ledger&from=2026-11-01&to=2026-11-30" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -o "vouchers-ledger-2026-11-01-2026-11-30.csv"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/reports/export?type=ledger&from=2026-11-01&to=2026-11-30');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
file_put_contents('vouchers-ledger-2026-11-01-2026-11-30.csv', curl_exec($ch));
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/reports/export?type=ledger&from=2026-11-01&to=2026-11-30', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share