Contents
Get Sales Report - Plugixa POS for WooCommerce
GET /plugixa-pos/v1/reports/sales
The figures of the sales report for a period, from register sales.
Needs a user with the plugixa_pos_view_reports 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/reports/sales?from=2026-11-01&to=2026-11-19&outlet_id=1
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
from |
string |
Yes | First day, YYYY-MM-DD. |
to |
string |
Yes | Last day, at most 400 days after from. |
outlet_id |
integer |
No | One store. 0 (default) for all. |
Responses
200 OK.
{
"success": true,
"data": {
"from": "2026-11-13",
"to": "2026-11-19",
"currency": "EUR",
"totals": {
"sales": "1869.91",
"refunds": "79.50",
"net": "1790.41",
"tax": "285.92",
"tickets": 46,
"items": 85,
"average": "40.65",
"cost": "669.50",
"margin": "750.03",
"margin_pct": "52.8",
"uncosted": 4
},
"by_day": [
{
"date": "2026-11-13",
"net": "587.40"
},
{
"date": "2026-11-14",
"net": "709.00"
}
],
"by_hour": ["0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "0.00", "103.41", "0.00", "137.90", "123.90", "100.81", "514.89", "138.00", "454.70", "163.80", "26.00", "0.00", "27.00", "0.00", "0.00"],
"by_store": [
{
"label": "Maison Plugixa Marais",
"net": "1790.41",
"tickets": 46
}
],
"by_register": [
{
"label": "Front counter (R1)",
"net": "1222.81",
"tickets": 36
},
{
"label": "Gift corner (R2)",
"net": "567.60",
"tickets": 10
}
],
"by_cashier": [
{
"label": "Emma Laurent",
"net": "777.20",
"tickets": 20
},
{
"label": "Paul Girard",
"net": "567.60",
"tickets": 10
}
],
"by_method": [
{
"label": "Cash",
"net": "889.81",
"tickets": 0
},
{
"label": "Card (terminal)",
"net": "822.00",
"tickets": 0
}
],
"by_tax": [
{
"label": "TVA 20.0000",
"amount": "285.92"
}
],
"top_products": [
{
"name": "Minimal watch",
"sku": "ACC-WATCH",
"qty": 2,
"net": "248.34",
"cost": "120.00",
"margin": "128.34"
}
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.totals |
object |
Sales, refunds, net, tax, tickets, items, average, and with cost prices cost, margin, margin_pct; uncosted counts products sold without a cost |
data.by_day |
object[] |
Net per day |
data.by_hour |
string[] |
24 hourly totals |
data.by_store |
object[] |
Net and tickets per store |
data.by_register |
object[] |
Per register |
data.by_cashier |
object[] |
Per cashier |
data.by_method |
object[] |
Per payment method |
data.by_tax |
object[] |
Tax per rate |
data.top_products |
object[] |
Best sellers with cost and margin |
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_pos_bad_range |
from is after to. |
422 |
plugixa_pos_range_too_long |
More than 400 days. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-pos/v1/reports/sales?from=2026-11-01&to=2026-11-19&outlet_id=1" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/reports/sales?from=2026-11-01&to=2026-11-19&outlet_id=1');
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/reports/sales?from=2026-11-01&to=2026-11-19&outlet_id=1', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share