Skip to main content

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?

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.

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.

What can be configured​

FieldTypeDefaultDescription
LogoPNG imagenoneLogo printed at the top of the receipt. It has its own endpoint and is not part of the configuration body. See Logo
receipt_headerstring | nullnullText 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_textstring | nullnullText printed at the bottom of the receipt, one line for each \n. When null, no footer is printed
display_cashier_namebooleanfalsePrint the name of the cashier who issued the receipt
display_cash_register_namebooleanfalsePrint the name of the cash register that issued the receipt
receipt_formatstandard | narrowstandardReceipts 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_issuerbooleanfalseWhether 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.

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 Type if the Content-Type is not image/png
  • 422 Unprocessable Entity if 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 rate
  • false: 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}:

FieldDescription
enabledThe value in effect
last_switched_atSince when the value in effect applies. null if it has never switched
next_switch_atWhen a pending change is due to apply. null if no change is pending

APIs​

MethodPathPurpose
GET/v1/mf2/pems/{serial_number}/configurationRead the PEM configuration
PUT/v1/mf2/pems/{serial_number}/configurationUpdate the PEM configuration
PUT/v1/mf2/pems/{serial_number}/configuration/logoUpload the logo as a PNG
GET/v1/mf2/pems/{serial_number}/configuration/logoDownload the logo as a PNG. Replies 404 Not Found if no logo is set
DELETE/v1/mf2/pems/{serial_number}/configuration/logoDelete 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.