Contents
On this page
Close Session - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/sessions/{id}/close
Close the register: send what you counted per payment method. The session is closed, the difference is recorded and a closing is written to the fiscal journal.
Needs a user with the plugixa_pos_manage_sessions 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. The user must also be allowed to use the register (register access).
Request
POST https://your-site.example/wp-json/plugixa-pos/v1/sessions/85/close
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The session’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
counted |
object |
No | Counted amount per payment method id, decimal strings: {"cash": "197.90"}. Values that are not decimal strings are ignored. |
{
"counted": {
"cash": "197.90",
"card": "280.40"
}
}
Responses
200 OK. data is the Z report.
The fields of Get Session Report, plus counted (per method, decimal strings), difference (decimal string) and closing (id, hash, grand_totals of the fiscal closing).
{
"success": true,
"data": {
"session": {
"id": 84,
"register_id": 3,
"opened_by": 101,
"closed_by": 101,
"opening_float": 15000,
"expected": {
"card": "280.40",
"cash": "197.90"
},
"counted": {
"card": "280.40",
"cash": "197.90"
},
"difference": 0,
"status": "closed",
"opened_at": "2026-11-14 08:34:00",
"closed_at": "2026-11-14 18:10:00",
"updated_at": "2026-11-14 18:10:00"
},
"currency": "EUR",
"sales_count": 7,
"refunds_count": 0,
"sales": "328.30",
"refunds": "0.00",
"net_sales": "328.30",
"tax": "54.72",
"discount": "0.00",
"opening_float": "150.00",
"cash_in": "0.00",
"cash_out": "0.00",
"payments": {
"card": "280.40",
"cash": "47.90"
},
"taxes": {
"8": {
"label": "TVA",
"rate": "20.0000",
"amount": "54.72"
}
},
"expected": {
"card": "280.40",
"cash": "197.90"
},
"deposits": {
"count": 0,
"received": "0.00",
"refunded": "0.00",
"applied": "0.00",
"tax": "0.00"
},
"foreign": [],
"counted": {
"card": "280.40",
"cash": "197.90"
},
"difference": "0.00",
"closing": {
"id": 174,
"hash": "5c2d417351623ccbaeddc1eae522fb9b9d2162a7905309412f54bb7d04938ff3",
"grand_totals": {
"refunds": "799.80",
"sales": "11655.71",
"tax": "1757.60"
}
}
}
}
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No session with that id. |
403 |
plugixa_pos_register_forbidden |
The register is missing or archived, or the user may not use it. |
409 |
plugixa_pos_session_closed |
The session is already closed. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/sessions/85/close" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"counted":{"cash":"197.90","card":"280.40"}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/sessions/85/close');
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([
'counted' => [
'cash' => '197.90',
'card' => '280.40',
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/sessions/85/close', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ counted: { cash: '197.90', card: '280.40' } }),
});
const { data } = await response.json();
Quick Links
Share