Contents
On this page

List Catalogue Changes - Plugixa POS for WooCommerce

GET /plugixa-pos/v1/sync/changes

The register polls this route to learn which products changed (price, stock, name) since it last looked, then fetches only those with include on List Products.

Needs a user with the plugixa_pos_sell 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/sync/changes?cursor=3974

Query parameters

Field Type Required Description
cursor integer No The last cursor you received. -1 (default) asks for the current cursor only.

Responses

200 OK.

{
  "success": true,
  "data": {
    "cursor": 3974,
    "products": [],
    "reset": false,
    "interval": 10
  }
}
Field Type Meaning
data.cursor integer The new cursor: send it next time
data.products integer[] Ids of products that changed since your cursor
data.reset boolean true when your cursor is too old: reload the whole catalogue
data.interval integer Seconds to wait before the next poll, at least 5. Change it with the plugixa_pos_sync_interval filter

The answer is sent with Cache-Control: no-store.

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

Quick Links

Share