Tutorial
Following is an example to implement Company Status Inquiry (CheckCorpNums) API by adding the POPBiLL SDK within Java setting.
1. Add POPBiLL SDK
To add POPBiLL SpringBoot Starter, enter dependency information on “build.gradle” file of SpringBoot project, then Refresh it.
※ POPBiLL SpringBoot Starter is compatible with SpringBoot v1.0 and later and it is provided with POPBiLL Java SDK AutoConfiguration.
dependencies {
implementation 'kr.co.linkhub:popbill-spring-boot-starter:1.14.0'
}
2. POPBiLL SDK Setting
For SDK configuration setting, enter the code below within the application.yml file.
popbill:
#LinkID
linkId: TESTER
#SecretKey
secretKey: SwWxqU+0TErBXy/9TVjIPEnI0VTUMMSQZtJf3Ed8q3I=
#Stage setting value , true(TEST), false(PRODUCTION)
isTest: true
#Whether to recommend use of authentication token IP restriction function or not,
#recommended to use (true), to not use (false)
isIpRestrictOnOff: true
#Whether to use POPBiLL API service static IP or not,
#true – use, false- do not use, default(false)
useStaticIp: false
#Whether to use local system time or not,
#true – use(default – recommended), false – do not use
useLocalTimeYn: true
3. Implement CheckCorpNums Function
① To add Service Class Bean object Company Status Inquiry, add @Autowired annotation and CheckCorpNums API code.
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.popbill.api.CloseDownService;
import com.popbill.api.CorpState;
import com.popbill.api.PopbillException;
@Controller
public class ClosedownServiceController {
@Autowired
private CloseDownService closedownService;
@RequestMapping(value = "CheckCorpNums", method = RequestMethod.GET)
public String CheckCorpNum(Model m) {
// Business registration number of a POPBiLL user
String corpNum = "1234567890";
// Array of business registration numbers to search (Maximum : 1,000 inquiries)
String[] CorpNumList = new String[]{"1231212312","6798700433"};
try {
CorpState[] corpStates = closedownService.CheckCorpNum(corpNum, CorpNumList);
m.addAttribute("CorpStates", corpStates);
} catch (PopbillException e) {
// if an exceptional error occurs,
// check the error code with e.getCode()
// and check the error message with e.getMessage()
System.out.println("Error Code : " + e.getCode());
System.out.println("Error Message : " + e.getMessage());
}
return "response";
}
}
② Add response.html file that outputs the code and message of the API calling result.
<html xmlns:th="http://www.thymeleaf.org"">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Popbill SDK Response</title>
</head>
<body>
<fieldset th:each="CorpState, index : ${CorpStates}">
<ul>
<li>Business registration Number (corpNum) : <span th:text="${CorpState.corpNum}"></span></li>
<li>Taxation types (taxType) : <span th:text="${CorpState.taxType}"></span></li>
<li>Company status (state) : <span th:text="${CorpState.state}"></span></li>
<li>Date of business suspension/closure (stateDate) : <span th:text="${CorpState.stateDate}"></span></li>
<li>Date of taxation type change (typeDate) : <span th:text="${CorpState.typeDate}"></span></li>
<li>Confirmed date of status checking from the NTS (checkDate) : <span th:text="${CorpState.checkDate}"></span></li>
</ul>
</fieldset>
</body>
</html>
4. Check the Result
If the API calling is being processed successfully, Response code will be returned as “1” and if it fails, an error code(8-digits that starts with “-”) and error message will be returned to POPBiLL Exception. [Error Code]

