Contents
Look Up Gift Card - Plugixa POS for WooCommerce
GET /plugixa-pos/v1/gift-cards/lookup
Read a card’s balance before taking it as payment. Dashes and case in the code do not matter.
Needs a user with the plugixa_pos_sell capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators hold it; other roles only when you grant it.
Request
GET https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/lookup?code=GC-VU3P-HWK7-6BAB
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
code |
string |
Yes | The card code, 4 to 40 characters. |
Responses
200 OK.
{
"success": true,
"data": {
"code": "GC-VU3P-HWK7-6BAB",
"balance": "50.00",
"status": "active",
"expires_at": null,
"expired": false
}
}
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No card with this code (code plugixa_pos_gift_card_unknown). |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/lookup?code=GC-VU3P-HWK7-6BAB" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/lookup?code=GC-VU3P-HWK7-6BAB');
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-site.example/wp-json/plugixa-pos/v1/gift-cards/lookup?code=GC-VU3P-HWK7-6BAB', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share