Contents
On this page

Search Customers - Plugixa POS for WooCommerce

GET /plugixa-pos/v1/customers

Find WooCommerce customers to attach to a sale. Up to 20 matches come back.

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/customers?search=camille

Query parameters

Field Type Required Description
search string Yes Words to look for, using WooCommerce’s customer search.

Responses

200 OK. data is the list of matches.

{
  "success": true,
  "data": [
    {
      "id": 88,
      "name": "Camille Martin",
      "email": "camille.martin@example.com",
      "phone": "06 10 20 31 40",
      "first_name": "Camille",
      "last_name": "Martin",
      "roles": ["customer"]
    }
  ]
}
Field Type Meaning
data[].id integer WordPress user id of the customer
data[].name string Full name, else the display name
data[].email string Email
data[].phone string Billing phone
data[].first_name string First name
data[].last_name string Last name
data[].roles string[] WordPress roles

Errors

Status Code When
400 rest_missing_callback_param search is missing.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share