# quickbooks2

> An updated node.js client for Intuit's QuickBooks Payments

Latest version **1.0.4** (published 2017-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install quickbooks2
pnpm add quickbooks2
yarn add quickbooks2
bun add quickbooks2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-09-17 |
| First published | 2017-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rbar |
| Maintainers | rbar |
| Keywords | quickbooks, intuit |

## Links

- npm: https://www.npmjs.com/package/quickbooks2
- Repository: https://github.com/rbar2/quickbooks
- Issues: https://github.com/rbar2/quickbooks/issues
- npm.io page: https://npm.io/package/quickbooks2

## Dependencies (6)

- [util](https://npm.io/package/util.md) 0.10.3
- [request](https://npm.io/package/request.md) 2.67.0
- [node-uuid](https://npm.io/package/node-uuid.md) ^1.4.1
- [underscore](https://npm.io/package/underscore.md) 1.6.0
- [querystring](https://npm.io/package/querystring.md) 0.2.0
- [request-debug](https://npm.io/package/request-debug.md) 0.0.1

## Recent versions

- 1.0.4 (latest) — 2017-09-17
- 1.0.2 — 2017-09-17
- 1.0.1 — 2017-09-16
- 1.0.0 — 2017-09-16
- 1.0.3 — 2017-09-16

## README

# quickbooks

This is an updated version of Node.js client for [QuickBooks Payments api] [1].  Original work was done by (and thanks to) mcohen01, whose accounting client can be found at the following link:
(Quickbooks Accounting client available at [github.com/mcohen01/node-quickbooks](https://github.com/mcohen01/node-quickbooks).)

## Installation

`npm install quickbooks2`

## Documentation

Original work was done by (and thanks to) mcohen01, whose Full Api documentation can be found at the following link: [mcohen01.github.io/quickbooks](https://mcohen01.github.io/quickbooks)


```javascript

var QuickBooks = require('quickbooks')

var qbo = new QuickBooks(consumerKey,
                         consumerSecret,
                         oauthToken,
                         oauthTokenSecret,
                         realmId,
                         false, // don't use the sandbox (i.e. for testing)
                         true); // turn debugging on

var chargeId

var charge = {
  capture: false,
  currency: 'USD',
  amount: '42.21',
  card: {
    expYear: '2016',
    expMonth: '02',
    address: {
      region: 'CA',
      postalCode: '94062',
      streetAddress: '131 Fairy Lane',
      country: 'US',
      city: 'Sunnyvale'
    },
    name: 'Brad Smith',
    cvc: '123',
    number: '4111111111111111'
  }
}

qbo.charge(charge, function(err, charged) {
  console.log(charged.id)
})

qbo.getCharge(chargeId, function(err, charge) {
  console.log(charge.card.address.street_address)
})

qbo.capture(chargeId, { amount: 42.21 }, function(err, capture) {
  console.log(capture)
})

qbo.refundCharge(chargeId, {amount: 20.00}, function(err, refund) {
  console.log(refund)
})

qbo.getChargeRefund(chargeId, refundId, function(err, refund) {
  console.log(refund)
})

```

## Running the tests

First you'll need to fill in the missing values in config.js. The consumerKey and consumerSecret you can get from the Intuit Developer portal, the token, tokenSecret, and realmId are easiest to obtain by running the example app, completing the OAuth workflow, and copying the values that are logged to the console. Once you've filled in the missing credentials in config.js you can simply run:

`npm test`


[1]: https://developer.intuit.com/docs/0150_payments

---
_Source: https://npm.io/package/quickbooks2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
