API for Qiwi Wallet.
$ npm i node-qiwi -S
$ npm test
- constructor(key)
- .getProfile(settings) ⇒
[Promise]
- .getBalance() ⇒
[Promise]
- .getHistory(contractId, settings) ⇒
[Promise]
- .getIdentification(contractId, body) ⇒
[Promise]
- .getTransactionsStats(contractId, settings) ⇒
[Promise]
- .getTransaction(transactionId, settings) ⇒
[Promise]
- .sendPayment(amount, account, comment) ⇒
[Promise]
Parameter | Type | Requried | Description |
---|---|---|---|
key | string | yes | Access token for call API methods |
const Qiwi = require('node-qiwi')
const wallet = new Qiwi(process.env.TOKEN)
Create wallet.
Parameter | Type | Requried | Description |
---|---|---|---|
settings | object | no | Extra settings (see) |
const profile = await wallet.getProfile()
Get profile.
const balance = await wallet.getBalance()
Get balance.
Parameter | Type | Requried | Description |
---|---|---|---|
contractId | string | yes | Wallet's contractId |
settings | object | no | Extra settings (see) |
const history = await wallet.getHistory(contractId)
Get history.
Parameter | Type | Requried | Description |
---|---|---|---|
contractId | string | yes | Wallet's contractId |
body | object | yes | Identification's data |
const identification = await wallet.getIdentification(contractId, {
firstName: 'Иван',
lastName: 'Иванов',
middleName: 'Иванович',
birthDate: '1998-02-11',
passport: 4400111222
})
Get identification.
Parameter | Type | Requried | Description |
---|---|---|---|
contractId | string | yes | Wallet's contractId |
settings | object | yes | Extra settings |
settings.startDate | date | yes | Start date |
settings.endDate | date | yes | End date |
const stats = await wallet.getTransactionsStats(contractId, {
startDate,
endDate
})
Get transaction stats.
Parameter | Type | Requried | Description |
---|---|---|---|
transactionId | string | yes | Wallet's contractId |
settings | object | yes | Extra settings |
settings.type | string | yes | Transaction's type |
const transaction = await wallet.getTransaction(transactionId, { type })
Get transaction.
Parameter | Type | Requried | Description |
---|---|---|---|
amount | number/string | yes | Transaction amount |
account | number/string | yes | Recipient's account |
comment | string | no | Comment to transaction |
const payment = await wallet.sendPayment(1, 37253676697, 'This is comment')
Send payment.
MIT.