1.2.9 • Published 2 years ago

@parafin/parafin-node v1.2.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.2.7

2 years ago

1.2.9

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago