> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Check the Cloud Connection

> Remotely check the live WebSocket connection of terminals.

In a Terminal API integration with cloud communications, terminals establish a WebSocket connection to access Terminal API. If the terminal is connected to your network, for example to the Wi-Fi network, this doesn't mean the terminal can establish a WebSocket connection. You need to enable WebSockets in your [Customer Area](https://ca-test.adyen.com/) under **In-person payments** > **Terminal settings** > **Integrations**. After WebSockets are enabled, you can verify in real time whether terminals have a live cloud connection.

You can verify this:

* Remotely:

  * [Using your Customer Area](#use-the-customer-area)
  * [Using an API request](#use-an-api-call)

* [On the physical terminal](#check-cloud-on-terminal)

## Check in the Customer Area

In your Customer Area, you can view the terminals list or the terminal details to verify whether terminals have a live cloud connection to Terminal API:

1. In your [Customer Area](https://ca-test.adyen.com/), go to **In-person payments** > **Payment devices**, and select the **Terminals** tab.

2. Check the **WebSocket** column. This uses cloud symbols to indicate the cloud connection status of each terminal, or a minus sign (\*\*) if WebSockets aren't enabled.

   If the **WebSocket** column isn't shown, select the settings icon \*\*and select the column.

   There is a delay between the actual status and the status shown in the list. You may want to check an individual terminal as described below.

3. Select the terminal from the list.\
   The page **Settings** > **About this terminal** appears.

   If you do not see the field **Cloud connection**, WebSockets aren't enabled for the terminal.

4. At **Cloud connection**, select **Check connection**.\
   An icon indicates the result, and a message pops up, either:

   * ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) Terminal is connected.
   * ![-x-](https://docs.adyen.com/user/data/smileys/emoji/x.png) Terminal is disconnected. This indicates the terminal is turned off, or there is a problem with the\
     terminal's cloud connection.

   The connection icon is not updated automatically. You need to click **Check connection** each time you want to know the current state.

## Check using an API request

You can check the cloud connection status of your payment devices using the Cloud device API [Cloud device API](https://docs.adyen.com/api-explorer/cloud-device-api/latest/overview). This allows you to:

* [Check if a specific device has a cloud connection](#check-the-cloud-connection-status-of-an-individual-device).

* [Get a list of devices that have a cloud connection](#get-a-list-of-devices-that-have-a-cloud-connection).

  It is still possible to use the [old way of receiving a list of terminals that have a live cloud connection](#old-api-request-to-check-cloud-connection). However, we strongly recommend that you use Cloud device API to check the cloud connection.

### Check the cloud connection status of an individual device

You can check if a specific payment device or app installation ID (in an IPP Mobile solution) has an active cloud connection using the `/merchants/{merchantAccount}/devices/{deviceId}/status` endpoint.\
You need to authenticate your Cloud device API requests with an [API key](https://adyen-preview.mintlify.site/point-of-sale/diagnostics/check-cloud-connection.md#api-key) that has the **Cloud device API role**

1. Make a GET [status](https://docs.adyen.com/api-explorer/cloud-device-api/1/get/merchants/\(merchantAccount\)/devices/\(deviceId\)/status) request, specifying the following path parameters.

   | Parameter | Required | Description |
   | - | - | - |
   | `merchantAccount` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The unique identifier of your merchant account. |
   | `deviceId` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The unique identifier of the payment device (Format: `[device model]-[serial number]`, for example, `P400-123456789`) or app installation ID in a Mobile solution (for example, `a1bac6bb-2276-44ff-9152-aa75a604b1ca`). |

   **Check connection status of a device**

   ```bash theme={null}
   curl https://device-api-test.adyen.com/v1/merchants/{merchantAccount}/devices/AMS1-000150183300032/status \
   -H 'x-API-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -X GET
   ```

2. In the response, check the `status` parameter to see if the device is **OFFLINE** or **ONLINE**.

   **Response for connection status of an individual device.**

   ```json theme={null}
   {
      "deviceId": "AMS1-000158204503066",
      "status": "ONLINE"
   }
   ```

### Get a list of devices that have a cloud connection

You can retrieve a list of payment devices (or app installation IDs in a Mobile solution) that have an active cloud connection for a specified merchant account. You can optionally filter this list by store.\
You need to authenticate your Cloud device API requests with an [API key](https://adyen-preview.mintlify.site/point-of-sale/diagnostics/check-cloud-connection.md#api-key) that has the **Cloud device API role**

1. Make a GET [connectedDevices](https://docs.adyen.com/api-explorer/cloud-device-api/1/get/merchants/\(merchantAccount\)/connectedDevices) request, specifying:

   * As a path parameter:

   | Parameter | Required | Description |
   | - | - | - |
   | `merchantAccount` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The unique identifier of your merchant account. As a query parameter: |

   | Parameter | Required | Description |
   | - | - | - |
   | `store` | | The store ID belonging to the specified merchant account. |

   **Get list of payment devices**

   ```bash theme={null}
   curl https://device-api-test.adyen.com/v1/merchants/{merchantAccount}/connectedDevices \
   -H 'x-API-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -X GET
   ```

2. You receive a response with an array of device IDs for all devices that are associated with the specified merchant account or store and have an active cloud connection. Offline devices are not included.

   **Response with list of devices with active cloud connection.**

   ```json theme={null}
   {
       "uniqueDeviceIds": [
           "AMS1-000158204503066",
           "P400-324688179"
       ]
   }     
   ```

\*\*

### Old API request to check cloud connection

This is the old way of checking for the cloud connection using an API request. We strongly recommend that you use the [new way](#use-an-api-call) of checking the cloud connection.

The `/connectedTerminals` endpoint returns a list of terminals that have a live cloud connection. You can get this\
information for a merchant account, a store, or a specific terminal.

The endpoint to use differs for test and live terminals:

* For test terminals: `https://terminal-api-test.adyen.com/connectedTerminals`
* For live terminals: `https://terminal-api-live.adyen.com/connectedTerminals`

Authenticate your requests using the same [API key that you use for your Terminal API requests](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api#api-key).

To verify whether terminals have a live cloud connection to Terminal API:

1. Make a POST request to the test or live `/connectedTerminals` endpoint, specifying:

   | Parameter | Required | Description |
   | - | - | - |
   | `merchantAccount` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The merchant account that you want to check. |
   | `store` | | The store that you want to check. Must belong to the specified `merchantAccount`. |
   | `uniqueTerminalId` | | The POIID of the terminal that you want to check, in the format *\[device model]-\[serial number]*. Must belong to the specified `merchantAccount` |

   Here are some example requests:

   **Get connected terminals under a merchant account**

   ```json theme={null}
   {
       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT"
   }
   ```

   **Get connected terminals under a store**

   ```json theme={null}
   {
       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
       "store": "YOUR_STORE_ID"
   }
   ```

   **Check a specific terminal**

   ```json theme={null}
   {
       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
       "uniqueTerminalId": "V400m-324688178"
   }
   ```

2. You receive a response with:

   * `uniqueTerminalIds`: an array with the POIIDs of the terminals that have a live cloud connection. If you checked a specific terminal, the same `uniqueTerminalId` from the request is returned.

   **/connectedTerminals response**

   ```json theme={null}
   {
      "uniqueTerminalIds" : [
         "MX915-284251016",
         "MX925-260390740",
         "V400m-324688136",
         "V400m-324688178",
         "V400m-324688181"
      ]
   }
   ```

   If the `uniqueTerminalIds` array from the response is empty, this can indicate:

   * No terminal found with a live cloud connection.
   * WebSockets are not enabled.

## Check on the terminal

To verify on the physical terminal whether it has a live cloud connection to Terminal API, run a [Terminal API connection test](https://adyen-preview.mintlify.site/point-of-sale/pos-troubleshooting/connection-tests.md#terminal-api-test):

1. Check the icons in the top row of the terminal display: there should be a cloud icon.
2. Select **Settings** > **Diagnostics**.
3. Select **Terminal API**: the items **API enabled**, **WebSocket enabled**, and **WebSocket connection** should all\
   have a green check mark ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png).

## Restore the cloud connection

If the result from your check indicates the terminal doesn't have a live cloud connection to Terminal API:

1. [Check that WebSockets are enabled](#use-the-customer-area).\
   If disabled, go to your [Customer Area](https://ca-test.adyen.com/) and enable WebSockets under **In-person payments** > **Terminal settings** > **Integrations**.

2. If you checked remotely, verify that the terminal wasn't turned off at the time.

3. If the terminal is turned on, restart the terminal.

## See also

* [Make a diagnosis request](https://adyen-preview.mintlify.site/point-of-sale/diagnostics/request-diagnosis.md)
* [Run connection tests from the terminal](https://adyen-preview.mintlify.site/point-of-sale/pos-troubleshooting/connection-tests.md)
* [Run hardware tests](https://adyen-preview.mintlify.site/point-of-sale/pos-troubleshooting/hardware-tests.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.