ModuleBank API
Wrapper for ModuleBank API for Node.js
Install
npm i module-bank-api -S
Usage
Import
ModuleBankApi ModuleBankPaymentCategory = ;// or;
API object
let api = 'sandboxtoken' // Auth token true // true - sandbox mode, false - production mode;
API methods
api.getAccountInfo(callback)
- returns user accounts https://api.modulbank.ru/data/#_5api.getOperationHistory(bankAccountId, params, callback)
- returns operation history for the account https://api.modulbank.ru/data/#_6
Argument params
is an Object with the followings fields:
let query = category: ModuleBankPaymentCategoryCREDIT // ModuleBankPaymentCategory.CREDIT or ModuleBankPaymentCategory.DEBET skip: 2 // Skim records count records: 3 // Records limit from: from // Select operation from this date (JS Date object) till: till // Select operation till this date (JS Date object);
All fields are optional.
api.getBalance(bankAccountId, callback)
- returns balance of the account https://api.modulbank.ru/data/#_7api.uploadOperation(operation1c, callback)
- uploads operations in 1C format https://api.modulbank.ru/load/
Callback signature
{ if !error console; }
error
- error information ornull
if no error happensresponse
- response data
ModuleBankPaymentCategory
ModuleBankPaymentCategory.DEBET
- debet categoryModuleBankPaymentCategory.CREDIT
- credit category