Contents
On this page

Write Off Lot - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/lots/{id}/write-off

Take units of a lot out of stock (expired, recalled).

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/lots/3/write-off

Path parameters

Name Type Description
id integer The lot’s id

Request body

Content type: application/json

Field Type Required Description
quantity integer|null No Units to remove. Without it, all that is left.
{
  "quantity": 4
}

Responses

200 OK. data is the lot.

{
  "success": true,
  "data": {
    "id": 3,
    "lot": "L2611-A",
    "expiry": "2027-05-31",
    "days_left": 193,
    "expired": false,
    "quantity": 20,
    "outlet_id": 1,
    "product": {
      "id": 3734,
      "name": "Ceremonial matcha 30 g",
      "sku": "TEA-MATCHA"
    },
    "updated_at": "2026-11-19 16:30:00"
  }
}

Errors

Status Code When
404 plugixa_pos_not_found No lot with that id.
409 plugixa_pos_invalid The lot has no units left.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/lots/3/write-off" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"quantity":4}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/lots/3/write-off');
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([
        'quantity' => 4,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/lots/3/write-off', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ quantity: 4 }),
});
const { data } = await response.json();

Quick Links

Share