Authenticated payment request Non-authenticated payment request Non-authenticated API request
Copy IMP.request_pay({
pg : 'jtnet',
pay_method : 'card',
merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001
name : 'Order name: Test payment request',
amount : 14000,
buyer_email : 'iamport@siot.do',
buyer_name : 'John Doe',
buyer_tel : '010-1234-5678',
buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul',
buyer_postcode : '123-456',
m_redirect_url : '{Mobile only - URL to redirect to after payment approval}' // Example: https://www.my-service.com/payments/complete/mobile
}, function(rsp) { // callback logic
//* ...Omitted... *//
});
Key parameter description
pg
* ** **string
PG code
If not specified and this is the only PG setting that exists, default PG
is automatically set.
If there are multiple PG settings, set to jtnet
.
pay_method
* ** **string
Payment method code
Payment method codestrans
(instant account transfer)
phone
(mobile micropayment)
merchant_uid
* ** **string
Order ID
Must be unique for each request.
amount
* ** **integer
Payment amount
Must be an integer (not string)
To open non-authenticated payment window, specify the customer_uid parameter.
amount
If requesting both billing key and initial payment , specify the payment amount.
If only requesting for billing key, set to 0 .
Copy IMP.request_pay({
pg : 'jtnet',
pay_method : 'card', // only 'card' supported.
merchant_uid : '{Merchant created Order ID}', // Example: issue_billingkey_monthly_0001
name : 'Initial billing key request',
amount : 0, // For display purpose only (no payment approval).
customer_uid : '{Unique ID for the card (billing key)}', // Required (Example: gildong_0001_1234)
buyer_email: "johndoe@gmail.com",
buyer_name: "John Doe",
buyer_tel : '02-1234-1234',
m_redirect_url : '{redirect URL}' // Example: https://www.my-service.com/payments/complete/mobile (for mobile only)
}, function(rsp) {
if ( rsp.success ) {
alert('Success');
} else {
alert('Failed');
}
});
Key parameter description
pg
* ** **string
PG code
If not specified and this is the only PG setting that exists, default PG
is automatically set.
If there are multiple PG settings, set to jtnet
.
customer_uid
* ** **string
Credit card billing key
Billing key to be mapped 1:1 with the user-entered credit card information.
amount
* ** **Integer
Payment amount
0: only billing key, > 0: billing key + initial payment \
Request payment with billing key (customer_uid)
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/again
You can use i'mport REST API to request billing key, request payment, and schedule payment.
Request one-time payment
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/onetime
Request billing key
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"card_number":"1234-1234-1234-1234", "expiry":"2025-12", "birth":"820213", "pwd_2digit":"00"}' \
https://api.iamport.kr/subscribe/customers/your-customer-unique-id
Request billing key + initial payment
customer_uid
: required for saving the billing key.
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "card_number":"1234-1234-1234-1234", "expiry":"2019-01", "birth":"123456", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/onetime
Request payment with billing key
Copy curl -H "Content-Type: application/json" \
-X POST -d '{"customer_uid":"your-customer-unique-id", "merchant_uid":"order_id_8237352", "amount":3000}' \
https://api.iamport.kr/subscribe/payments/again
For detailed information, refer to:
Enable specific credit cards
Copy card : {
detail : [
{card_code:"*", enabled:false}, // Disable all credit cards
{card_code:'366', enabled:true} // Enable specific credit card
]
}
Parameters
enabled: Option to enable the credit card (boolean)