@parafin/parafin-node
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

parafin-node Build

A node.js client library for the Parafin API.

Getting started

The module supports all Parafin API endpoints. For complete information about the API, head to the docs. All endpoints require a valid client_id and secret to access and are accessible from a valid instance of a Parafin client object:

import * as parafin from './parafin'

const parafinClient = new parafin.Client({
  token: token,
  environment: parafin.environment.development,
})

// Example endpoint
parafinClient.partner().then((data: any) => console.log(data))

The environment parameter dictates which Parafin API environment you will access. Values are:

Methods

Once an instance of the client has been created you can use the following methods:

// Receive a combined payload
parafinClient.data()

// Receive partner information
parafinClient.partner()

// Receive business information
parafinClient.businessCore()

// Receive offer collection information
parafinClient.offerCollection()

// Receive cash advance information
parafinClient.cashAdvance()

// Receive optIn information
parafinClient.optIn()

// OptInRequest object for posting an opt in
const accountManager: parafin.AccountManager {
  name: 'John Doe',
  email: 'jdoe@mygym.com'
}

const data: parafin.OptInRequest = {
  businessExternalId: 'externalId001',
  businessName: 'The Chiseled Jalapeño',
  ownerFirstName: 'John',
  ownerLastName: 'Doe',
  accountManagers: [
    accountManager
  ],
  routingNumber: '12345678',
  accountNumberLastFour: '0000',
  email: 'jdoe@mygym.com',
  postalCode: '12345'
}

// Post optIn information
parafinClient.postOptIn(data: OptInRequest)

// OptOutRequest object for posting an opt out
const data: parafin.OptOutRequest = {
  businessExternalId: string
}

// Post optOut information
parafinClient postOptOut(data: OptOutRequest)

Install

npm i parafin-node

Build

npm run build

Lint

npm run lint

Local Run

npx ts-node src/parafin.ts

Support

Open an issue!

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @parafin/parafin-node

Weekly Downloads

36

Version

1.2.9

License

MIT

Unpacked Size

283 kB

Total Files

13

Last publish

Collaborators

  • qingda-parafin
  • richard-parafin
  • mackerson1234
  • nrayamajhee
  • elmurati
  • reedhodder
  • ssatia-parafin