Contents
On this page

List Supplier Products - Plugixa POS for WooCommerce

GET /plugixa-pos/v1/suppliers/{id}/products

What you buy from this supplier and on what terms.

Needs a user with the plugixa_pos_purchase capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Unlike the other capabilities, Pro gives this one to administrators and to the WooCommerce Shop manager role.

Request

GET https://your-site.example/wp-json/plugixa-pos/v1/suppliers/2/products

Path parameters

Name Type Description
id integer The supplier’s id

Responses

200 OK.

{
  "success": true,
  "data": [
    {
      "product_id": 3745,
      "name": "Ceramic bowl",
      "sku": "KIT-BOWL",
      "supplier_sku": "",
      "cost": "4.9000",
      "pack_size": 1,
      "reorder_point": null,
      "reorder_qty": null
    }
  ]
}
Field Type Meaning
data[].cost string|null Your cost from this supplier
data[].pack_size integer Units per pack
data[].reorder_point integer|null Reorder at or below this stock
data[].reorder_qty integer|null How many to reorder

Errors

Status Code When
404 plugixa_pos_not_found No supplier with that id.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share