e-bon
e-bon.ro
Reference

Command types

Reference for every fiscal command e-bon dispatches to your AMEF — request body, result shape, and what each command does on the device.

Command types

Every fiscal action your POS performs through e-bon — printing a receipt, opening the cash drawer, closing the day with a Z report — is dispatched as a typed command to a registered AMEF device.

This page is the per-type reference. For each command it lists the wire identifier you send in the request body, the JSON payload (when one is required), and what the device returns. Pair it with the Commands API page, which documents the HTTP envelope, polling, and idempotency.

Send a command

Every command type uses the same HTTP entry point:

POST /api/v1/devices/:deviceId/commands
Content-Type: application/json
Authorization: Bearer <api-key>
{
  "type": "print_receipt",
  "payload": { /* per-type body, see below */ }
}

A single API-key scope (commands) authorizes every command type listed on this page. See API keys for how to mint and rotate keys.

Command catalogue

The 27 command types, grouped by purpose:

Wire stringCategoryPayloadPurpose
print_receiptReceiptsrequiredPrint a fiscal sale receipt.
void_receiptReceiptsrequiredVoid a previously emitted receipt by ID.
print_reversal_receiptReceiptsrequiredIssue a storno (fiscal reversal).
void_open_receiptReceiptsnoneCancel a receipt currently open on the device.
print_duplicateReceiptsnoneReprint the last receipt as a non-fiscal duplicate.
non_fiscal_receiptReceiptsrequiredPrint a free-form non-fiscal slip.
x_reportReportsnoneRead mid-day totals without closing the day.
z_reportReportsnoneClose the fiscal day and write totals to fiscal memory.
cash_inCashrequiredRegister a cash deposit.
cash_outCashrequiredRegister a cash withdrawal.
get_cash_amountCashnoneRead the running cash balance.
open_drawerCashnonePulse the cash drawer open.
set_datetimeConfigurationoptionalSet the device clock.
set_logoConfigurationrequiredUpload a logo bitmap.
delete_logoConfigurationnoneRemove the configured logo.
set_vat_ratesConfigurationrequiredConfigure the device's VAT rate table.
set_header_footerConfigurationrequiredReplace the printed header and footer lines.
set_operatorConfigurationrequiredAdd or replace a cashier identity.
get_statusDiagnosticsnoneRead paper, cover, and error state.
get_infoDiagnosticsnoneRead serial, firmware, and fiscal memory status.
get_last_receipt_infoDiagnosticsnoneRead metadata of the last issued receipt.
get_vat_ratesDiagnosticsnoneRead the configured VAT rate table.
get_vat_capabilitiesDiagnosticsnoneRead VAT rates supported by the firmware.
get_header_footer_capabilitiesDiagnosticsnoneRead header/footer line and width limits.
get_header_footerDiagnosticsnoneRead the configured header and footer.
get_operator_capabilitiesDiagnosticsnoneRead operator-slot count and password limits.
raw_commandRawpassthroughSend protocol-native bytes to the driver.

Receipts

Print a fiscal sale receipt on the AMEF.

Type: print_receipt

{
  "items": [
    { "name": "Coffee", "quantity": 2, "price": 9.5, "vatRate": 21, "department": 1 }
  ],
  "payments": [
    { "type": "cash", "amount": 19.0 }
  ]
}
FieldTypeRequiredNotes
itemsarrayyesMust be non-empty.
items[].namestringyesNon-empty product name.
items[].quantitynumberyesStrictly positive.
items[].pricenumberyesUnit price.
items[].vatRatenumberyesOne of 0, 9, 11, 21 (Romanian VAT rates).
items[].departmentnumbernoDepartment index on the device.
paymentsarrayyesMust be non-empty.
payments[].typestringyesOne of cash, card, voucher, other.
payments[].amountnumberyesStrictly positive.

The total of items (quantity × price) must equal the total of payments within 0.01.

On success: result.fiscalId carries the AMEF-assigned receipt ID. Driver-specific details land in result.data.

See also: Receipts API, Receipt emission flow.

Void a receipt

Void a previously emitted fiscal receipt by its ID.

Type: void_receipt

{ "receiptId": "rcpt_01HZ..." }
FieldTypeRequiredNotes
receiptIdstringyesID of the receipt to void.

Issue a fiscal reversal (storno)

Emit a Romanian storno that legally cancels an earlier sale and references the original receipt.

Type: print_reversal_receipt

{
  "uniqueSaleNumber": "USN-2026-000123",
  "originalReceiptNumber": "0000456",
  "originalReceiptDateTime": "2026-04-20T14:32:11Z",
  "fiscalMemorySerialNumber": "DY12345678",
  "originalZReportNumber": "12",
  "reason": "operator_error",
  "items": [
    { "name": "Coffee", "quantity": 1, "price": 9.5, "vatRate": 21 }
  ],
  "payments": [
    { "type": "cash", "amount": 9.5 }
  ]
}
FieldTypeRequiredNotes
uniqueSaleNumberstringyesUSN of the original sale.
originalReceiptNumberstringyesReceipt number to reverse.
originalReceiptDateTimestringyesValid ISO-8601 timestamp.
fiscalMemorySerialNumberstringyesSerial of the original AMEF.
originalZReportNumberstringnoZ-report number, if known.
reasonstringyesOne of operator_error, refund, tax_base_reduction.
itemsarrayyesSame per-item rules as print_receipt.
paymentsarraynoIf present, follows the same rules as print_receipt and is balance-checked.

On success: the storno receipt's own fiscal ID is returned in result.fiscalId.

See also: USN, Storno.

Cancel an open receipt

Cancel a receipt that is currently open on the device. Use this to reset state after a hardware or operator interruption.

Type: void_open_receipt — no payload.

Reprint the last receipt

Reprint the last receipt as a non-fiscal duplicate.

Type: print_duplicate — no payload.

Print a free-form, non-fiscal slip such as a pre-bill or loyalty notice. Non-fiscal prints do not write to fiscal memory and have no fiscal ID.

Type: non_fiscal_receipt

{
  "lines": ["Thanks for visiting", "See you soon!"],
  "header": "Loyalty receipt"
}
FieldTypeRequiredNotes
linesstringyesNon-empty list of lines to print.
headerstringnoOptional header line.

Reports

Read an X report

Read mid-day totals without closing the fiscal day. Returns totals, VAT breakdown, and receipt count in result.data.

Type: x_report — no payload.

On success, e-bon also fires a report.generated webhook.

See also: X report.

Close the day with a Z report

Close the fiscal day, freeze daily totals into fiscal memory, and reset daily counters.

Type: z_report — no payload.

On success, e-bon also fires a report.generated webhook.

See also: Z report.

Cash management

Register a cash deposit

Register a cash deposit into the device drawer.

Type: cash_in

{ "amount": 200, "description": "Opening float" }
FieldTypeRequiredNotes
amountnumberyesStrictly positive.
descriptionstringnoFree-text note.

Register a cash withdrawal

Register a cash withdrawal from the device drawer. Same payload as cash_in.

Type: cash_out

{ "amount": 50, "description": "Bank deposit" }

Read the cash balance

Read the running cash balance the device tracks for the drawer. Returns { cashBalance, currency } in result.data.

Type: get_cash_amount — no payload.

Open the cash drawer

Pulse the cash drawer open without printing anything.

Type: open_drawer — no payload.

Configuration

Set the device clock

Sync the device clock, optionally to a specific timestamp.

Type: set_datetime

{ "datetime": "2026-04-25T10:00:00Z" }
FieldTypeRequiredNotes
datetimestringnoIf present, must be a valid ISO-8601 timestamp. If omitted, the device syncs to current server time.

Upload a logo bitmap that the device prints at the top of receipts.

Type: set_logo

{ "logo": "iVBORw0KGgoAAAANSUhEUgAA..." }
FieldTypeRequiredNotes
logostringyesBase64-encoded bitmap.
Each AMEF firmware has its own size and format limits for logos. Check the device documentation before uploading large or unusual bitmaps.

Remove the configured logo from the device.

Type: delete_logo — no payload.

Configure VAT rates

Configure the device's named VAT rate table (for example A → 21, B → 9).

Type: set_vat_rates

{
  "rates": [
    { "name": "A", "percentage": 21 },
    { "name": "B", "percentage": 9 }
  ]
}
FieldTypeRequiredNotes
ratesarrayyesAt least one entry.
rates[].namestringyesVAT slot name.
rates[].percentagenumberyesNon-negative percentage.

Replace the lines printed at the top and bottom of every receipt.

Type: set_header_footer

{
  "header": ["My Coffee Shop SRL", "Bd. Magheru 12, București"],
  "footer": ["Thank you!", "www.example.ro"]
}
FieldTypeRequiredNotes
headerstringyesHeader lines (may be an empty array).
footerstringyesFooter lines (may be an empty array).
Read the device's limits with get_header_footer_capabilities before pushing — line counts and character widths vary by firmware.

Configure an operator

Add or replace an operator slot (cashier identity) on the device.

Type: set_operator

{ "operatorId": 1, "name": "Maria", "password": "1234" }
FieldTypeRequiredNotes
operatorIdnumberyesInteger ≥ 1.
namestringyesOperator name.
passwordstringnoOptional password.
Read the device's limits with get_operator_capabilities first — slot count and password support vary by firmware.

Diagnostics

Read device status

Read the device's current operating status — paper, cover, fiscal-day state, and any errors.

Type: get_status — no payload.

Read device identity

Read the device serial number, firmware version, fiscal-memory status, manufacturer, and model.

Type: get_info — no payload.

Returns { serialNumber, firmwareVersion, fiscalMemoryStatus, manufacturer, model? } in result.data.

Read the last receipt

Read metadata of the last issued receipt.

Type: get_last_receipt_info — no payload.

Returns { receiptNumber, date, total, fiscalMemoryNumber? } in result.data.

Read configured VAT rates

Read the VAT rate table currently configured on the device.

Type: get_vat_rates — no payload.

Returns an array of { name, percentage } in result.data.

Read supported VAT rates

Read which VAT rates the device firmware accepts (the possible rates, not the configured ones).

Type: get_vat_capabilities — no payload.

Read header/footer limits

Read the device's header and footer limits.

Type: get_header_footer_capabilities — no payload.

Returns { maxHeaderLines, maxFooterLines, maxCharsPerLine } in result.data.

Read the header and footer currently configured on the device.

Type: get_header_footer — no payload.

Returns { header: string[], footer: string[] } in result.data.

Read operator limits

Read the operator-slot count and password constraints supported by the firmware.

Type: get_operator_capabilities — no payload.

Returns { maxOperators, maxNameLength, maxPasswordLength, supportsPassword } in result.data.

Send a raw command

Driver-specific escape hatch for sending protocol-native bytes when no typed command exists. Whatever you pass in payload is forwarded straight to the device driver.

Type: raw_command

raw_command bypasses every payload check e-bon performs. Misuse can put a device into an unusable state or emit non-compliant fiscal output. Treat it as a debugging tool, not a production primitive.

Track a command result

Every command, regardless of type, moves through the same lifecycle. The status field on the command document takes one of six values:

StatusWhen you see it
pendingThe API has accepted and persisted the command.
sentThe command is in flight to the device.
processingThe device has acknowledged and is working on it.
completedThe device returned success. result.data and (for receipt commands) result.fiscalId are populated.
failedThe device or dispatcher reported failure. result.errorCode and result.errorMessage are populated.
timeoutThe device did not respond in time. result.errorCode is E500 (TimeoutCommand).

The full result envelope is { success, data?, fiscalId?, errorCode?, errorMessage? }.

Where to next