Contents
On this page

Update Receipt Template - Plugixa POS for WooCommerce

PUT /plugixa-pos/v1/receipt-templates/{id}

Replace a template. POST and PATCH work the same way.

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

PUT https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates/1

Path parameters

Name Type Description
id integer The template’s id

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": 58,
  "blocks": [
    {
      "type": "store"
    },
    {
      "type": "meta"
    },
    {
      "type": "lines"
    },
    {
      "type": "totals"
    },
    {
      "type": "payments"
    },
    {
      "type": "fiscal"
    }
  ]
}

Responses

200 OK.

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Marais receipt",
    "paper": 58,
    "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

Status Code When
404 plugixa_pos_not_found No template with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates/1" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Marais receipt","paper":58,"blocks":[{"type":"store"},{"type":"meta"},{"type":"lines"},{"type":"totals"},{"type":"payments"},{"type":"fiscal"}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/receipt-templates/1');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    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'  => 58,
        'blocks' => [
            [
                'type' => 'store',
            ],
            [
                'type' => 'meta',
            ],
            [
                'type' => 'lines',
            ],
            [
                'type' => 'totals',
            ],
            [
                'type' => 'payments',
            ],
            [
                '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/1', {
  method: 'PUT',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Marais receipt', paper: 58, blocks: [{ type: 'store' }, { type: 'meta' }, { type: 'lines' }, { type: 'totals' }, { type: 'payments' }, { type: 'fiscal' }] }),
});
const { data } = await response.json();

Quick Links

Share