Contents
On this page

Movement Types - Plugixa Inventory

GET /plugixa-inventory/v1/stock-movements/types

List the stock movement types, with the item types each accepts and the direction it moves stock.

The user needs the plugixa_inventory_view capability (administrators have every inventory capability). With Pro Roles and permissions enforcing, their role must also allow reading stock movements.

Request

GET https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/types

Responses

200 OK. data is the list of types.

{
  "success": true,
  "data": [
    {
      "value": "check_in",
      "item_types": [
        "asset"
      ],
      "increases": true,
      "needs_recipient": false
    },
    {
      "value": "check_out",
      "item_types": [
        "asset"
      ],
      "increases": false,
      "needs_recipient": true
    },
    {
      "value": "add_stock",
      "item_types": [
        "asset",
        "consumable",
        "sellable"
      ],
      "increases": true,
      "needs_recipient": false
    },
    {
      "value": "remove_stock",
      "item_types": [
        "asset",
        "consumable",
        "sellable"
      ],
      "increases": false,
      "needs_recipient": false
    }
  ]
}
Field Type Meaning
data[].value string The movement_type value
data[].item_types string[] Item types its lines may carry
data[].increases boolean Whether it adds stock
data[].needs_recipient boolean Whether finalizing needs a recipient_id

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/types" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/types');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/types', {
  headers: { 'Authorization': auth },
});
const { data } = await response.json();

Quick Links

Share