Registry / payments / iamporter

iamporter

JSON →
library1.4.2jsnpmunverified

Node.js REST API client for I'mport (아임포트), a Korean payment gateway integration service. Current stable version 1.4.2 with slow maintenance cadence. Provides Promise-based access to payment APIs including billing key management, subscription payments, and token auto-refresh. Uses custom IamporterError class for error handling. Written in ES6, supports Node >=4.

npm install iamporter
INSTALL
IMPORT
SIG · IAMPORTER
I
iamporter
paymentsjavascriptv1.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Iamporter
const { Iamporter } = require('iamporter');
import Iamporter from 'iamporter';
CommonJS only; no default export exists.
IamporterError
const { IamporterError } = require('iamporter');
const IamporterError = require('iamporter');
Destructure from the package; it's a named export.
new Iamporter()
const iamporter = new Iamporter({ apiKey: '...', secret: '...' });
const iamporter = new Iamporter('...', '...');
Constructor expects an object, not positional arguments.

Shows how to instantiate Iamporter, create a billing key, and make a subscription payment.

const { Iamporter } = require('iamporter'); const iamporter = new Iamporter({ apiKey: process.env.IAMPORT_API_KEY ?? '', secret: process.env.IAMPORT_SECRET ?? '' }); // Create a billing key (subscription) iamporter.createSubscription({ customer_uid: 'test_customer', card_number: '1234-1234-1234-1234', expiry: '2029-12', birth: '900101', pwd_2digit: '12' }).then(result => { console.log('Billing key created:', result.data); }).catch(err => { if (err instanceof IamporterError) { console.error('Iamporter error:', err.message); } }); // Pay with billing key iamporter.paySubscription({ customer_uid: 'test_customer', merchant_uid: 'order_123', amount: 15000 }).then(result => { console.log('Payment success:', result.data); }).catch(err => console.error(err));
Debug
Known issues
deprecatedThe 'request' library is deprecated; Iamporter v1.4.2 uses it internally.
fix
Monitor for updates; no migration path provided yet.
affects: >=1.0.0
gotchaConstructor expects object with apiKey and secret; passing strings directly will fail.
fix
Use new Iamporter({ apiKey: '...', secret: '...' })
affects: >=1.0.0
breakingIamporter requires a globally installed request module? No, it's bundled.
fix
No action needed; request is a dependency.
affects: >=1.0.0
deprecatedIamporter uses callbacks internally? No, Promise-based.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Iamporter is not a constructor
Incorrect import (default import instead of destructured named export).
fix
Use const { Iamporter } = require('iamporter');
Error: getaddrinfo ENOTFOUND api.iamport.kr
Network issue or incorrect API endpoint.
fix
Check internet connectivity and verify the I'mport service status.
IamporterError: {code: -1, message: '인증실패'}
Invalid API key or secret.
fix
Verify your IAMPORT_API_KEY and IAMPORT_SECRET environment variables.
Upgrade
Version history
1.4.2latest on npm
Audit
Dependencies
requestrequiredHTTP client for REST API calls
Agent activity
22 hits · last 30 days
node
22
Resources
iamporter — npm install iamporter · libregistry