sendGeneralEvent

The sendGeneralEvent method allows the terminal to communicate specific operational events or status updates to the system. This is mainly used to monitor the results of background processes such as periodic communications, setup routines, or reporting transaction-specific data.

Request

📘

JSON-RPC 2.0

All methods in TweezerComm follow a JSON-RPC 2.0 structure. See Get Started for more details on how the requests are structured and sent.

In the request, the method field needs to be set to sendGeneralEvent, as shown in the example below:

{
  "id": "123",
  "method": "sendGeneralEvent",
  "jsonrpc": "2.0",
  "params": [
    "device",
    {
      "eventCode": 0,
      "eventData": {
        "transactionAmount": "100.00",
        "card": "6935"
      }
    }
  ]
}

Request Parameters

The table below describes the request parameters for this method:

NameTypeDescription
params[0]stringMust contain the value device
params[1]objectContains the eventCode and associated eventData
eventCodeintegerThe identifier for the specific event (see Enums below)
eventDataobjectMetadata related to the event, such as amount, card digits

Event Code Enums

ValueName
0GeneralEventCode_Event
1GeneralEventCode_EventEstablishmentFinishedSuccessfully
2GeneralEventCode_EventPeriodicFinishedSuccessfully
3GeneralEventCode_EventEstablishmentFailed
4GeneralEventCode_EventPeriodicFailed
5GeneralEventCode_EventMiniSettlementFailed
6GeneralEventCode_EventCardReadError
7GeneralEventCode_EventMustToGoOnlineError
8GeneralEventCode_EventTransactionReport

Response

A successful request will return the following response:

{
   "jsonrpc": "2.0",
   "id": "123",
   "result": {
       "statusCode": 0,
       "statusMessage": "ok"
   }
}

Response Parameters

The table below describes the response parameters for this method:

NameTypeDescription
statusCodeintegerOperation status (0 = OK, others = errors TBD)
statusMessagestringStatus description (e.g., "ok")