1.1.2 • Published 10 months ago
@highbeam/unit-node-sdk v1.1.2
unit-node-sdk
This library provides a typescript wrapper to Unit's API.
Documentation
Installation
npm install @unit-finance/unit-node-sdk
Usage
Create an individual application (es6)
import { Unit } from '@unit-finance/unit-node-sdk'
const unit = new Unit(UNIT_TOKEN, UNIT_API_URL)
let createApplicationRequest = {
type: "individualApplication",
attributes: {
"ssn": "000000002",
"fullName": unit.helpers.createFullName("Richard", "Hendricks"),
"dateOfBirth": "2001-08-10",
"address": unit.helpers.createAddress("20 Ingram St", null, "Forest Hills", "CA", "11375", "US"),
"email": "april@baxter.com",
"phone": unit.helpers.createPhone("1", "2025550158"),
"ip": "127.0.0.1",
"ein": "123456789",
"dba": "Pied Piper Inc",
"soleProprietorship": true,
"sourceOfIncome": "EmploymentOrPayrollIncome",
"annualIncome": "Between50kAnd100k",
"occupation": "ArchitectOrEngineer",
"numberOfEmployees": "Between5And10",
"businessVertical": "TechnologyMediaOrTelecom",
"website": "https://www.piedpiper.com",
}
}
let application = await unit.applications.create(createApplicationRequest).catch(err => {
// handle errors
return err
})
console.log(application)
Create an individual application (typescript)
import { CreateIndividualApplicationRequest, Unit, UnitError } from "@unit-finance/unit-node-sdk";
const unit = new Unit(UNIT_TOKEN, UNIT_API_URL)
(async () => {
let createApplicationRequest: CreateIndividualApplicationRequest = {
type: "individualApplication",
attributes: {
"ssn": "000000002",
"fullName": unit.helpers.createFullName("Richard", "Hendricks"),
"dateOfBirth": "2001-08-10",
"address": unit.helpers.createAddress("20 Ingram St", null, "Forest Hills", "CA", "11375", "US"),
"email": "april@baxter.com",
"phone": unit.helpers.createPhone("1", "2025550158"),
"ip": "127.0.0.1",
"ein": "123456789",
"dba": "Pied Piper Inc",
"soleProprietorship": true
"sourceOfIncome": "EmploymentOrPayrollIncome",
"annualIncome": "Between50kAnd100k",
"occupation": "ArchitectOrEngineer",
"numberOfEmployees": "Between5And10",
"businessVertical": "TechnologyMediaOrTelecom",
"website": "https://www.piedpiper.com",
}
}
let application = await unit.applications.create(createApplicationRequest).catch<UnitError>(err => {
// handle errors
return err
})
console.log(application)
})();
Fetching a customer
import { Unit, UnitError } from "@unit-finance/unit-node-sdk";
const unit = new Unit(UNIT_TOKEN, UNIT_API_URL)
(async () => {
let customer = await unit.customers.get(customerId).catch<UnitError>(err => {
// handle errors
return err
})
console.log(customer)
})();
1.1.1
10 months ago
1.1.0
11 months ago
1.1.2
10 months ago
0.48.0
12 months ago
0.43.0
1 year ago
0.19.1
2 years ago
0.19.2
2 years ago
0.19.0
2 years ago
0.13.3
2 years ago
0.13.4
2 years ago
0.9.56
3 years ago
0.9.52
3 years ago
0.9.53
3 years ago
0.9.54
3 years ago
0.9.42
3 years ago
0.9.34
3 years ago
0.9.35
3 years ago
0.9.36
3 years ago
0.9.27
3 years ago
0.9.28
3 years ago
0.9.40
3 years ago
0.9.26
3 years ago
0.8.24
3 years ago
0.8.23
3 years ago
0.8.12
4 years ago
0.8.22
3 years ago
0.8.13
4 years ago
0.8.21
3 years ago
0.8.20
3 years ago
0.8.19
3 years ago
0.8.18
4 years ago
0.8.17
4 years ago
0.8.11
4 years ago
0.8.10
4 years ago