Contents
On this page
Create Receipt Template - Plugixa POS for WooCommerce
POST /plugixa-pos/v1/receipt-templates
Add a template. Assign it to a store with Assign Receipt Template.
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/receipt-templates
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | 1 to 190 characters. |
paper |
integer |
No | Paper width in mm: 58 or 80 (default). |
blocks |
object[] |
Yes | Up to 40 blocks in print order. type is one of store, meta, lines, totals, payments, fiscal (always kept: a missing one is put back), or logo (url, width 10 to 100), header, text (text, align, bold, size), barcode (source ticket or order, kind code128 or qr), separator, footer. |
{
"name": "Marais receipt",
"paper": 80,
"blocks": [
{
"type": "store"
},
{
"type": "meta"
},
{
"type": "lines"
},
{
"type": "totals"
},
{
"type": "payments"
},
{
"type": "text",
"text": "Follow us @maisonplugixa",
"bold": true
},
{
"type": "fiscal"
}
]
}
Responses
201 Created.
{
"success": true,
"data": {
"id": 1,
"name": "Marais receipt",
"paper": 80,
"blocks": [
{
"id": "logo-1",
"type": "logo",
"url": "https://your-site.example/wp-content/uploads/2026/11/maison-plugixa-logo.png",
"width": 50
},
{
"id": "store-2",
"type": "store"
},
{
"id": "meta-3",
"type": "meta"
},
{
"id": "lines-4",
"type": "lines"
},
{
"id": "totals-5",
"type": "totals"
},
{
"id": "payments-6",
"type": "payments"
},
{
"id": "text-7",
"type": "text",
"text": "Follow us @maisonplugixa",
"align": "center",
"bold": true,
"size": "normal"
},
{
"id": "barcode-8",
"type": "barcode",
"source": "ticket",
"kind": "code128"
},
{
"id": "fiscal-9",
"type": "fiscal"
}
],
"updated_at": "2026-11-19 15:45:00"
}
}
Errors
This endpoint has no errors of its own.
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"Marais receipt","paper":80,"blocks":[{"type":"store"},{"type":"meta"},{"type":"lines"},{"type":"totals"},{"type":"payments"},{"type":"text","text":"Follow us @maisonplugixa","bold":true},{"type":"fiscal"}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates');
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([
'name' => 'Marais receipt',
'paper' => 80,
'blocks' => [
[
'type' => 'store',
],
[
'type' => 'meta',
],
[
'type' => 'lines',
],
[
'type' => 'totals',
],
[
'type' => 'payments',
],
[
'type' => 'text',
'text' => 'Follow us @maisonplugixa',
'bold' => true,
],
[
'type' => 'fiscal',
],
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'Marais receipt', paper: 80, blocks: [{ type: 'store' }, { type: 'meta' }, { type: 'lines' }, { type: 'totals' }, { type: 'payments' }, { type: 'text', text: 'Follow us @maisonplugixa', bold: true }, { type: 'fiscal' }] }),
});
const { data } = await response.json();
Quick Links
Share