Contents
On this page
Get Payment Link Status - Plugixa POS for WooCommerce
GET /plugixa-pos/v1/pay-links/payments/{link}
Where the payment stands. A payment of a different amount than asked is reported as failed.
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. The user must also be allowed to use the register (register access).
Request
GET https://your-site.example/wp-json/plugixa-pos/v1/pay-links/payments/pl4f8a2c9e1b7d3f6a05?register_id=1
Path parameters
| Name | Type | Description |
|---|---|---|
link |
string |
The payment’s id, pl and 18 hex characters |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
register_id |
integer |
Yes | The register that started the payment. |
Responses
200 OK.
{
"success": true,
"data": {
"status": "succeeded",
"message": ""
}
}
| Field | Type | Meaning |
|---|---|---|
data.status |
string |
pending, succeeded, failed or canceled |
data.message |
string |
Why it failed or was canceled, ready to show |
Errors
| Status | Code | When |
|---|---|---|
403 |
plugixa_pos_forbidden |
The user may not use this register (this route answers with this code rather than plugixa_pos_register_forbidden). |
404 |
plugixa_pos_not_found |
Not started at this register (code plugixa_pos_link_payment). |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-pos/v1/pay-links/payments/pl4f8a2c9e1b7d3f6a05?register_id=1" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/pay-links/payments/pl4f8a2c9e1b7d3f6a05?register_id=1');
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/pay-links/payments/pl4f8a2c9e1b7d3f6a05?register_id=1', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share