Contents
On this page

Receive Serial Numbers - Plugixa POS for WooCommerce

POST /plugixa-pos/v1/serials

Record the serial numbers of units received. Numbers already known are skipped.

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/serials

Request body

Content type: application/json

Field Type Required Description
product_id integer Yes A product or variation that tracks serial numbers.
serials string[] Yes 1 to 1000 numbers.
outlet_id integer No The store. Defaults to the default store.
note string No A note.
{
  "product_id": 3819,
  "serials": ["MW-2026-00418", "MW-2026-00419"],
  "outlet_id": 1
}

Responses

201 Created.

{
  "success": true,
  "data": {
    "added": 2,
    "skipped": 0
  }
}

Errors

Status Code When
404 plugixa_pos_not_found No such product (variable parents are refused), or no such store.
422 plugixa_pos_serial_untracked The product does not track serial numbers.
422 plugixa_pos_serial_twice The same number is entered twice.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/serials" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"product_id":3819,"serials":["MW-2026-00418","MW-2026-00419"],"outlet_id":1}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/serials');
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' => 3819,
        'serials'    => ['MW-2026-00418', 'MW-2026-00419'],
        'outlet_id'  => 1,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/serials', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ product_id: 3819, serials: ['MW-2026-00418', 'MW-2026-00419'], outlet_id: 1 }),
});
const { data } = await response.json();

Quick Links

Share