1.2.9 • Published 1 year ago

@parafin/parafin-node v1.2.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.2.8

1 year ago

1.2.7

1 year ago

1.2.9

1 year ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.18

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago