Skip to main content

OTC Inquiry

This API retrieves OTC (One Time Code) information (Track2) required for offline face-to-face payments (Kiosk, POS, etc.).

Precautions
  • For security reasons, the OTC Inquiry API is only available to authorized partners, and API calls are only processed from pre-registered IP addresses.
    • Before integration, please ensure that the Public IP of the partner server is registered through your sales representative.
  • The approval request must be sent within 180 seconds after the OTC inquiry. Subsequent approval requests may be declined.
info
  • OTC information (Track2) is delivered encrypted using the RSA public key provided in the request (RSA/ECB/PKCS1Padding).
  • The partner should decrypt the encrypted OTC information (Track2) using their private key before initiating the approval request to the terminal.
Java Example: RSA Public/Private Key Generation
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(2048);

KeyPair keyPair = keyPairGenerator.genKeyPair();

String privateKey = new String(Base64.encodeBase64(keyPair.getPrivate().getEncoded()));
String publicKey = new String(Base64.encodeBase64(keyPair.getPublic().getEncoded()));

Request

Request URL
POST https://{API Domain}/easycheck/merchant-otcs.do
Content-type: application/json; charset=euc-kr

Parameters

FieldTypeLengthRequiredDescription
authorizationIdString60 ByteTransaction Authorization ID
publicKeyString512 BytePartner's RSA Public Key (Base64 encoded)
Request Example
{  
"authorizationId": "{Authorization ID}",
"publicKey": "{Partner RSA Public Key}"
}

Response

Parameters

FieldTypeLengthDescription
resCdString4 ByteResult Code (Success: "0000")
resMsgString1000 ByteResult Message
shopTransactionIdString60 ByteUse the same value sent during transaction authentication registration
shopOrderNoString40 ByteUse the same value sent during transaction authentication registration
authorizationIdString60 ByteUse the same value sent in the request
encOtcString400 ByteEncrypted OTC Information (RSA/ECB/PKCS1Padding)
shopParameterString4000 BytePartner Reserved Field
Response Example
{
"resCd": "0000",
"resMsg": "Success",
"shopTransactionId": "{API Idempotency Key}",
"shopOrderNo": "{Partner Order No}",
"authorizationId": "{Authorization ID}",
"encOtc": "{Encrypted OTC Information}",
"shopParameter": "{Partner Reserved Field}"
}