POPBill Developers
API Reference

ETC header

The POPBiLL API allows you to set additional headers to specify the language of the response message and the encoding method.

Accept-Encoding

When the client sets an Accept-Encoding value in the request header, the POPBiLL API returns an encoded response. An encoded response reduces network transfer size and helps improve response speed when retrieving large amounts of data.

Accept-Encoding: gzip

If the client does not send the Accept-Encoding header, the server generally returns a response without compression. To receive a compressed response such as gzip, the client must support the requested compression method and be able to correctly decompress the response body.

Accept-Language

Response messages from the POPBiLL API are provided in Korean by default. If an English response is required, you can set the Accept-Language value in the API request header to specify the response message language as English.

Accept-Language: en-US

X-PB-Message-Digest

When calling the bulk issuance (Bulk) API, to verify the integrity of the request body, you must generate a MessageDigest value for the body and include it in the X-PB-Message-Digest item of the request header when sending the request.

Sample code

This is sample code that hashes the request body with SHA-1 and then encodes it with Base64.

#!/bin/bash

BODY=$(cat << 'EOF'
{
    "cashbills": [
        {
            "mgtKey": "TEST0004",
            "tradeType": "승인거래",
            "tradeUsage": "지출증빙용",
            "taxationType": "과세",
            "totalAmount": "11000",
            "supplyCost": "10000",
            "tax": "1000",
            "serviceFee": "0",
            "franchiseCorpNum": "1234567890",
            "identityNum": "1234567890"
        }
    ]
  }
EOF
)

MessageDigest=$(printf '%s' "$BODY" | openssl dgst -sha1 -binary | base64)

echo $MessageDigest

Check result

cQ0I0lm8CqcLsp1DwnY9r/Q/iis=

요청 예시

curl --request POST \
  --url 'https://{domain}/Cashbill' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: BULKISSUE' \
  --header 'X-PB-SUBMIT-ID: {submitID}' \
  --header 'X-PB-MESSAGE-DIGEST: cQ0I0lm8CqcLsp1DwnY9r/Q/iis=' \
  --data '{
    "cashbills": [
        {
            "mgtKey": "TEST0004",
            "tradeType": "승인거래",
            "tradeUsage": "지출증빙용",
            "taxationType": "과세",
            "totalAmount": "11000",
            "supplyCost": "10000",
            "tax": "1000",
            "serviceFee": "0",
            "franchiseCorpNum": "1234567890",
            "identityNum": "1234567890"
        }
    ]
  }'

If the JSON string of the request body changes due to differences in spaces or line breaks, the hash value also changes. You must generate the MessageDigest using the exact JSON string that is actually used in the request.