Contents
On this page

Adjust Stock - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/stock-adjustments

Record a stock correction: either the quantity you counted (count) or units added or removed (change).

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/stock-adjustments

Request body

Content type: application/json

Field Type Required Description
product_id integer Yes A product or variation with stock management.
outlet_id integer No The store. Defaults to the home store.
mode string Yes count (the quantity is the new stock) or change (the quantity is added, negative to remove).
quantity integer Yes The count, or the change.
reason string Yes count, damaged, expired, theft, lost, internal_use, found, received or other.
note string No A note.
{
  "product_id": 3753,
  "outlet_id": 1,
  "mode": "change",
  "quantity": -2,
  "reason": "damaged",
  "note": "Dropped in the stockroom"
}

Responses

201 Created. data is the adjustment plus stock, the product’s WooCommerce stock after it.

{
  "success": true,
  "data": {
    "id": 1,
    "product_id": 3753,
    "product": "Soy candle Fig",
    "sku": "HOM-CNDL-FIG",
    "outlet_id": 1,
    "delta": -2,
    "quantity_before": 14,
    "quantity_after": 12,
    "reason": "damaged",
    "note": "Dropped in the stockroom",
    "unit_cost": "8.5000",
    "value": "-17.00",
    "user": "admin",
    "created_at": "2026-11-18T16:30:38+00:00",
    "stock": 26
  }
}

Errors

Status Code When
404 plugixa_pos_not_found No such product, or no such store.
409 plugixa_pos_not_stocked The product has no stock management.
422 plugixa_pos_invalid Unknown mode or reason, a count below zero, or a change of zero.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/stock-adjustments" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"product_id":3753,"outlet_id":1,"mode":"change","quantity":-2,"reason":"damaged","note":"Dropped in the stockroom"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/stock-adjustments');
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([
        'product_id' => 3753,
        'outlet_id'  => 1,
        'mode'       => 'change',
        'quantity'   => -2,
        'reason'     => 'damaged',
        'note'       => 'Dropped in the stockroom',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/stock-adjustments', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ product_id: 3753, outlet_id: 1, mode: 'change', quantity: -2, reason: 'damaged', note: 'Dropped in the stockroom' }),
});
const { data } = await response.json();

Quick Links

Share