PEM Configuration
Each PEM has an associated configuration. Through the configuration it is possible to customize the aspect of the PDF of the receipts it issues and control what checks the PEM should perform when issuing receipts. The configuration is managed by the Supplier through MF2.
When changes take effect?
- PEM in cloud
- PEM on-premise
Changes take effect in the PEM only when its journal_status is sent or ready.
Until then, the PEM keeps on using the previous configuration.
An on-premise PEM fetches the new configuration from A-Cube by itself, the first time it is used after its current journal is closed: when it issues a receipt, or when the cash register reads its own details.
The PEM must be able to reach A-Cube to fetch the configuration. If it cannot, it keeps issuing receipts with the previous configuration and tries again at the next receipt.
PDF Customizations
The numbered areas are the ones you can configure. The greyed-out areas come from the merchant data or from the sale itself, and cannot be changed through the PEM configuration.
Colazioni e aperitivi
receipt_header1 or 2 bold lines, up to 40 characters each. Defaults to the business name.Click for all the detailsVia Roma 1
Milano (MI), 20121
di vendita o prestazione
DOCUMENTO N. 0007-0042
Hash: 3f9a…c21e
display_cashier_nameWhen true, prints the name of the cashier who issued the receipt.Click for all the details4display_cash_register_nameWhen true, prints the name of the cash register that issued the receipt.Click for all the details5www.barcentrale.example
What can be configured
| Field | Type | Default | Description |
|---|---|---|---|
| Logo | PNG image | none | Logo printed at the top of the receipt. It has its own endpoint and is not part of the configuration body. See Logo |
receipt_header | string | null | null | Text printed in bold under the logo. 1 or 2 lines separated by \n, each at most 40 characters. Only letters, digits, punctuation and spaces are allowed: symbols such as €, + or $ are rejected. When null, the merchant's business name is printed instead |
footer_text | string | null | null | Text printed at the bottom of the receipt, one line for each \n. When null, no footer is printed |
display_cashier_name | boolean | false | Print the name of the cashier who issued the receipt |
display_cash_register_name | boolean | false | Print the name of the cash register that issued the receipt |
receipt_format | standard | narrow | standard | Receipts are always 8 cm wide. Use standard: narrow is kept only for compatibility, and it only shortens header lines to 30 characters and shrinks the logo to 150 × 75 px. Changing it deletes the logo |
meal_vouchers_invoiced_to_issuer | boolean | false | Whether the merchant invoices meal vouchers to their issuer. Not printed on the receipt. See Meal vouchers |
The VAT number and the address printed under the header are not part of the PEM configuration: they come from the merchant, or from the address given when the PEM was created.
Logo
Upload the logo with PUT /v1/mf2/pems/{serial_number}/configuration/logo, sending the PNG file as the request body with Content-Type: image/png.
It is converted to black and white and scaled down, keeping its proportions, to fit 200 × 100 px.
Changing receipt_format deletes the logo: upload it again after the change.
To replace the logo, upload a new one. To remove it, use DELETE /v1/mf2/pems/{serial_number}/configuration/logo. The upload is rejected with:
415 Unsupported Media Typeif theContent-Typeis notimage/png422 Unprocessable Entityif the body is not a valid image
Meal vouchers
meal_vouchers_invoiced_to_issuer records whether the merchant invoices the meal vouchers (buoni pasto) they accept to the voucher issuer:
true: meal vouchers can only pay for services with a 10% VAT ratefalse: meal vouchers can pay for any item
Once the PEM has received the new value, the choice applies immediately if the merchant has not accepted any meal voucher in the current month. Otherwise it stays pending until the first day of the next month; if a journal is still open at that moment, the switch waits until that journal is closed. Sending the value already in effect cancels a pending change.
The GET configuration endpoint returns the value you requested.
To see the value in effect, read the meal_vouchers_invoiced_to_issuer object returned by GET /v1/mf1/pems/{serial_number}:
| Field | Description |
|---|---|
enabled | The value in effect |
last_switched_at | Since when the value in effect applies. null if it has never switched |
next_switch_at | When a pending change is due to apply. null if no change is pending |
APIs
| Method | Path | Purpose |
|---|---|---|
GET | /v1/mf2/pems/{serial_number}/configuration | Read the PEM configuration |
PUT | /v1/mf2/pems/{serial_number}/configuration | Update the PEM configuration |
PUT | /v1/mf2/pems/{serial_number}/configuration/logo | Upload the logo as a PNG |
GET | /v1/mf2/pems/{serial_number}/configuration/logo | Download the logo as a PNG. Replies 404 Not Found if no logo is set |
DELETE | /v1/mf2/pems/{serial_number}/configuration/logo | Delete the logo |
An update request looks like this:
{
"receipt_format": "standard",
"receipt_header": "BAR CENTRALE\nColazioni e aperitivi",
"footer_text": "Grazie e arrivederci!\nwww.barcentrale.example",
"display_cashier_name": true,
"display_cash_register_name": true,
"meal_vouchers_invoiced_to_issuer": false
}
Reading the configuration always returns the latest values you saved, even if the PEM is not using them yet.