Contents
On this page
Use Service Session - Plugixa PDF Vouchers for WooCommerce
POST /plugixa-pdf-vouchers/v1/vouchers/{id}/session
Mark one session of a service voucher as used, like Use 1 session on the voucher page. It redeems the next session’s share of what is left (the last session takes the rest) with the note Session 2 of 5. After the last session the voucher is used up.
Needs a user with the plugixa_pdfv_redeem 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. The Pro Voucher staff role has it.
Note. Pro only: on the free plugin this route answers
404rest_no_route.
Request
POST https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/session
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The voucher’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
location |
string |
No | Which shop, for the history. |
source |
string |
No | scan marks the line as made from the scan screen. Anything else is admin. |
{
"location": "Maison Willow, studio"
}
Responses
200 OK. data is the voucher, without its history.
{
"success": true,
"data": {
"id": 31,
"code": "PX-8RTW-Q2HN",
"code_norm": "PX8RTWQ2HN",
"kind": "spv",
"status": "active",
"currency": "EUR",
"initial_amount": 60,
"balance": 36,
"uses_allowed": 5,
"uses_count": 2,
"product_id": 536,
"variation_id": 0,
"order_id": 568,
"order_item_id": 464,
"allowed_product_ids": [],
"allowed_category_ids": [],
"buyer_user_id": 0,
"buyer_email": "sophie.martin@example.com",
"recipient_name": "Chloé Dubois",
"recipient_email": "chloe.dubois@example.net",
"from_name": "Sophie",
"message": "Five yoga classes to try something new.",
"template_id": 1,
"locale": "en_US",
"vendor_id": 0,
"source": "order",
"deliver_at": null,
"delivered_at": "2026-10-24 09:12:51",
"expires_at": "2027-10-24 09:12:40",
"created_by": 0,
"created_at": "2026-10-24 09:12:40",
"updated_at": "2026-11-20 11:20:05",
"version": 5,
"batch": "",
"recipient_phone": "",
"meta": {
"booking": "2026-11-27T18:30"
},
"is_expired": false,
"order_url": "https://your-store.example/wp-admin/post.php?post=568&action=edit",
"service": {
"name": "Yoga class",
"sessions": 5,
"used": 2,
"left": 3,
"session_value": 12,
"booking": "2026-11-27T18:30"
}
}
}
| Field | Type | Meaning |
|---|---|---|
data.service.name |
string |
The service |
data.service.sessions |
integer |
Sessions sold |
data.service.used |
integer |
Sessions used |
data.service.left |
integer |
Sessions left |
data.service.session_value |
number |
What the next session is worth |
data.service.booking |
string |
The noted appointment, empty when none |
Other fields as in List Vouchers.
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. |
422 |
plugixa_pdfv_not_service |
This is not a service voucher. |
422 |
plugixa_pdfv_no_session |
No session left, or the voucher cannot be used (the reason is in the message): No sessions are left on this voucher. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/session" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"location":"Maison Willow, studio"}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/session');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'location' => 'Maison Willow, studio',
]),
]);
$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/31/session', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ location: 'Maison Willow, studio' }),
});
const { data } = await response.json();
Quick Links
Share