Contents
On this page

Note Service Booking - Plugixa PDF Vouchers for WooCommerce

POST /plugixa-pdf-vouchers/v1/vouchers/{id}/booking

Note when the customer comes, like Booked for on the voucher page. This is a note for your staff: nothing is sent and no calendar is kept.

Needs a user with the plugixa_pdfv_edit 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

POST https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/booking

Path parameters

Name Type Description
id integer The voucher’s id

Request body

Content type: application/json

Field Type Required Description
when string Yes YYYY-MM-DD or YYYY-MM-DDTHH:MM, in your store’s local time as typed. Empty clears the booking.
{
  "when": "2026-11-27T18:30"
}

Responses

200 OK. data is the voucher; the booking is in service.booking and meta.booking.

{
  "success": true,
  "data": {
    "id": 31,
    "code": "PX-8RTW-Q2HN",
    "code_norm": "PX8RTWQ2HN",
    "kind": "spv",
    "status": "active",
    "currency": "EUR",
    "initial_amount": 60,
    "balance": 48,
    "uses_allowed": 5,
    "uses_count": 1,
    "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:02:18",
    "version": 4,
    "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": 1,
      "left": 4,
      "session_value": 12,
      "booking": "2026-11-27T18:30"
    }
  }
}

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_invalid_date Enter a valid date.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/booking" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"when":"2026-11-27T18:30"}'
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/vouchers/31/booking');
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([
        'when' => '2026-11-27T18:30',
    ]),
]);
$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/booking', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ when: '2026-11-27T18:30' }),
});
const { data } = await response.json();

Quick Links

Share