Contents
On this page
Set Gift Card Expiry - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/gift-cards/{id}/expiry
Change when a card expires. An expired card cannot pay; it can still be topped up or corrected.
Needs a user with the plugixa_pos_manage_settings 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
POST https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/3/expiry
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The gift card’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
expires_at |
string |
Yes | YYYY-MM-DD, or an empty string for no expiry. |
{
"expires_at": "2027-12-31"
}
Responses
200 OK. data is the card with its ledger.
{
"success": true,
"data": {
"id": 3,
"code": "GCFB39G22VGVYD",
"display": "GC-FB39-G22V-GVYD",
"balance": "1.00",
"initial": "25.00",
"status": "active",
"customer_id": null,
"order_id": 3974,
"expires_at": "2027-12-31",
"expired": false,
"created_at": "2026-10-10 15:54:23",
"ledger": [
{
"type": "redeem",
"amount": "-24.00",
"balance_after": "1.00",
"order_id": 4050,
"note": "",
"user": "Paul Girard",
"created_at": "2026-10-16 10:49:08"
},
{
"type": "issue",
"amount": "25.00",
"balance_after": "25.00",
"order_id": 3974,
"note": "",
"user": "Emma Laurent",
"created_at": "2026-10-10 15:54:23"
}
]
}
}
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No gift card with that id. |
422 |
plugixa_pos_invalid_date |
The date is not valid. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/3/expiry" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"expires_at":"2027-12-31"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/gift-cards/3/expiry');
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([
'expires_at' => '2027-12-31',
]),
]);
$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/3/expiry', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ expires_at: '2027-12-31' }),
});
const { data } = await response.json();
Quick Links
Share