NOWPayments SDK for Node.js.
$ npm i nowpayments --saveimport NOWPayments from 'nowpayments'
const nowpayments = new NOWPayments({
environment: 'production',
key: 'xxx'
})
;(async () => {
const invoice = await nowpayments.execute({
method: 'POST',
url: '/v1/invoice',
body: {
price_amount: 12.99,
price_currency: 'USD',
order_id: 'test_1',
order_description: 'order_description',
success_url: 'https://google.com/success_url',
cancel_url: 'https://google.com/cancel_url',
is_fixed_rate: true,
is_fee_paid_by_user: true
}
})
/*
{
id: '5222917334',
token_id: '5998913548',
order_id: 'test_1',
order_description: 'order_description',
price_amount: '12.99',
price_currency: 'USD',
pay_currency: null,
ipn_callback_url: null,
invoice_url: 'https://nowpayments.io/payment/?iid=5222917334',
success_url: 'https://google.com/success_url',
cancel_url: 'https://google.com/cancel_url',
customer_email: null,
partially_paid_url: null,
payout_currency: null,
created_at: '2025-12-03T09:10:03.986Z',
updated_at: '2025-12-03T09:10:03.986Z',
is_fixed_rate: true,
is_fee_paid_by_user: true,
source: null,
collect_user_data: false
}
*/
console.log(invoice)
})().catch(console.error)