🖱️REST API
Easily get a billing key using the i'mport REST API.
You can use the i'mport REST API to request for a billing key to make a payment request. When you request for a billing key with the customer's credit card information, the i'mport server calls the PG's API to get a billing key. The card information is not saved during this process. This method has the following pros/cons:
Pros: can customize card registration form.
Cons: must specify the Terms of Use and Privacy Policy, PG and credit card companies' requirements are strict for this service, and must take precautions to protect personal information.
If you are planning to develop a merchant UI/UX-friendly payment environment, API integration is the right choice.
STEP 01. Accept credit card information
Add input fields for card information as shown below. Create a hidden field to store the customer_uid to send to the server upon form submission. For corporate cards (excluding cards issued under an employee's name), enter a 10-digit business registration number for the birth parameter. The following example calls a POST request for /subscription/issue-billing with input values and customer_uid when you click the Pay button.
If you reuse the customer_uid used to get the existing billing key, the existing billing key will be replaced with the new billing key issued on the new card number. (The billing key that maps to the existing card will be deleted.)
<form action="{service URL to receive billing key request}", method="post">
<!--Example: https://www.myservice.com/subscription/issue-billing-->
<div>
<label for="card_number">card number XXXX-XXXX-XXXX-XXXX</label>
<input id="card_number" type="text" name="card_number">
</div>
<div>
<label for="expiry">card expiration YYYY-MM</label>
<input id="expiry" type="text" name="expiry">
</div>
<div>
<label for="birth">DOB YYMMDD</label>
<input id="birth" type="text" name="birth">
</div>
<div>
<label for="pwd_2digit">first 2-digits of card password XX</label>
<input id="pwd_2digit" type="text" name="pwd_2digit">
</div>
<input hidden type="text" value="gildong_0001_1234" name="customer_uid">
<input type="submit" value="Pay">
</form>STEP 02. Extract card information
Create an API endpoint to extract the card information from the request body. The following is a sample API endpoint that processes a POST request to /subscription/issue-billing.
STEP 03. Request billing key and handle response
Request for a billing key by using the i'mport Get billing key REST API and return a response based on the result code.
To use the i'mport REST API, you must first get an access token.
Last updated
