Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reggi/node-stitchlabs
Simple wrapper for StitchLabs with some nifty features.
https://github.com/reggi/node-stitchlabs
Last synced: about 1 month ago
JSON representation
Simple wrapper for StitchLabs with some nifty features.
- Host: GitHub
- URL: https://github.com/reggi/node-stitchlabs
- Owner: reggi
- Created: 2015-06-24T22:56:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-29T21:17:05.000Z (over 9 years ago)
- Last Synced: 2024-10-05T10:47:34.626Z (about 2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# StitchLabs API Wrapper
```
npm i stitchlabs --save
```https://www.npmjs.com/package/stitchlabs
Created specifically for [node-inventory-bridge](https://github.com/reggi/node-inventory-bridge)
Apologies for poor documentation!
Wraps around request-promises to provide an easy way to interact with the [StitchLabs api](https://developer.stitchlabs.com).
## Usage
The lib assumes you already have the access token for an account.
```
var Stitch = require("stitchlabs")
var stitch = new Stitch({
accessToken: process.env.STITCH_ACCESS_TOKEN,
})// Gets Products
stitch.request("api2/v2/Products")
.then(console.log)
.catch(function(e){
console.log(e.error.message)
})// Creates a ReconcileReasonType
stitch.request({
"url": "api2/v1/ReconcileReasonTypes/detail",
"body": {
"action": "write",
"ReconcileReasonTypes": [
{
"name": "Custom ReconcileReasonType"
}
]
}
})
.then(console.log)
.catch(function(e){
console.log(e.error.message)
})
```