i'mport JavaScript SDK


You can use the i'mport JavaScript SDK to open the payment or identity verification page from your website or app.

For version history and notable changes in each version, please refer to the Release Notes.

Loading SDK Library

To use the i'mport JavaScript SDK, you must first load the library on the page as shown below. It is recommended to load it from the CDN (https://cdn.iamport.kr/js/iamport.payment-{SDK-latest-version}.js). When the library is loaded, you can call IMP functions by accessing the IMP global object as a property of the window object.

For the latest library version information, check the JavaScript SDK Release Notes page.
  <!-- jQuery -->
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js" ></script>
  <!-- iamport.payment.js -->
  <script type="text/javascript" src="https://cdn.iamport.kr/js/iamport.payment-{SDK-latest-version}.js"></script>

You must install jQuery 1.0 or later version.

Global Object: IMP

IMP Functions

request_pay

certification

request_pay(param, callback)

Calls the payment window in an iframe or redirection method depending on the PG or payment environment.

Parameters

param (Object)

The information needed for payment approval.

Properties

Property

* Required
Type

(Default value)
Description
pg

(Supported from v1.1.0)
string Identifies a PG when using multiple PGs with one i'mport account

If this is missing or there is no matching PG, the default PG set in the Admin Console is called

Format: [PG service code] or [PG service code].[PG merchant ID]

PG Service Codes
  • html5_inicis(INICIS for web standard)
  • inicis(INICIS ActiveX window)
  • kcp(NHN KCP)
  • kcp_billing(NHN KCP subscription pay)
  • uplus(Toss Payments (previously LG U+))
  • nice(NICE Pay)
  • jtnet(JTNet)
  • kicc(KICC)
  • bluewalnut(BlueWalnut)
  • kakaopay(Kakao Pay)
  • danal(Danal mobile micropayment)
  • danal_tpay(Danal general payment)
  • mobilians(Mobilians Mobile micropayment)
  • chai(CHAI simple payment)
  • syrup(Syrup Pay)
  • payco(PAYCO)
  • paypal(PayPal)
  • eximbay(Eximbay)
  • naverpay(Naver Pay - payment method)
  • naverco(Naver Pay - Naver checkout)
  • smilepay(SmilePay)
  • alipay(Alipay)


pay_method*string

(card)
Payment method

Options
  • card(credit card)
  • trans(instant account transfer)
  • vbank(virtual account)
  • phone(mobile micropayment)
  • samsung(Samsung pay: for INICIS/KCP)
  • kpay(KPay app: for INICIS)
  • kakaopay(Kakao Pay: for INCIS/KCP/NICE payments)
  • payco(PAYCO: for INICIS/KCP)
  • lpay(LPAY: for INICIS)
  • ssgpay(SSG Pay: for INICIS)
  • tosspay(Toss simple pay: for INICIS)
  • cultureland(Cultureland: for INICIS/Toss Payments (previously LG U+)/KCP)
  • smartculture(Smart Culture: for INICIS/Toss Payments (previously LG U+)/KCP)
  • happymoney(Happy Money: for INICIS/KCP)
  • booknlife(Book culture gift certificate: for Toss Payments (previously LG U+)/KCP)
  • point(points, e.g., Benepia: for KCP)
escrowboolean

(false)
Option to open escrow payment page
merchant_uid*stringUnique order ID generated/managed by the merchant

You cannot use a merchant_uid that has already been approved (status: paid) for another payment
namestringOrder name

Input is recommended for seamless payment information check

Recommended length: 16 characters (varies by PG)
amount*numberPayment amount
custom_dataobjectAdditional order information specified by merchant

Saved as json notation (string)
tax_freenumberTax free amount (out of amount)

More on tax exemptions
vat

Deprecated
numberTaxable amount (out of amount)

When applying mixed taxation, it is recommended to use the tax_free property for more accurate calculations.
currencystring

(KRW)
Currency

For PayPal, USD is the default value as PayPal does not support KRW

For currencies supported by PayPal: PayPal Supported Currencies

Options
  • KRW
  • USD
  • EUR
  • JPY


languagestring

(ko)
Language for payment page
  • KG INICIS/Toss Payments (previously LG U+)/NICE Payments: en or ko (KG INICIS and NICE Payments only support PC payment window)
  • PayPal: 2-digit locale code (PayPal Locale Codes)
buyer_namestringBuyer name
buyer_tel*stringBuyer phone (some PGs throw an error if this is not specified)
buyer_emailstringBuyer email
buyer_addrstringBuyer address
buyer_postcodestringBuyer postal code
notice_urlstring /

array of string
URL to use instead of Notification URL set in Admin Console

Use this property to set different or multiple Notification URLs for each order
displayobjectDisplay settings for payment window

param.display (Object)

Property

* Required
Type

(Default value)
Description
card_quotaarray of integerInstallment plan option for KRW 50,000 or more
  • Not specified: default installment plans provided by PG
  • []: only immediate pay allowed
  • 2,3,4,5,6: immediate, 2, 3, 4, 5, 6 month installment plans (only supported by KGINICIS/KCP)

Additional Properties

Property

* Required
Type

(Default value)
Description
digitalboolean

(false)
Option to specify the product as digital content (required for mobile micropayment)

You must accurately distinguish contents and tangible products
vbank_duestringDue date(YYYYMMDDhhmm) to deposit payment to virtual account
m_redirect_urlstringURL to redirect to after payment is complete (in redirection mode)
app_schemestringURL scheme for returning to the app during mobile app payment (required for WebView payment)

Used to return to the original app after verifying payment information in the ISP/app card app
biz_numstringRegistered business registration number (10-digit without symbols)

Required for Danal-Virtual Account payments

callback (Function)

  function (rsp) { ... }
The function that is called after payment is complete in a payment window implemented in Iframe.

Parameters

rsp (Object)

The response for the payment request.

Properties by PG/Payment Method

The returned properties vary by PG or payment method. The properties returned by default are displayed as  required parameter (*).

i'mport policy for adding response fields

To improve the performance of i'mport service, response fields can be added at any time without prior notice. If such change requires merchants to conduct an impact assessment, details will be posted in the i'mport Announcements page.

Properties

Property

* Required
TypeDescription
success*

(returned as imp_success for some PG/payment method)
booleanWhether or not the payment succeded

True when payment is approved or virtual account is issued
error_code*stringShort error message when payment fails (currently no code system available)
error_msg*stringDetailed error message when payment fails
imp_uid*stringUnique i'mport payment ID

This may be null if success is false and verification fails
merchant_uid*stringUnique order ID generated/managed by the merchant
pay_methodstringPayment method

Options
  • card(credit card)
  • trans(instant account transfer)
  • vbank(virtual account)
  • phone(mobile micropayment)
  • kakaopay(Kakao Pay: for INCIS/KCP/NICE payments)
  • payco(PAYCO: for INICIS/KCP)
  • lpay(LPAY: for INICIS)
  • ssgpay(SSG Pay: for INICIS)
  • tosspay(Toss simple pay: for INICIS)
  • point (simple pay points (100%): for Kakao Pay/PAYCO/INICIS/NICE Payments)

paid_amountnumberPaid amount

Approved amount or amount to deposit to virtual account
statusstringPayment status

Options
  • ready (payment in progress: payment window lost focus, virtual account issued)
  • paid (payment complete)
  • failed (payment failed: credit card limit exceeded, insufficient check card balance, payment window closed or cancel button clicked)


namestringOrder name
pg_providerstringPG

Options
  • html5_inicis(KG INICIS for web standard)
  • inicis(General KG INICIS)
  • kakaopay(Kakao Pay)
  • uplus(Toss Payments (previously LG U+))
  • nice(NICE)
  • jtnet(JTNet)
  • danal(Danal)


emb_pg_providerstringPayment approved PG when simple payment is requested from payment windowSimple payment PG selected in the payment window ( Naver Pay, Kako Pay, Payco, Samsung Pay, SSG Pay, L.pay, Kpay ) when pay_method = card in KG Inicis or NHN KCP
pg_tidstringUnique PG transaction ID
buyer_namestringBuyer name
buyer_emailstringBuyer email
buyer_telstringBuyer phone
buyer_addrstringBuyer address
buyer_postcodestringBuyer postal code
custom_dataobjectAdditional order information specified by the merchant
paid_atnumberPayment approved time (UNIX timestamp)
receipt_urlstringURL for sales slip issued by PG

Additional Properties

PropertyTypeDescription
apply_numstringCredit card approval ID (for credit card only)
vbank_numstringVirtual account number

May include dash (-) or other symbols (shown as is from PG)
vbank_namestringVirtual account bank
vbank_holderstringShown as the contracted business name. Null may be returned by some PGs (requires manual processing).
vbank_datenumberDue date to deposit to virtual account (UNIX timestamp)


certification(param, callback)

Calls PG's mobile or credt card identity verification window.

Parameters

param (Object)

The information needed for identity verification.

Property

Property

* Required
Type

(Default value)
Description
merchant_uid

(Supported from v1.1.4)
stringUnique order ID generated/managed by the merchant
min_age

(Supported from v1.1.4)
numberMinimum age allowed (based on date of birth)
name

(Supported from v1.1.4)
stringCustomer name

Auto entered in the name field of the verification window
phone

(Supported from v1.1.4)
stringCustomer mobile phone (includes delimiters, such as - or .)

Auto entered in the phone field of the verification window
carrier

(Supported from v1.1.4)
stringMobile carrier

Mobile carrier options for the verification window

Options
  • SKT: SKT
  • KT: KTF
  • LGU+: LGT
  • Budget phone: MVNO

birth

(Supported from v1.1.4)
stringDate of birth Deprecated due to Danal policy change

Auto filled with the date of birth field of the verification window. Since i'mport removes non-numeric values according to mobile company's requirement, you can use a desired string format that contains the 8-digit date of birth (YYYYMMDD), such as 19821231 or 1982-12-31.
company

(Supported from v1.1.4)
string

(URL where this function is called from)
Service domain URL or name

  • Service domain URL (Example: https://www.iamport.co.kr) or service name (Example: i'mport)
  • This does not directly affect identity verification, but input is recommended for integration with the KISA's ePrivacy Clean Service
  • Recommended when this function is called via local html in ReactNative/Ionic app since URL domain is unknown (Default: i'mport)

m_redirect_url

(Supported from v1.1.7)
stringURL to redirect to after verfication is complete in mobile

imp_uid, merchant_uid and success are appended as query string to the redirect URL
popup

(Supported from v1.1.7, mobile only)
boolean

(false)
Option to open verification page in a popup window

PC: forcibly set to popup: true

Mobile: if you set popup: false, you must specify m_redirect_url

callback (Function)

  function (rsp) { ... }
The function that is called after verification is complete in an identity verification window implemented in Iframe.

Parameters

rsp (Object)

The response for the identity verification request.

Property

Property

* Required
TypeDescription
success*booleanWhether or not the verification succeded

true/false
error_code*stringShort error message when verification fails (currently no code system available)
error_msg*stringDetailed error message when verification fails
imp_uid*stringUnique i'mport verification ID
merchant_uid*stringUnique order ID generated/managed by the merchant