Contents
Set PIN - Plugixa POS for WooCommerce
PUT /plugixa-pos/v1/staff/pin
Set a PIN for fast cashier switching and approvals. Your own always; someone else’s only with plugixa_pos_manage_settings, the right to edit that user, and if the user is not too powerful for a PIN. POST and PATCH work the same way.
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
PUT https://your-site.example/wp-json/plugixa-pos/v1/staff/pin
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
pin |
string |
Yes | 4 to 6 digits. |
user_id |
integer |
No | Whose PIN. Defaults to yours. |
{
"pin": "4826"
}
Responses
200 OK.
{
"success": true,
"data": {
"has_pin": true
}
}
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No such user. |
403 |
plugixa_pos_forbidden |
You may not change this PIN. |
422 |
plugixa_pos_pin_weak |
All the same digit, or digits in a row. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-pos/v1/staff/pin" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"pin":"4826"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/staff/pin');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'pin' => '4826',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/staff/pin', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ pin: '4826' }),
});
const { data } = await response.json();
Quick Links
Share