Contents
On this page

Get Invoice Layout - Plugixa POS for WooCommerce

GET /plugixa-pos/v1/invoice-layout

The invoice design and what the designer needs: the starter design, the placeholders text can use, the fonts and the page size.

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

GET https://your-site.example/wp-json/plugixa-pos/v1/invoice-layout

Responses

200 OK.

{
  "success": true,
  "data": {
    "active": false,
    "layout": {
      "version": 1,
      "schemas": [
        {
          "name": "seller_company",
          "type": "text",
          "content": "{seller_company}",
          "position": {
            "x": 13,
            "y": 14
          },
          "width": 110,
          "height": 8,
          "rotate": 0,
          "opacity": 1,
          "readOnly": true,
          "fontName": "dejavusans-bold",
          "fontSize": 14,
          "fontColor": "#1f2937",
          "alignment": "left",
          "verticalAlignment": "top",
          "lineHeight": 1.3,
          "characterSpacing": 0,
          "backgroundColor": ""
        }
      ]
    },
    "starter": {
      "version": 1,
      "schemas": [
        {
          "name": "seller_company",
          "type": "text",
          "content": "{seller_company}",
          "position": {
            "x": 13,
            "y": 14
          },
          "width": 110,
          "height": 8,
          "rotate": 0,
          "opacity": 1,
          "readOnly": true,
          "fontName": "dejavusans-bold",
          "fontSize": 14,
          "fontColor": "#1f2937",
          "alignment": "left",
          "verticalAlignment": "top",
          "lineHeight": 1.3,
          "characterSpacing": 0,
          "backgroundColor": ""
        }
      ]
    },
    "placeholders": ["title", "meta", "number", "date", "sale_date", "valid_until", "order", "ticket", "for_invoice", "seller_company", "seller_address", "seller_vat", "seller_registration", "seller_email", "seller_phone", "customer", "customer_company", "customer_name", "customer_address", "customer_vat", "customer_email", "net", "tax", "total", "legal"],
    "fonts": {
      "dejavusans": "https://your-site.example/wp-content/plugins/plugixa-pos/vendor/dompdf/dompdf/lib/fonts/DejaVuSans.ttf",
      "dejavusans-bold": "https://your-site.example/wp-content/plugins/plugixa-pos/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Bold.ttf"
    },
    "page": {
      "width": 210,
      "height": 297
    }
  }
}
Field Type Meaning
data.active boolean Invoices use this design; otherwise the built-in one
data.layout object The saved design, else the starter. schemas lists the elements (shortened in the example)
data.placeholders string[] Names usable as {name} in text
data.page object Page size in mm

Errors

This endpoint has no errors of its own.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-pos/v1/invoice-layout" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/invoice-layout');
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/invoice-layout', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share