Applies to: Terminal API
Learn how to check device information for a Square Terminal using the Terminal API.
After pairing a Square Terminal and a POS application, use the Terminal API to check the real-time device information of one or more remote devices. This feature uses the TerminalAction object and the PING
Terminal action type. When you need to remotely monitor the performance of a group of Square Terminal devices, use the PING
Terminal action to capture information such as network connectivity, battery level, and device OS version.
When to check for device information
You might need to check the device information when:
- A seller has a group of devices that aren't operated by anyone on the floor (automated operation).
- You're not located at the same customer site as the seller (remote monitoring).
- You need to regularly monitor network connections due to a recent server outage.
The TerminalAction
object provides a foundational method for using the Terminal API to collect device information in real time and measure device availability. With the PING
Terminal action, you send a request to the device and see whether a device is connected to your seller's network, as indicated by the device's status. If the device is online and sends a response back, you can get additional device status updates.
As a device monitoring and health status feature, you can periodically use the PING
Terminal action so that your seller's devices maintain availability for buyers. The Terminal action request and response are limited to devices that are signed in with a Terminal API device code and that are paired with the Terminal API and your POS application.
Search for a PING Terminal action by status
You can also search for devices based on a specified status. When you send the POST request to the SearchTerminalActions endpoint, provide the status query in the request body. You can query by specifying PENDING
, IN-PROGRESS
, COMPLETED
, or CANCELED
for the status.
The following request example specifies the PING
action type and a limit of 2 for the number of results returned from the request:
Subscribe to events for Terminal action status updates
When a TerminalAction
object is created or updated, webhook notifications are sent to the endpoint that is registered for a POS application. To get the notifications, be sure that your application is updated in the Developer Dashboard with the following webhooks:
terminal.action.created
terminal.action.updated
A full copy of the object is sent to your application at your webhook URL for every action status update, which includes PENDING
, IN_PROGRESS
, COMPLETED
, or CANCELED
.
{
"merchant_id": "ABCXJLNDS6BE",
"type": "terminal.action.updated",
"event_id": "12345678-e125-4998-83eb-170a6e29433b",
"created_at": "2022-06-08T13:57:31.372Z",
"data": {
"type": "action.event",
"id": "termapia:abcd12349UOukCE",
"object": {
"action": {
"app_id": "sq0idp-abc1234_RWKfWkLesEPp8g",
"created_at": "2022-06-08T13:57:29.976Z",
"deadline_duration": "PT5M",
"device_id": "0000000000000000",
"device_metadata": {
"app_version": "5.92",
"battery_percentage": "44",
"charging_state": "CHARGING",
"ip_address": "0.0.0.0",
"location_id": "L5XXSEKV2GFMB",
"merchant_id": "ABCXJLNDS6BE",
"network_connection_type": "WIFI",
"os_version": "5.19.0048",
"payment_region": "US",
"serial_number": "0000000000000000",
"wifi_network_name": "Block Wifi",
"wifi_network_strength": "EXCELLENT"
},
"id": "termapia:12345iXIdUOAkCE",
"status": "COMPLETED",
"type": "PING",
"updated_at": "2022-06-08T13:57:31.372Z"
}
}
}
}