diagnosis

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 parameters

N/A

Response parameters

Parameter name

Type

Required

Description

result

Result

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:

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