Git Product home page Git Product logo

checkbook_node's Introduction

Note: this repo has been archived as of 4/4/2023. Stay tuned for newer releases of our SDKs later this year ๐ŸŽ‰

Node.js library for the Checkbook.io API

This library provides convenient access to the Checkbook.io API from applications written in Node.js.

Installation

Install the package with:

npm install checkbook-api --save

Configuration

The package needs to be configured with your account's API Key and API Secret.

๐Ÿ”‘ The API credentials below are from the demo environment and you can use them to try the API.

var CheckbookAPI = require('checkbook-api');
var Checkbook = new CheckbookAPI({
	api_key: 'd6aa2703655f4ba2af2a56202961ca86',
	api_secret: 'dXbCgzYBMibj8ZwuQMd2NXr6rtvjZ8',
	env: 'demo'
});

The env parameter is optional and can be omitted if the requests are made to the live environment.
The possible values for this parameter are demo or sandbox and the API credentials need to be from the specified environment.

You can get the API Key and API Secret values from the Settings page.

API Key and API Secret

OAuth

If you wish to send requests on behalf of another user, this user will use OAuth in order to generate a key that may be used on their behalf. You can get more details on our OAuth documentation page.

Once you obtain the bearer token for a user, you can use it to send API requests on its behalf:

var CheckbookAPI = require('checkbook-api');
var Checkbook = new CheckbookAPI({
	bearer: '3658db04db340ce57b35fde7a56f669be222d96e33219bf28409812d1ca364b5',
	env: 'demo'
});

Usage

You can use the following code snippet to send a digital check:

Checkbook.checks.sendDigitalCheck({
    name: 'Widgets Inc.',
    recipient: '[email protected]',
    description: 'Test Send Check',
    amount: 10.00
}, function (error, response) {
    if (error) {
        console.log('Error:', error);
    } else {
        console.log('Response:', response);
    }
});

You can use the following code snippet to query the list of checks:

Checkbook.checks.list({
    page: 1,
    per_page: 10,
    status: 'UNPAID'
}, function (error, response) {
    if (error) {
        console.log('Error:', error);
    } else {
        console.log('Response:', response);
    }
});

โญ You can find more code samples here.

Methods reference

The Checkbook class has several endpoints and you can find below the methods each one provides.

You can click on the ๐Ÿ“– icon to access the detailed API reference for each method.

  • Checkbook.checks

    • list(query, callback) ๐Ÿ“–
    • get(check_id, callback) ๐Ÿ“–
    • delete(check_id, callback) ๐Ÿ“–
    • sendDigitalCheck(params, callback[, idempotencyKey]) ๐Ÿ“–
    • sendPhysicalCheck(params, callback[, idempotencyKey]) ๐Ÿ“–
    • sendDirectCheck(params, callback[, idempotencyKey])
    • sendMultipleChecksCSV(params, callback[, idempotencyKey])
  • Checkbook.invoices

  • Checkbook.subscriptions

    • list(query, callback) ๐Ÿ“–
    • get(subscription_id, callback) ๐Ÿ“–
    • delete(subscription_id, callback) ๐Ÿ“–
    • update(subscription_id, params, callback) ๐Ÿ“–
    • sendRecurringCheck(params, callback[, idempotencyKey]) ๐Ÿ“–
    • sendRecurringInvoice(params, callback[, idempotencyKey]) ๐Ÿ“–
  • Checkbook.banks

    • list(callback) ๐Ÿ“–
    • institutions(callback) ๐Ÿ“–
    • delete(bank_id, callback) ๐Ÿ“–
    • instantAccountVerification(params, callback[, idempotencyKey]) ๐Ÿ“–
    • addBankAccount(params, callback[, idempotencyKey]) ๐Ÿ“–
    • verifyMicrodesposits(params, callback) ๐Ÿ“–
  • Checkbook.users


๐Ÿ’ก The query object used for the list(query, callback) methods can have the following attributes:

  • start_date : 'yyyy-mm-dd'
  • end_date : 'yyyy-mm-dd'
  • direction : 'INCOMING'|'OUTGOING'
  • sort: '+NUMBER'|'-NUMBER'|'+TYPE'|'-TYPE'|'+AMOUNT'|'-AMOUNT'|'+STATUS'|'-STATUS'|'+DATE'|'-DATE'|'+DESCRIPTION'|'-DESCRIPTION'
  • status : 'PAID'|'IN_PROCESS'|'UNPAID'|'VOID'|'EXPIRED'|'PRINTED'|'MAILED'|'FAILED'|'REFUNDED'
  • q : 'search query'
  • per_page : 10|25|50
  • page : [1..N]
  • type : 'CHECK'|'INVOICE'|'SUBSCRIPTION'

Getting help

If you need help installing or using the library, please contact Checkbook.io Support at [email protected].

If you've instead found a bug in the library or would like new features added, please open issues or pull requests against this repo.

More Information

checkbook_node's People

Contributors

c00 avatar cmoleaumi avatar cosminonnet avatar mbierma avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

checkbook_node's Issues

Allow bearer token authorization

For now, the library only supports Authorization: Key:Secret

It needs to be able to set Authorization: bearer BEARER_TOKEN for the OAuth use-case.

Missing API call for `POST /v3/check/direct`

The package does not seem to support the API call POST /v3/check/direct.

I know this option is not available for all clients, however, for those to whom it is, it's not really reasonable to leave out the call in your official node library.

Is it possible to add it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.