Contents
On this page

List Store Stock - Plugixa POS for WooCommerce

GET /plugixa-pos/v1/outlet-stock

Products, one row per simple product or variation, with the stock of each store and any store price.

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

GET https://your-site.example/wp-json/plugixa-pos/v1/outlet-stock?search=tote&per_page=1

Query parameters

Field Type Required Description
search string No Words to look for.
page integer No Page to return, from 1. Defaults to 1.
per_page integer No Rows per page, 1 to 100. Defaults to 25.

Paging counts parent products, so a page holds more rows when it has variable products.

Responses

200 OK.

{
  "success": true,
  "data": [
    {
      "id": 3801,
      "name": "Canvas tote - Natural",
      "sku": "ACC-TOTE-NAT",
      "price": "25",
      "manage_stock": true,
      "total": 32,
      "stock": {
        "1": 21,
        "2": 11
      },
      "prices": {}
    },
    {
      "id": 3802,
      "name": "Canvas tote - Black",
      "sku": "ACC-TOTE-BLA",
      "price": "25",
      "manage_stock": true,
      "total": 45,
      "stock": {
        "1": 30,
        "2": 15
      },
      "prices": {}
    }
  ],
  "meta": {
    "total": 1,
    "pages": 1,
    "outlets": [
      {
        "id": 1,
        "name": "Maison Plugixa Marais"
      },
      {
        "id": 2,
        "name": "Maison Plugixa Lyon"
      }
    ],
    "home": 1
  }
}
Field Type Meaning
data[].total integer|null WooCommerce stock, the sum of the stores
data[].stock object Quantity per store id
data[].prices object Store prices per store id: regular, sale
meta.outlets object[] Active stores
meta.home integer The store that holds stock not assigned elsewhere

Errors

This endpoint has no errors of its own.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-pos/v1/outlet-stock?search=tote&per_page=1" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/outlet-stock?search=tote&per_page=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/outlet-stock?search=tote&per_page=1', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share