Contents
On this page
Place Purchase Order - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/purchase-orders/{id}/order
Mark a draft as sent to the supplier.
Needs a user with the plugixa_pos_purchase capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Unlike the other capabilities, Pro gives this one to administrators and to the WooCommerce Shop manager role.
Request
POST https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/4/order
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The purchase order’s id |
Responses
200 OK. data is the order with status ordered.
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
No purchase order with that id. |
409 |
plugixa_pos_po_status |
The order cannot do that in its current state. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/4/order" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/purchase-orders/4/order');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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/purchase-orders/4/order', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share