Overview
Actions are commands you send to the WebSocket API to interact with terminals. Each action has a specific request format and returns a corresponding response.| Action | Description |
|---|---|
getTerminals | Retrieve a list of available terminals |
payment | Initiate a payment request |
ping | Keep-alive heartbeat |
getTerminals
Request a list of available terminals in your group.Request
Response
Response Fields
| Field | Type | Description |
|---|---|---|
terminals | array | List of available terminals |
terminals[].connectionId | string | Unique connection identifier |
terminals[].deviceId | string | Stable device identifier (if configured) |
terminals[].connectedAt | string | ISO 8601 timestamp of connection |
terminals[].lastActivity | string | ISO 8601 timestamp of last activity |
terminals[].status | string | online, offline, or reconnecting |
terminals[].metadata | object | Custom terminal metadata |
timestamp | string | ISO 8601 timestamp of the response |
Code Examples
payment
Initiate a payment request to a terminal. The terminal processes the payment and returns the result via apaymentComplete push notification.
Request
Parameters
Must be
"payment"The terminal identifier to send the payment to. Resolved as
deviceId first, falling back to connectionId. See Terminal ID Resolution.The payment details
Message Sent to Terminal
When you send a payment action, the terminal receives:Response
The payment result is delivered via apaymentComplete push notification when the terminal finishes processing.
Code Examples
Error Responses
| Error | Message | Cause |
|---|---|---|
| Bad Request | terminalId is required | Missing terminal ID |
| Bad Request | paymentRequest is required | Missing payment data |
| Not Found | Terminal connection not found | Terminal not connected |
| Forbidden | Cannot send message to connection in different group | Group mismatch |
ping / pong
Keep-alive mechanism to maintain connection health and detect stale connections.Ping Request
Pong Response
Recommended Settings
| Setting | Value |
|---|---|
| Ping interval | 30 seconds |
| Pong timeout | 10 seconds |
| Reconnect on failure | Yes |
Code Examples
Server-Initiated Pong
The server may also sendpong messages to check client responsiveness. Your client should update its activity tracking when receiving these messages.
Error Response Format
All error responses follow this format:Common Errors
| Error | Message | Cause |
|---|---|---|
| Bad Request | Invalid JSON in message body | Malformed JSON in request |
| Bad Request | terminalId is required | Missing required field |
| Bad Request | paymentRequest is required | Missing payment data |
| Not Found | Connection not found | Invalid connection ID |
| Not Found | Terminal connection not found | Terminal not connected |
| Forbidden | Only desktop devices can request terminal list | Wrong device type |
| Forbidden | Cannot send message to connection in different group | Group mismatch |
| Internal Server Error | Failed to process message | Server-side error |