# diagnosis

> The diagnosis API is called by the POS to check the payment terminal status. Ensure to call this API before creating any payment request to ensure the payment terminal is ready to accept payment requests.

POST `/v2/device/diagnosis`

The **diagnosis** API is called by the POS to check the payment terminal status. Ensure to call this API before creating any payment request to ensure the payment terminal is ready to accept payment requests.

## Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

-   [Request header](https://docs.antom.com/ac/omnichannel/api_fund.md#NvOFY)
-   [Response header](https://docs.antom.com/ac/omnichannel/api_fund.md#neaKh)

### Request parameters

N/A

### Response parameters

| **Parameter name** | **Type** | **Required** | **Description** |
| --- | --- | --- | --- |
| _result_ | [Result](#wL6EK) | Yes | Result of the API call. |
| _networkStatus_ | String | Yes | Network connection status. Valid values are: - `Y`: Connected. - `N`: Not connected. Please check the network status and router, and reconnect the terminal device to the network. |
| _printerStatus_ | String | Yes | Printer status. Valid values are: - `Y`: Connected. - `N`: Not connected. Please check the terminal printer. |
| _globalStatus_ | String | Yes | Overall device status, used to prepare to receive requests. Valid values are: - `Y`: Connected. - `N`: Not connected. Please restart the terminal device. |

#### Result

| **Parameter name** | **Type** | **Required** | **Description** |
| --- | --- | --- | --- |
| _resultStatus_ | String | Yes | The result status. Valid values are: - `S`: Successful - `F`: Failed - `U`: Unknown |
| _resultCode_ | String | 否 | The result code. Maximum length: 64 characters |
| _resultMessage_ | String | 否 | The result message that describes the result code in detail. Maximum length: 256 characters |

## Result codes

| **_resultCode_** | **_resultStatus_** | **_resultMessage_** | **Further action** |
| --- | --- | --- | --- |
| `SUCCESS` | `S` | Success. | No action is required. |
| `PROCESS_FAIL` | `F` | A general business failure occurred. Do not retry. | Contact Antom Technical Support to troubleshoot the issue. |
| `INVALID_API` | `F` | The called API is invalid. | Check whether the correct API name is used when making the API call. API names are case-insensitive. |
| `CLIENT_INVALID` | `F` | The client ID is invalid. | Check whether the correct client ID is used. The payment terminal integration uses the serial number (SN) of the payment terminal as the client ID. |
| `INVALID_SIGNATURE` | `F` | The signature is not validated. | Refer to the sample code provided by D-Store during integration to check whether the correct public key, signed message, and signature algorithm are used. |
| `INVALID_ENCRPT_DATA` | `F` | The encrypted data is invalid. | Refer to the sample code provided by D-Store during integration to check whether the correct encrypted data is used. |
| `METHOD_NOT_SUPPORTED` | `F` | The server does not implement the requested HTTP method. | Ensure the HTTP method is `POST`. |
| `UNKNOWN_EXCEPTION` | `U` | An API calling is failed, which is caused by unknown reasons. | Call the API again. |

## Samples

The following code shows a response message:

```json
{
  "result":{
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "Success."
  },
  "networkStatus": "Y",
  "printerStatus": "Y",
  "globalStatus": "Y"
}
```