Contents
On this page
Assign Stripe Reader - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/stripe-terminal/registers/{id}
Choose the reader a register uses.
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/stripe-terminal/registers/1
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The register’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
reader_id |
string |
Yes | A reader id tmr_... from your account, or an empty string to unlink. |
{
"reader_id": "tmr_GvfNXw1Yfn6yE9"
}
Responses
200 OK. data is the setup, as in Get Stripe Terminal Setup.
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_pos_stripe_reader |
The reader is not in your Stripe account. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/stripe-terminal/registers/1" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"reader_id":"tmr_GvfNXw1Yfn6yE9"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/stripe-terminal/registers/1');
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([
'reader_id' => 'tmr_GvfNXw1Yfn6yE9',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/stripe-terminal/registers/1', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ reader_id: 'tmr_GvfNXw1Yfn6yE9' }),
});
const { data } = await response.json();
Quick Links
Share