Skip to content

centre-for-effective-altruism/kashflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kashflow

A wrapper for the Kashflow SOAP/WSDL API, using node-soap

Simplifies the process of creating a Kashflow client by adding Authentication to each call. Methods return Promises.

Installation

$ npm install --save kashflow

Usage

The library returns a Promise which resolves with a kashflow client object, which has Kashflow methods as its properties.

See the docs for available Kashflow methods.

const Kashflow = require('kashflow')
const { KASHFLOW_USERNAME, KASHFLOW_API_PASSWORD } = process.env
// Set up the client
Kashflow(KASHFLOW_USERNAME, KASHFLOW_API_PASSWORD).then(kashflow => {
    // call methods on the client
    return kashflow.GetInvoiceById({
        InvoiceID: '12345'
    })
    .then(res => {
        console.log(res.GetInvoiceByIdResult)
    })
})

Testing

You'll need to create a .env file in your project root as follows

KASHFLOW_USERNAME=<Your Username>
KASHFLOW_API_PASSWORD=<Your Password>

Then

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published