Contents
On this page
Plugixa POS and tills - Plugixa PDF Vouchers for WooCommerce
Pro lets a till take vouchers as a payment, so one voucher balance works online and in your shop. There are two ways in: Plugixa POS on the same WordPress site, or any other till, kiosk or app through the till API.
For a phone screen your staff use by hand, see Scan to redeem.
With Plugixa POS
When Plugixa POS runs on the same site, a sale can be paid with a Gift voucher payment, with the voucher code as the payment’s reference:
- The voucher is checked before the sale is accepted, and charged inside the sale itself. A voucher that cannot pay makes the whole sale fail, never half of it.
- A POS refund of that payment puts the money back on the voucher.
- Gift cards only: A product voucher is redeemed from the voucher screen, not as a payment.
Messages at the register: Enter the voucher code., This voucher code is not valid., The voucher does not have enough balance for that., and This voucher can only be used when paying in (currency).
Switch the payment on
In version 1.0.0 the Gift voucher payment is off by default: it is meant for registers
that can ask for a voucher code. To offer it, add this to your theme’s functions.php or a small
plugin:
add_filter( 'plugixa_pdfv_pos_tender', '__return_true' );
Until then, redeem vouchers at the counter with Scan to redeem or the voucher screen, and take the rest of the sale as usual.
With any other till: the till API
Any till, kiosk or app that can make HTTPS requests can check and redeem vouchers through three
endpoints under https://your-store.example/wp-json/plugixa-pdf-vouchers/v1:
| Endpoint | What it does |
|---|---|
GET /pos/balance?code=... |
What a voucher can pay now, and if not, why. |
POST /pos/redeem |
Take an amount off, with your own unique reference. |
POST /pos/refund |
Give back a redemption, in full, by its reference. |
Full details, fields and examples are in the REST API reference.
Sign in a till
Use a WordPress Application Password. It is built into WordPress and works over HTTPS only.
- Create a user for the till, for example
till-shop1, with the Voucher staff role. That role can look up and redeem vouchers and nothing else. Do not use an administrator account. - Open Users > Profile for that user, go to Application Passwords, type a name (
Till 1) and click Add New Application Password. Copy the password shown: you will not see it again. - Send it with every request as HTTP Basic authentication:
curl -u "till-shop1:abcd efgh ijkl mnop qrst uvwx" \
"https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/pos/balance?code=PX-7K2M-9QHT"
To cut a till off, revoke its password on the same screen. Other tills keep working.
Never charge twice
Every redemption carries your unique reference for the payment (4 to 64 characters: letters,
digits, ., _, : and -). If the till loses the answer and sends the same request again, the
plugin returns the first result with "replayed": true and charges nothing more. Use a new
reference for every new payment. Two copies of one request arriving at the same moment are handled
one after the other; the second may answer The same request is already being handled. Try
again.
POST /pos/refund with the same reference gives the money back, and is just as safe to repeat. An
unknown reference answers No redemption was made with this reference.
Each redemption is written to the voucher’s history with the till’s location, if you send one.
Quick Links
Share