### Development Environment Setup Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Information on setting up the development environment, including access to the test environment and network configuration requirements. ```APIDOC ## Development Environment Setup ### Test Environment BaroBill provides a test environment that mirrors the production environment to facilitate development. You can use this for verifying data generated through the API and testing functionalities on the BaroBill site. **Test Environment Services:** * **Test BaroBill Site:** https://test.barobill.co.kr * **Test BaroBill FTP:** Provided for testing purposes. ### Firewall Configuration If your environment has outbound firewall restrictions, you will need to allow outbound connections to the BaroBill API servers. Please refer to the firewall configuration guide for specific details. ``` -------------------------------- ### ASP Integration Example Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Illustrates how to include and use BaroBill service classes within a Classic ASP environment for API interactions. ```APIDOC ## ASP Integration Example ### Description This example demonstrates how to integrate BaroBill APIs into a Classic ASP application. It shows the necessary file includes for the service classes and how to instantiate and use them to perform actions like registering tax invoices and sending faxes. ### Method N/A (Code Example) ### Endpoint N/A (Code Example) ### Parameters N/A ### Request Example ```asp <% Set BarobillTaxInvoiceService = New BaroService_TI Set BarobillFaxService = New BaroService_FAX '세금계산서 저장 Result1 = BarobillTaxInvoiceService.RegistTaxInvoice( ... ) '팩스 발송 Result2 = BarobillFaxService.SendFaxFromFTP( ... ) %> ``` ### Response N/A (Code Example) ``` -------------------------------- ### Visual Basic 6.0 Integration Example Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Provides guidance on using BaroBill API classes within Visual Basic 6.0 projects, including setting up project references. ```APIDOC ## Visual Basic 6.0 Integration Example ### Description This guide explains how to integrate BaroBill APIs into a Visual Basic 6.0 application. It covers downloading and including the necessary BaroBill classes and emphasizes the need to add a reference to 'Microsoft VBScript Regular Expressions 5.5' for regular expression handling. ### Method N/A (Code Example) ### Endpoint N/A (Code Example) ### Parameters N/A ### Request Example ```vb Set BarobillTaxInvoiceService = New BaroService_TI Set BarobillFaxService = New BaroService_FAX '세금계산서 저장 Result1 = BarobillTaxInvoiceService.RegistTaxInvoice( ... ) '팩스 발송 Result2 = BarobillFaxService.SendFaxFromFTP( ... ) ``` ### Response N/A (Code Example) ``` -------------------------------- ### ASP API Calls: RegistTaxInvoice and SendFaxFromFTP Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Shows how to include BaroBill service classes in an ASP application and instantiate them to call API methods. This example demonstrates calling RegistTaxInvoice and SendFaxFromFTP using BaroService_TI and BaroService_FAX objects, respectively. The provided directory structure indicates where the class files should be placed. ```asp <% Set BarobillTaxInvoiceService = New BaroService_TI Set BarobillFaxService = New BaroService_FAX '세금계산서 저장 Result1 = BarobillTaxInvoiceService.RegistTaxInvoice( ... ) '팩스 발송 Result2 = BarobillFaxService.SendFaxFromFTP( ... ) %> ``` -------------------------------- ### Java Integration Guide Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Detailed instructions for integrating BaroBill API with Java applications, including dependency management. ```APIDOC ## Java Integration Guide BaroBill provides JAR files for using the BaroBill API within Java applications. ### Downloadable JARs: * Java 21: barobill-api-sdk-java21.jar * Java 17: barobill-api-sdk-java17.jar * Java 11: barobill-api-sdk-java11.jar * Java 1.8: barobill-api-sdk-java8.jar * Java 1.7: barobill-api-sdk-java7.jar * Java 1.6: barobill-api-sdk-java6.jar ### Adding Dependencies You can add the JAR files to your project directly in your IDE (e.g., Eclipse, IntelliJ) or use build tools like Maven or Gradle. **Manual Addition:** Copy the `barobill-api-sdk-java[version].jar` file into the `libs` directory of your project. ``` Project ├── libs │ └── barobill-api-sdk-java[version].jar └── src ``` **Maven:** ```xml com.baroservice barobill-api-sdk 1.0 system ${project.basedir}/libs/barobill-api-sdk-java[version].jar ``` **Gradle:** ```groovy // Gradle dependencies { implementation files('libs/barobill-api-sdk-java[version].jar') } ``` ### Java 11+ Specific Dependencies If you are using Java 11 or later, you need to add the `webservices-rt` dependency as `rt.jar` was removed starting from Java 11 (deprecated in Java 9). **Maven:** ```xml org.glassfish.metro webservices-rt 2.4.4 ``` **Gradle:** ```groovy // Gradle dependencies { implementation 'org.glassfish.metro:webservices-rt:2.4.4' } ``` **Additional Dependencies for `txw2` or `ha-api` Exceptions:** If you encounter exceptions related to `txw2` or `ha-api`, add the following dependencies: **Maven:** ```xml org.glassfish.jaxb txw2 4.0.0 org.glassfish.ha ha-api 3.1.13 ``` **Gradle:** ```groovy // Gradle dependencies { implementation 'org.glassfish.jaxb:txw2:4.0.0' implementation 'org.glassfish.ha:ha-api:3.1.13' } ``` ``` -------------------------------- ### Java 프로젝트에 바로빌 API SDK 추가 (Maven) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Maven 빌드 도구를 사용하여 Java 프로젝트에 바로빌 API SDK JAR 파일을 의존성으로 추가하는 방법입니다. JAR 파일은 프로젝트의 libs 폴더에 위치해야 하며, `systemPath`를 통해 경로를 지정합니다. ```xml com.baroservice barobill-api-sdk 1.0 system ${project.basedir}/libs/barobill-api-sdk-java[버전].jar ``` -------------------------------- ### Java 프로젝트에 바로빌 API SDK 추가 (Gradle) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Gradle 빌드 도구를 사용하여 Java 프로젝트에 바로빌 API SDK JAR 파일을 의존성으로 추가하는 방법입니다. JAR 파일은 프로젝트의 libs 폴더에 위치해야 합니다. ```groovy // Gradle dependencies { implementation files('libs/barobill-api-sdk-java[버전].jar') } ``` -------------------------------- ### Get Tax Invoice States (Multiple) Source: https://dev.barobill.co.kr/docs/guides/%EC%84%B8%EA%B8%88%EA%B3%84%EC%82%B0%EC%84%9C-%EC%9C%84%EC%88%98%ED%83%81-%EB%B0%9C%EA%B8%89%ED%95%98%EA%B8%B0 Retrieves the states of multiple tax invoices simultaneously using the GetTaxInvoiceStatesEX API. ```APIDOC ## GetTaxInvoiceStatesEX ### Description Retrieves the states of multiple tax invoices concurrently. ### Method GET (Assumed, based on function name) ### Endpoint `/api/taxinvoice/states` (Assumed) ### Parameters #### Query Parameters - **certificateKey** (string) - Required - The authentication key for the API. - **receiverCorpNum** (string) - Required - The business registration number of the receiver. - **taxInvoiceNums** (array of strings) - Required - An array of management numbers for the tax invoices. ### Response #### Success Response (200) - An array of `TaxInvoiceStateEX` objects, each containing: - **BarobillState** (integer) - The state code of the tax invoice. - **NTSSendState** (integer) - The NTS transmission state. #### Response Example ```json [ { "BarobillState": 3014, "NTSSendState": 4 }, { "BarobillState": 1000, "NTSSendState": 0 } ] ``` ### Error Handling If the `BarobillState` of the first element in the response array is less than 0, an API call error occurred. Use `GetErrString` with the `certificateKey` and the `BarobillState` to retrieve the error message. ``` -------------------------------- ### Get Tax Invoice State (Single) Source: https://dev.barobill.co.kr/docs/guides/%EC%84%B8%EA%B8%88%EA%B3%84%EC%82%B0%EC%84%9C-%EC%9C%84%EC%88%98%ED%83%81-%EB%B0%9C%EA%B8%89%ED%95%98%EA%B8%B0 Retrieves the current state of a single tax invoice using the GetTaxInvoiceStateEX API. ```APIDOC ## GetTaxInvoiceStateEX ### Description Retrieves the current state of a tax invoice. ### Method GET (Assumed, based on function name) ### Endpoint `/api/taxinvoice/state` (Assumed) ### Parameters #### Query Parameters - **certificateKey** (string) - Required - The authentication key for the API. - **receiverCorpNum** (string) - Required - The business registration number of the receiver. - **taxInvoiceNum** (string) - Required - The management number of the tax invoice. ### Response #### Success Response (200) - **BarobillState** (integer) - The state code of the tax invoice. Negative values indicate API call failure. - **NTSSendState** (integer) - The NTS (National Tax Service) transmission state. #### Response Example ```json { "BarobillState": 3014, "NTSSendState": 1 } ``` ### Error Handling If `BarobillState` is less than 0, an error occurred. Use `GetErrString` with the `certificateKey` and `BarobillState` to get the error message. ``` -------------------------------- ### 파일 첨부하기 C# Source: https://dev.barobill.co.kr/docs/guides/%EC%A0%84%EC%9E%90%EB%AC%B8%EC%84%9C-%EB%B0%9C%EA%B8%89%ED%95%98%EA%B8%B0 AttachFileByFTP API를 사용하여 전자문서에 최대 5개의 파일을 첨부하는 방법을 설명합니다. API 호출 실패 시 오류 메시지를 처리하며, 첨부된 파일의 조회 및 삭제는 별도 API를 참고해야 합니다. ```csharp int result = barobill.AttachFileByFTP("연동인증키", "공급자 사업자번호", "공급자 아이디", "공급자 관리번호", ... ); if (result < 0) { // API 호출 실패 // 오류코드 내용에 따라 파라메터를 수정하여 다시 실행해주세요. String errMessage = barobill.GetErrString("연동인증키", result); } else { // 성공 } ``` -------------------------------- ### Java 11+ 환경에서 JAXB 관련 의존성 추가 (Gradle) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Java 11 이상 버전에서 바로빌 API SDK 사용 시 발생할 수 있는 txw2 또는 ha-api 관련 예외 처리를 위한 추가 Gradle 의존성입니다. JAXB 관련 라이브러리를 명시적으로 추가합니다. ```groovy // Gradle dependencies { implementation 'org.glassfish.jaxb:txw2:4.0.0' implementation 'org.glassfish.ha:ha-api:3.1.13' } ``` -------------------------------- ### PowerBuilder: 운영 환경용 Proxy 파일 생성 및 배포 Source: https://dev.barobill.co.kr/docs/guides/%EC%9A%B4%EC%98%81%EC%A0%84%ED%99%98 PowerBuilder에서 운영 환경으로 전환하기 위해, 개발준비 > PowerBuilder 연동방법 섹션의 2번 항목부터 다시 진행하여 운영 환경용 Proxy 파일을 생성합니다. 3번 단계에서 WSDL 파일 이름에 운영 환경 URL을 지정하고, 생성된 Proxy 파일은 우클릭 후 'Deploy'합니다. -------------------------------- ### Get Tax Invoice States EX (Multiple) Source: https://dev.barobill.co.kr/docs/guides/%EC%84%B8%EA%B8%88%EA%B3%84%EC%82%B0%EC%84%9C-%EC%97%AD%EB%B0%9C%ED%96%89%ED%95%98%EA%B8%B0 Retrieves the statuses of multiple tax invoices simultaneously using the GetTaxInvoiceStatesEX API. This is efficient for synchronizing states in bulk. ```APIDOC ## GET /api/taxinvoice/states/ex ### Description Retrieves the current statuses for multiple tax invoices in a single request. This is particularly useful for bulk status synchronization and for updating local databases with the latest invoice states. ### Method GET ### Endpoint `/api/taxinvoice/states/ex` ### Parameters #### Path Parameters None #### Query Parameters - **authToken** (string) - Required - Authentication token for the API. - **businessNumber** (string) - Required - Business registration number of the recipient. - **managementNumbers** (array of strings) - Required - An array of management numbers for the tax invoices to query. ### Request Example ```json { "authToken": "YOUR_AUTH_TOKEN", "businessNumber": "RECIPIENT_BUSINESS_NUMBER", "managementNumbers": ["MANAGE_NUM1", "MANAGE_NUM2", "MANAGE_NUM3"] } ``` ### Response #### Success Response (200) - **taxInvoiceStates** (array of objects) - An array where each object contains the status details for a tax invoice. - **barobillState** (integer) - BaroBill internal state code for the tax invoice. - **ntsSendState** (integer) - National Tax Service transmission status code. #### Response Example ```json [ { "barobillState": 3021, "ntsSendState": 4 }, { "barobillState": 1000, "ntsSendState": 0 } ] ``` ### Error Handling If the first element's `barobillState` is negative, use `barobill.GetErrString(authToken, taxInvoiceStates[0].barobillState)` to retrieve the error message. Subsequent elements might contain valid data even if an error occurred for some items. ``` -------------------------------- ### .NET Framework 3.0+: 바로빌 API 서비스 참조 및 호출 Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 .NET Framework 3.0 이상 버전에서 Visual Studio의 '서비스 참조 추가' 기능을 사용하여 바로빌 API를 프로젝트에 참조하고, 세금계산서 및 팩스 기능을 호출하는 방법을 C# 코드로 보여줍니다. 서비스별로 별도의 네임스페이스를 지정해야 합니다. ```csharp namespace TestApp { class Test { private Barobill_TaxInvoice.BaroService_TISoapClient barobillTaxInvoiceService; private Barobill_Fax.BaroService_FAXSoapClient barobillFaxService; public Test() { this.barobillTaxInvoiceService = new Barobill_TaxInvoice.BaroService_TISoapClient(); this.barobillFaxService = new Barobill_Fax.BaroService_FAXSoapClient(); } public do() { // 세금계산서 저장 int result1 = this.barobillTaxInvoiceService.RegistTaxInvoice( ... ); // 팩스 전송 String result2 = this.barobillFaxService.SendFaxFromFTP( ... ); } } } ``` -------------------------------- ### Get Tax Invoice State EX Source: https://dev.barobill.co.kr/docs/guides/%EC%84%B8%EA%B8%88%EA%B3%84%EC%82%B0%EC%84%9C-%EC%97%AD%EB%B0%9C%ED%96%89%ED%95%98%EA%B8%B0 Retrieves the current status of a tax invoice using the GetTaxInvoiceStateEX API. This is useful for tracking the lifecycle of invoices, especially for reverse-issued ones. ```APIDOC ## GET /api/taxinvoice/state/ex ### Description Retrieves the detailed current status of a specific tax invoice. This API is crucial for monitoring the invoice's progress through various stages, including temporary storage, issuance requests, rejections, cancellations, and National Tax Service transmission. ### Method GET ### Endpoint `/api/taxinvoice/state/ex` ### Parameters #### Path Parameters None #### Query Parameters - **authToken** (string) - Required - Authentication token for the API. - **businessNumber** (string) - Required - Business registration number of the recipient. - **managementNumber** (string) - Required - Management number of the tax invoice. ### Request Example ```json { "authToken": "YOUR_AUTH_TOKEN", "businessNumber": "RECIPIENT_BUSINESS_NUMBER", "managementNumber": "RECIPIENT_MANAGEMENT_NUMBER" } ``` ### Response #### Success Response (200) - **taxInvoiceState** (object) - An object containing the tax invoice status details. - **barobillState** (integer) - BaroBill internal state code for the tax invoice. - **ntsSendState** (integer) - National Tax Service transmission status code. #### Response Example ```json { "taxInvoiceState": { "barobillState": 3021, "ntsSendState": 4 } } ``` #### Status Code Interpretation - **BarobillState:** - 1000: 임시저장 (Temporary Storage) - 2020: 역발행요청 발급대기 (Reverse Issue Request Pending Issuance) - 4022: 역발행요청 거부 (Reverse Issue Request Rejected) - 5023: 역발행요청 취소 (Reverse Issue Request Cancelled) - 3021: 역발행요청 발급완료 (Reverse Issue Request Issued) - **NTSSendState:** - 1: 국세청 전송전 (Not Sent to NTS) - 2: 국세청 전송중 (Sending to NTS) - 3: 국세청 전송실패 (NTS Transmission Failed) - 4: 국세청 전송성공 (NTS Transmission Successful) ### Error Handling If `taxInvoiceState.barobillState` is negative, use `barobill.GetErrString(authToken, taxInvoiceState.barobillState)` to retrieve the error message. ``` -------------------------------- ### Java 11+ 환경에서 JAXB 관련 의존성 추가 (Maven) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Java 11 이상 버전에서 바로빌 API SDK 사용 시 발생할 수 있는 txw2 또는 ha-api 관련 예외 처리를 위한 추가 Maven 의존성입니다. JAXB 관련 라이브러리를 명시적으로 추가합니다. ```xml org.glassfish.jaxb txw2 4.0.0 org.glassfish.ha ha-api 3.1.13 ``` -------------------------------- ### SOAP Client Initialization and Usage (PHP) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Demonstrates how to initialize SoapClients for BaroBill services (Tax Invoice and Fax) and make basic API calls. ```APIDOC ## SOAP Client Initialization and Usage (PHP) ### Description This section shows how to create SOAP clients for interacting with BaroBill's Tax Invoice (TI) and Fax services using PHP. It includes examples of initializing the clients with WSDL URLs and making sample API calls like `RegistTaxInvoice` and `SendFaxFromFTP`. ### Method N/A (Code Example) ### Endpoint N/A (Code Example) ### Parameters N/A ### Request Example ```php $BaroService_TI = new SoapClient('https://testws.baroservice.com/TI.asmx?wsdl', array( 'trace' => 'true', 'encoding' => 'UTF-8' )); $BaroService_FAX = new SoapClient('https://testws.baroservice.com/FAX.asmx?wsdl', array( 'trace' => 'true', 'encoding' => 'UTF-8' )); // 세금계산서 저장 $Result1 = $BaroService_TI->RegistTaxInvoice(array( ... ))->RegistTaxInvoiceResult; // 팩스 전송 $Result2 = $BaroService_FAX->SendFaxFromFTP(array( ... ))->SendFaxFromFTPResult; ``` ### Response N/A (Code Example) ``` -------------------------------- ### Synchronize Tax Invoice States - C# Source: https://dev.barobill.co.kr/docs/guides/%EC%84%B8%EA%B8%88%EA%B3%84%EC%82%B0%EC%84%9C-%EB%B0%9C%EA%B8%89%ED%95%98%EA%B8%B0 Synchronizes tax invoice states by periodically querying their status using GetTaxInvoiceStatesEX. This guide recommends updating local databases when invoices reach a 'completed' state to prevent redundant checks. ```csharp TaxInvoiceStateEX[] taxInvoiceStates = barobill.GetTaxInvoiceStatesEX("연동인증키", "공급자 사업자번호", ["공급자 관리번호", "공급자 관리번호", ... ]); if (taxInvoiceStates[0].BarobillState < 0) {// API 호출 실패 // 오류코드 내용에 따라 파라메터를 수정하여 다시 실행해주세요. String errMessage = barobill.GetErrString("연동인증키", taxInvoiceStates[0].BarobillState); } else { // 세금계산서 상태 조회 for (int i = 0; i < taxInvoiceStates.length; i++) { if (taxInvoiceStates[i].BarobillState == 1000) { // 임시저장 상태 // 미완료 } else if (taxInvoiceStates[i].BarobillState == 5031) { // 발급취소 상태 // 완료 → 파트너 프로그램 DB에 반영하여 재조회 방지 } else if (taxInvoiceStates[i].BarobillState == 3014) { // 발급완료 상태 if (taxInvoiceStates[i].NTSSendState == 1) { // 국세청 전송전 // 미완료 } else if (taxInvoiceStates[i].NTSSendState == 2 || taxInvoiceStates[i].NTSSendState == 3) { // 국세청 전송중 // 미완료 } else if (taxInvoiceStates[i].NTSSendState == 4) { // 국세청 전송성공 // 완료 → 파트너 프로그램 DB에 반영하여 재조회 방지 } else if (taxInvoiceStates[i].NTSSendState == 5) { // 국세청 전송실패 // 완료 → 파트너 프로그램 DB에 반영하여 재조회 방지 } } } } ``` -------------------------------- ### 중복 체크 기준 Source: https://dev.barobill.co.kr/docs/guides/%EA%B3%84%EC%A2%8C-%EC%9E%85%EC%B6%9C%EA%B8%88%EB%82%B4%EC%97%AD-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0 입출금 내역을 파트너 프로그램 DB에 저장할 때 중복 저장을 방지하기 위한 기준을 설명합니다. 계좌 번호와 입출금 키의 조합을 사용합니다. ```APIDOC ## 중복 체크 기준 ### Description 바로빌 API에서 조회된 입출금 내역을 파트너 프로그램의 데이터베이스에 저장할 때, 중복 저장을 방지하기 위한 기준을 안내합니다. ### Method Not Applicable ### Endpoint Not Applicable ### Parameters None ### Request Example None ### Response #### Success Response None #### Response Example None ### 중복 체크 방법 입출금 내역의 중복 여부를 판단하기 위해 다음 두 가지 항목을 조합하여 사용합니다: 1. **계좌 번호 (BankAccountNum)**: 입출금 거래가 발생한 계좌의 번호입니다. 2. **입출금 키 (TransRefKey)**: 각 입출금 거래를 고유하게 식별하는 키입니다. 파트너 프로그램에서는 API 응답에서 받은 `BankAccountNum`과 `TransRefKey` 값을 함께 사용하여 데이터베이스에 저장된 기록과 비교해야 합니다. 이 두 값이 모두 일치하는 경우, 해당 거래는 이미 저장된 것으로 간주하고 중복 저장을 방지합니다. ``` -------------------------------- ### Get Tax Invoice Popup URL - C# Source: https://dev.barobill.co.kr/docs/guides/%ED%99%88%ED%83%9D%EC%8A%A4-%EB%A7%A4%EC%9E%85%EB%A7%A4%EC%B6%9C%EC%9E%90%EB%A3%8C-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0 Generates a URL to display a tax invoice in a popup window. Useful for providing a user-friendly interface to view tax invoice details. Includes error handling for API calls that return negative numeric strings. ```csharp String url = barobill.GetTaxInvoicePopUpURLNK("연동인증키", "사업자번호", "국세청 승인번호", ... ); if (url 값이 음수로 된 다섯자리 숫자형식이라면?) { // API 호출 실패 // 오류코드 내용에 따라 파라메터를 수정하여 다시 실행해주세요. String errMessage = barobill.GetErrString("연동인증키", (int) url); } else { // 성공 // url 을 팝업으로 띄우기 } ``` -------------------------------- ### Get KakaoTalk History URL Source: https://dev.barobill.co.kr/docs/guides/%EC%B9%B4%EC%B9%B4%EC%98%A4%ED%86%A1-%EC%A0%84%EC%86%A1%ED%95%98%EA%B8%B0 Provides a URL to retrieve the KakaoTalk message history. This is recommended for partners who only need to display the message history to users, rather than developing a custom list feature. It simplifies the process of showing message history by leveraging the provided URL. ```APIDOC ## GET /GetKakaotalkHistoryURL ### Description Retrieves a URL to display the KakaoTalk message history. This is a convenient way for partners to show message history to users without custom development. ### Method GET ### Endpoint `/GetKakaotalkHistoryURL` ### Parameters #### Path Parameters None #### Query Parameters - **certificationKey** (string) - Required - The authentication key for the BaroBill service. - **businessNumber** (string) - Required - The business registration number. - **userId** (string) - Required - The ID of the user whose history is being requested. - **...** (other optional parameters may be available depending on specific history filtering needs) ### Request Example ```json { "certificationKey": "your_certification_key", "businessNumber": "your_business_number", "userId": "user123" } ``` ### Response #### Success Response (200) - **url** (string) - A URL pointing to the KakaoTalk message history. This URL can be opened in a browser popup. #### Error Response (negative five-digit number string) - **url** (string) - A string representing a negative five-digit number, indicating an error code. #### Response Example ```json { "url": "https://example.barobill.com/history?token=abcdef12345" } ``` #### Error Handling Example (within provided code) ```java String url = barobill.GetKakaotalkHistoryURL("연동인증키", "사업자번호", "아이디"); if (url.startsWith("-")) { // API 호출 실패, URL is a negative number string int errorCode = Integer.parseInt(url); String errMessage = barobill.GetErrString("연동인증키", errorCode); System.err.println("Error: " + errMessage); } else { // 성공 // 브라우저 popup 으로 url 열기 System.out.println("History URL: " + url); } ``` ``` -------------------------------- ### 카드 사용내역 조회 (GetCardApprovalLog API) - C# Source: https://dev.barobill.co.kr/docs/guides/%EC%B9%B4%EB%93%9C-%EC%82%AC%EC%9A%A9%EB%82%B4%EC%97%AD-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0 GetCardApprovalLog API를 호출하여 카드 사용내역을 조회하는 C# 샘플 코드입니다. 페이지별로 사용내역을 조회하며, 최대 페이지 수보다 현재 페이지가 적을 경우 다음 페이지를 계속 조회합니다. 연동인증키, 사업자번호, 조회 기준 등의 파라미터와 현재 페이지 번호를 전달합니다. 반환된 PagedCardApprovalLog 객체를 통해 카드번호, 사용일시, 승인금액 등의 정보를 얻을 수 있습니다. ```csharp int currentPage = 1; PagedCardApprovalLog pagedCardApprovalLog = barobill.GetCardApprovalLog("연동인증키", "사업자번호", ... , currentPage); // 첫번째 페이지 조회 while (pagedCardApprovalLog.MaxPageNum > currentPage) { // 다음 페이지 유무 확인 for (int i = 0; i < pagedCardApprovalLog.CardLogList.length; i++) { // 사용내역 목록 loop // 카드 사용내역 정보 String cardNum = pagedCardApprovalLog.CardLogList[i].CardNum; // 카드번호 String useDT = pagedCardApprovalLog.CardLogList[i].UseDT; // 사용일시 String cardApprovalCost = pagedCardApprovalLog.CardLogList[i].CardApprovalCost; // 승인금액 . . . } currentPage++; pagedCardApprovalLog = barobill.GetCardApprovalLog("연동인증키", "사업자번호", ... , currentPage); // 다음 페이지 조회 } ``` -------------------------------- ### Get Cash Bill Scrap Request URL API (GetCashBillScrapRequestURL) Source: https://dev.barobill.co.kr/docs/guides/%ED%99%88%ED%83%9D%EC%8A%A4-%EB%A7%A4%EC%9E%85%EB%A7%A4%EC%B6%9C%EC%9E%90%EB%A3%8C-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0 현금영수증 서비스 신청 화면 URL을 반환하는 GetCashBillScrapRequestURL API 호출 예제입니다. API 호출 실패 시 오류 코드를 반환하며, 성공 시 반환된 URL을 브라우저 팝업으로 엽니다. ```Java String url = barobill.GetCashBillScrapRequestURL("연동인증키", "사업자번호", "아이디", ... ); if (url 의 값이 음수로 된 다섯자리 숫자형식이라면?) { // API 호출 실패 String errMessage = barobill.GetErrString("연동인증키", (int) url); } else { // 성공 // 브라우저 popup 으로 url 열기 } ``` -------------------------------- ### Get Tax Invoice Scrap Request URL API (GetTaxInvoiceScrapRequestURL) Source: https://dev.barobill.co.kr/docs/guides/%ED%99%88%ED%83%9D%EC%8A%A4-%EB%A7%A4%EC%9E%85%EB%A7%A4%EC%B6%9C%EC%9E%90%EB%A3%8C-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0 세금계산서 서비스 신청 화면 URL을 반환하는 GetTaxInvoiceScrapRequestURL API 호출 예제입니다. API 호출 실패 시 오류 코드를 반환하며, 성공 시 반환된 URL을 브라우저 팝업으로 엽니다. ```Java String url = barobill.GetTaxInvoiceScrapRequestURL("연동인증키", "사업자번호", "아이디", ... ); if (url 의 값이 음수로 된 다섯자리 숫자형식이라면?) { // API 호출 실패 String errMessage = barobill.GetErrString("연동인증키", (int) url); } else { // 성공 // 브라우저 popup 으로 url 열기 } ``` -------------------------------- ### Java 11+ 환경에서 Metro Web Services 의존성 추가 (Maven) Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Java 11 이상 버전에서 바로빌 API SDK 사용 시 필요한 Metro Web Services 런타임 의존성을 Maven을 사용하여 추가하는 방법입니다. 이는 Java 11부터 rt.jar가 제거되었기 때문에 필요합니다. ```xml org.glassfish.metro webservices-rt 2.4.4 ``` -------------------------------- ### Sample Source Code Download Source: https://dev.barobill.co.kr/docs/guides/%EB%B0%94%EB%A1%9C%EB%B9%8C-API-%EA%B0%9C%EB%B0%9C%EC%A4%80%EB%B9%84 Links to download sample source code for various development environments to assist with API integration. ```APIDOC ## Sample Source Code Download Download sample source code tailored to your development environment to understand how to integrate with the BaroBill API. | Development Environment | Integration Guide | Sample Source Download | |---|---|---| | Java | Integration Guide | Sample Source Download | | .NET Framework | Integration Guide | Sample Source Download | | Python | Integration Guide | Sample Source Download | | Node.js | Integration Guide | Sample Source Download | | PowerBuilder | Integration Guide | Sample Source Download | | Delphi | Integration Guide | Sample Source Download | | PHP | Integration Guide | Sample Source Download | | Classic ASP | Integration Guide | Sample Source Download | | Visual Basic 6.0 | Integration Guide | Sample Source Download | ``` -------------------------------- ### Get SMS History URL (Java) Source: https://dev.barobill.co.kr/docs/guides/%EB%AC%B8%EC%9E%90-%EC%A0%84%EC%86%A1%ED%95%98%EA%B8%B0 This code snippet shows how to obtain a URL for displaying SMS history using the GetSMSHistoryURL API. It requires an API key, business registration number, and user ID. The returned URL, if negative and a five-digit number, indicates an API call failure and error details can be retrieved using GetErrString. ```java String url = barobill.GetSMSHistoryURL("연동인증키", "사업자번호", "아이디", ... ); if (url 의 값이 음수로 된 다섯자리 숫자형식이라면?) { // API 호출 실패 // 오류코드 내용에 따라 파라메터를 수정하여 다시 실행해주세요. String errMessage = barobill.GetErrString("연동인증키", (int) url); } else { // 성공 // 브라우저 popup 으로 url 열기 } ```