🖱️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.
What is a customer_uid?
It is a unique value specified by the merchant that maps 1:1 with the billing key issued by PG. A unique customer_uid
must be created for each card.
Example: If a customer named Hong Gildong requests for a billing key from A card, the customer_uid must be issued for the specified member's credit card number.
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.)
Credit card information required for billing key
Credit card number
Credit card expiration
DOB
First 2-digits of card password
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.
Request billing key and make payment at once
By using the key-in payment REST API/subscribe/payments/onetime
, you can get the billing key and make a payment in a single API call.
Last updated