Contents
Get Voucher - Plugixa PDF Vouchers for WooCommerce
GET /plugixa-pdf-vouchers/v1/vouchers/{id}
One voucher with every line of its history, its email (and Pro text message) log and a link to its PDF. See Voucher details and history.
Needs a user with the plugixa_pdfv_view 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.
Request
GET https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/26
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The voucher’s id |
Responses
200 OK.
The voucher fields are those of List Vouchers, plus:
{
"success": true,
"data": {
"id": 26,
"code": "PX-GHMR-PKT5",
"code_norm": "PXGHMRPKT5",
"kind": "mpv",
"status": "active",
"currency": "EUR",
"initial_amount": 150,
"balance": 56,
"uses_allowed": 0,
"uses_count": 3,
"product_id": 534,
"variation_id": 0,
"order_id": 563,
"order_item_id": 459,
"allowed_product_ids": [],
"allowed_category_ids": [],
"buyer_user_id": 65,
"buyer_email": "lea.fontaine@example.com",
"recipient_name": "Nadia Benali",
"recipient_email": "nadia.benali@example.net",
"from_name": "Léa",
"message": "For the best mum in the world. Bonne fête des mères !",
"template_id": 3,
"locale": "en_US",
"vendor_id": 0,
"source": "order",
"deliver_at": null,
"delivered_at": "2026-10-21 12:39:57",
"expires_at": "2027-10-21 12:39:17",
"created_by": 0,
"created_at": "2026-10-21 12:39:17",
"updated_at": "2026-11-19 16:12:33",
"version": 6,
"batch": "",
"recipient_phone": "",
"meta": [],
"is_expired": false,
"order_url": "https://your-store.example/wp-admin/post.php?post=563&action=edit",
"service": null,
"transactions": [
{
"id": 26,
"voucher_id": 26,
"type": "issue",
"amount": 100,
"balance_after": 100,
"order_id": 563,
"ref_id": 0,
"actor_user_id": 1,
"source": "order",
"location": "",
"note": "",
"meta": null,
"created_at": "2026-10-21 12:39:17"
},
{
"id": 95,
"voucher_id": 26,
"type": "redeem",
"amount": -46,
"balance_after": 54,
"order_id": 611,
"ref_id": 0,
"actor_user_id": 0,
"source": "order",
"location": "",
"note": "",
"meta": null,
"created_at": "2026-10-27 12:39:17"
},
{
"id": 96,
"voucher_id": 26,
"type": "redeem",
"amount": -16,
"balance_after": 38,
"order_id": 0,
"ref_id": 0,
"actor_user_id": 1,
"source": "scan",
"location": "Paris · Le Marais",
"note": "",
"meta": null,
"created_at": "2026-10-30 12:39:17"
},
{
"id": 97,
"voucher_id": 26,
"type": "redeem",
"amount": -32,
"balance_after": 6,
"order_id": 612,
"ref_id": 0,
"actor_user_id": 0,
"source": "order",
"location": "",
"note": "",
"meta": null,
"created_at": "2026-11-17 12:39:17"
},
{
"id": 146,
"voucher_id": 26,
"type": "topup",
"amount": 50,
"balance_after": 56,
"order_id": 0,
"ref_id": 0,
"actor_user_id": 1,
"source": "topup",
"location": "",
"note": "Topped up by the buyer.",
"meta": null,
"created_at": "2026-11-18 16:11:43"
}
],
"deliveries": [
{
"id": "26",
"channel": "email",
"recipient": "nadia.benali@example.net",
"status": "sent",
"last_error": "",
"sent_at": "2026-10-21 12:39:22",
"created_at": "2026-10-21 12:39:22"
}
],
"pdf_url": "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/pdf/26?expires=1795179133&sig=3526abd1d39101d6e51be3adadd7b17d97daea63af778a5b598a41f3000b8152&inline=1"
}
}
| Field | Type | Meaning |
|---|---|---|
data.transactions |
object[] |
The history, oldest first. Fields below |
data.deliveries |
object[] |
Every email or text message, newest first: channel (email, sms, whatsapp, or reminder-30 and the like with Pro reminders), recipient, status (sent, failed, skipped), last_error, sent_at, created_at |
data.pdf_url |
string |
A signed link to the PDF, opened in the browser (inline=1). See Download Voucher PDF |
Each history line:
| Field | Type | Meaning |
|---|---|---|
id |
integer |
The line’s id |
type |
string |
issue, topup, hold, release, redeem, refund, adjust, expire or void |
amount |
number |
Positive for money added, negative for money taken off |
balance_after |
number |
The balance after this line |
order_id |
integer |
The order involved, 0 when none |
ref_id |
integer |
The line this one answers, for example the hold a redemption settles |
actor_user_id |
integer |
The user who made the change, 0 for the system or a customer |
source |
string |
order, admin, scan, pos, topup, system and so on |
location |
string |
The shop or till, when one was given |
note |
string |
The reason or note |
created_at |
string |
UTC |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_pdfv_forbidden |
The caller lacks the capability. |
404 |
plugixa_pdfv_not_found |
No voucher with that id: Voucher not found. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/26" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/26');
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-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/26', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share