PENDING operation, and the terminal processes the command in the background. You then poll the operation to see how it finished.
Terminal operations are administrative commands. They do not start a payment. To take a payment on a terminal, see creating a terminal session.
Available operations
If the terminal’s status does not allow the operation, the API responds with
400 Bad Request. poll_terminal is never rejected on status, so it is the
safe way to check a terminal you are unsure about.
Send a command
PENDING.
Idempotency
Pass anIdempotency-Key header to ensure the same command is only executed once, for example when retrying after a network error.
Check that a terminal is reachable
Thepoll_terminal operation pings the terminal without changing anything on the device. Use it to confirm that a terminal is online and responding, for example before you send another operation or when you are investigating a terminal that customers report as unresponsive.
poll_terminal can be sent regardless of the terminal’s status, so you can also use it on a terminal that is not ACTIVE. The operation ends as COMPLETED when the terminal answers, and as TIMEOUT when no answer arrives within the timeout window.
Print text
print_text prints the lines you send, in order. Each line has its own size and align.
- Send 1 to 255 lines. Each
textis at most 255 bytes. - The terminal does not wrap lines. A line that is too wide is cut off at the right edge. A line fits 29 characters at
smallandmedium, and 15 atlarge. - A
largeline overlaps asmallormediumline right above it. Put a blank line before alargeline. - For a blank line, send
" ". An emptytextis rejected with400. - A tab or a newline in
textprints as a space. Send each printed line as its own entry inlines.
Print a copy of a payment receipt
print_receipt prints the receipt text the terminal wrote during the payment, marked as a copy. Dintero does not compose a receipt itself.
typeiscustomerfor the cardholder’s copy, ormerchantfor the merchant’s copy.- When no receipt text is stored for the transaction, for example for older transactions, the API responds with
400.
One operation of each type at a time
A terminal has at most one pending operation of each type. If an operation of the same type is already pending for the terminal, the API responds with409 Conflict and a Retry-After header indicating how many seconds to wait before retrying. Operations of other types are not blocked: a pending end_of_day does not block a print_text.
List operation results
Poll operations to see how a command finished. The endpoint returns operations and supports filtering byterminal_id and operation_id.
id returned when you sent the command.
limit (default
100) and starting_after with the id of the last operation you saw to page
through older ones.
See GET /admin/terminals/operations for the full schema.
Operation status
Which of these an operation can reach depends on the operation.
open_menu and poll_terminal are never FAILED - the terminal does not
report a failure for them, so an unreachable terminal ends the operation as
TIMEOUT. end_of_day, send_logs, check_update, print_text and
print_receipt are FAILED when the terminal answers but reports a problem,
and the result says what it was.
Operation result
An operation that reachesCOMPLETED or FAILED carries a result object
whose contents depend on the operation - on FAILED it is what tells you
why. A TIMEOUT operation never has a result. The examples below show
only that field of the operation.
The fields inside
result are camelCase, unlike the rest of the operation.
The end_of_day counts and amounts are the strings the terminal reported,
not numbers, and are only present when the terminal included them.poll_terminal and open_menu report only that the terminal answered:
send_logs reports whether the terminal reached the log destination.
connectionError means it did not, and the operation is FAILED:
check_update adds whether the terminal will reboot to apply an update. When
terminalReboot is true, the terminal is unavailable for payments until it is
back online - use poll_terminal to see when it is reachable again:
print_text and print_receipt report whether the terminal printed:
end_of_day reports the outcome and the batch totals:
End-of-day when a terminal is removed
Removing a terminal withDELETE /v1/accounts/{aid}/terminals/{terminal_id} also starts an end_of_day operation on it, to close the terminal’s open batch. The operation runs asynchronously and does not block or fail the removal.
Read its result from the operations list filtered by the removed terminal’s terminal_id, as described in List operation results. A terminal that is turned off or unreachable when it is removed ends the operation as TIMEOUT. No operation is created for a terminal that is not active, for example one still being activated.