IMP.request_pay - param, rsp Object

The general payment processes can be started by calling IMP.request_pay(param, callback) function in the Iamport JavaScript library. At this point, you can request a payment with desired contents and write a post payment logic using param and callback arguments of the function.

param object

The JavaScript object is specified as the first argument of the IMP.request_pay() function. This is called param, and it will contain the information needed for the payment approval. You can specify various information required for payment, such as which customers are placing an order, what amount is paid for which product, and what the order number is, in predefined properties.

param object properties

Common properties

PropertyData typeDescriptionDefautMisc

(Supported from v1.1.0)
stringThe identifier when using multiple PGs with one Iamport account.undefined(Optional) If it is missing or does not match, the "default PG" set in the Iamport Admin page is called.

Specify only the PG name, such as kakaopay and html5_inicis

Specify PG name.merchant ID such as html5_inicis.INIpayTest
  • html5_inicis(Inicis web standard)
  • inicis(Inicis ActiveX payment window)
  • kcp(NHN KCP)
  • kcp_billing(NHN KCP recurring payments)
  • uplus(LGU+)
  • nice(NICE Pay)
  • jtnet(JTNet)
  • kicc(KICC)
  • bluewalnut(BlueWalnut)
  • kakaopay(KakaoPay)
  • 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 type)
  • naverco(Naver Pay - on demand)
  • smilepay(Smilepay)
  • alipay(Alipay)
pay_methodstringPayment methodcard
  • card(credit card)
  • trans(real-time account transfer)
  • vbank(virtual account)
  • phone(mobile micropayment)
  • samsung(Samsung Pay / Inicis, KCP only)
  • kpay(Direct call to KPay app / Inicis only)
  • cultureland(Culture Voucher / Inicis, LGU+, KCP only)
  • smartculture(Smart Culture Voucher / Inicis, LGU+, KCP only)
  • happymoney(Happy Money / Inicis, KCP only)
  • booknlife(Book Culture Gift Certificate / LGU+, KCP only)
escrowbooleanEscrow enabledfalse(Optional) Call the escrow enabled payment window
merchant_uidstringUnique order number created/managed by the merchantrandom(Required) Repayment is not possible with merchant_uid that has been used
namestringOrder nameundefined(Optional) Recommended for better payment information verification (although there are differences among PG companies). It is also recommended to specified within 16 characters.
amountnumberAmount to payundefined(Required)
custom_dataobjectExtra data defined by the merchantundefined(Optional) Used when space is required to store additional information for the order. Stored as json notation (string)
tax_freenumberTax-free amount of the paymentundefined(Optional) Specify the tax-free amount. Specify the tax-free amount of the payment.

vatnumberVAT of the paymentundefined(Deprecated) It is recommended to use tax_free parameter for more accurate calculation when applying composite tax. Specify the amount of VAT. Regardless of VAT, the amount means the total amount to be paid by the customer.
currencystringCurrency unitKRW (USD is the default for PayPal)(Optional) KRW / USD / EUR / JPY. Note: Due to the PayPal policy, KRW is not supported. USD is applied instead as default
languagestringThe language of the payment windowko(Optional) Set the language of the payment window screen provided to buyers
  1. KG Inicis, LGU+, Nice Payments: following values can be used en or ko (KG Inicis and Nice Payments only support it in PC payment window)
  2. For Paypal, a 2-digit code is used (see PayPal language setting code)
buyer_namestringBuyer nameundefined(Optional)
buyer_telstringBuyer contactundefined(Required) Some PGs generate errors when the value is missing or blank
buyer_emailstringBuyer e-mailundefined(Optional)
buyer_addrstringBuyer addressundefined(Optional)
buyer_postcodestringBuyer postal codeundefined(Optional)
notice_urlstring / array of stringNotification URLundefined(Optional) This can overwrite the Notification URL set in Iamport Admin page. Used when a different Notification URL is required for every order or when multiple Notification URLs are required
displayobjectPayment windows related optionundefined(Optional) UI option for the payment window provided to buyers

display object properties

PropertyData typeDescriptionDefautMisc
card_quotaarray of integerUI option to select the installment payment planundefined(Optional) UI control to display the list of installment payments in the payment window of PG when the amount is 50,000 won or bigger.
  1. If undefined, the list of installment payments provided by PG is displayed.
  2. If [], only one-time payment is possible
  3. If 2, 3, 4, 5, 6, installment can be selected up to 2, 3, 4, 5, 6 months including one-time payment. Only supported by KG Inicis and KCP

Additional properties - properties required only for special conditions

PropertyData typeDescriptionDefautMisc
digitalbooleanWhether the payment product is contentfalse(Optional) Required for mobile micropayment Tangible products and contents must be clearly distinguished.
vbank_duestringVirtual account payment expiration dateundefined(Optional) YYYYMMDDhhmm format
m_redirect_urlstringURL to be redirected after mobile paymentundefined(Optional) Used only for mobile payment
app_schemestringURL scheme for app return during mobile app paymentundefined(Optional) Required for payments in WebView. Used to return to the original app from App card or ISP apps the payment if verified.
biz_numstringBusiness registration number in 10 digits (without symbols)undefined(Optional) Must be set when paying with Danal-Virtual account

rsp object in callback function

JavaScript function is specified as the second argument of the IMP.request_pay() function. This is called a callback function and is a function that is called after the payment process is completed. When the function is called, it takes rsp object as an argument that contains payment result information. From the object, you can check information such as whether the payment was successful, payment error messages, and the payment approval time.

rsp object properties

Basic properties

rsp propertyData typeDescriptionMisc
successbooleanWhether payment was successfully processedTrue if the actual payment approval has been made or the virtual account is successfully issued
error_codestringShortened message if payment failsNo code system at the moment
error_msgstringDetailed message when payment fails
imp_uidstringUnique transaction number in IamportUnique number per transaction granted by Iamport (when "success" is false, imp_uid may be null if pre-validation fails)
merchant_uidstringUnique order number created/managed by the merchant
pay_methodstringPayment methodcard(credit card), trans(real-time account transfer), vbank(virtual account), phone(mobile micropayment)
paid_amountnumberAmount paidActual amount of approved payment or the amount to be transfer to the virtual account
statusstringPayment statusready(unpaid), paid(payment completed), cancelled(payment cancellation, including partial cancellation), failed(payment failed)
namestringOrder name
pg_providerstringPayment approved/attempted PG companyhtml5_inicis(KG Inicis for web standard), inicis(KG Insis for general payments), kakaopay(KakaoPay), uplus(LGU+), nice(NICE), jtnet(JTNet), danal(Danal)
pg_tidstringPG unique transaction number
buyer_namestringBuyer name
buyer_emailstringBuyer e-mail
buyer_telstringBuyer contact
buyer_addrstringBuyer address
buyer_postcodestringBuyer postal code
custom_dataobjectExtra data defined by the merchant
paid_atnumberPayment approval timeUNIX timestamp
receipt_urlstringURL of transaction sales slip issued by PG companyThe sales slip can be found by opening the received URL.

Additional properties

rsp propertyData typeDescriptionMisc
apply_numstringApproval number from card companiesCredit card payment only
vbank_numstringVirtual account numberSince information provided directly from PG, it may include hyphen(-) or other symbols between the numbers.
vbank_namestringVirtual account bank name
vbank_holderstringVirtual account holderContracted business name. It is always the same. However, null handling is required for some PGs that return null.
vbank_datenumberVirtual account payment expiration dateUNIX timestamp