Contents
On this page
Issue Invoice - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/orders/{id}/invoice
Issue the invoice of a paid register sale. A sale has one invoice: asking again returns the existing one with 200. Refunds already made on the sale get their credit notes at the same time.
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 be allowed to use the register of the sale (register access).
Request
POST https://your-site.example/wp-json/plugixa-pos/v1/orders/4459/invoice
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The order’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
customer |
object |
No | What to print for the buyer: company, name, address, vat, email. Missing fields come from the order’s billing details. |
{
"customer": {
"company": "Atelier Lumière SARL",
"address": "4 rue de Bretagne\n75003 Paris",
"vat": "FR12345678901"
}
}
Responses
201 Created, or 200 when the sale already had an invoice.
{
"success": true,
"data": {
"id": 2,
"type": "invoice",
"number": "FA-2026-00002",
"order_id": 4459,
"refund_id": 0,
"parent_id": 0,
"customer": "Atelier Lumière SARL",
"total": "26.00",
"tax": "4.33",
"currency": "EUR",
"created_at": "2026-11-18T18:36:45+00:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The invoice’s id |
data.type |
string |
invoice or credit_note |
data.number |
string |
Number, from the invoice or credit note prefix in the settings |
data.order_id |
integer |
The sale |
data.refund_id |
integer |
Credit notes: the WooCommerce refund |
data.parent_id |
integer |
Credit notes: the invoice they correct |
data.customer |
string |
Company and name as printed |
data.total |
string |
Total |
data.tax |
string |
Tax |
data.currency |
string |
Currency |
data.created_at |
string |
ISO 8601 UTC |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_pos_not_found |
The sale does not exist, is not a register sale, or its register is not one the user may use. |
409 |
plugixa_pos_invoice_unpaid |
The sale is not paid. |
500 |
plugixa_pos_invoice_failed |
The invoice could not be saved. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/orders/4459/invoice" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"customer":{"company":"Atelier Lumière SARL","address":"4 rue de Bretagne\n75003 Paris","vat":"FR12345678901"}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/orders/4459/invoice');
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([
'customer' => [
'company' => 'Atelier Lumière SARL',
'address' => '4 rue de Bretagne
75003 Paris',
'vat' => 'FR12345678901',
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/orders/4459/invoice', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ customer: { company: 'Atelier Lumière SARL', address: '4 rue de Bretagne
75003 Paris', vat: 'FR12345678901' } }),
});
const { data } = await response.json();
Quick Links
Share