Contents
Get Refundable Items - Plugixa POS for WooCommerce
GET /plugixa-pos/v1/orders/{id}/refundable
The sale’s lines with what was sold, already refunded and still refundable.
Needs a user with the plugixa_pos_refund 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/orders/4460/refundable
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The order’s id |
Responses
200 OK.
{
"success": true,
"data": {
"order_id": 4460,
"number": "4460",
"customer_id": 88,
"lines": [
{
"item_id": 8989,
"product_id": 3728,
"name": "French press 1 L",
"options": "",
"qty": 1,
"refunded": 0,
"refundable": 1,
"unit_paid": "27.00"
}
],
"paid_with": ["cash", "card"],
"remaining": "27.00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.lines[].item_id |
integer |
The order line, for lines in a return |
data.lines[].unit_paid |
string |
What one unit cost after discounts |
data.paid_with |
string[] |
Payment method ids of the sale |
data.remaining |
string |
Total not refunded yet |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
Not a register order. |
409 |
plugixa_pos_not_sold |
The order is not a completed sale. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-pos/v1/orders/4460/refundable" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/orders/4460/refundable');
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/orders/4460/refundable', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share