Wish.com api for Node.js.
npm install wishapi
var wishapi = require('wishapi');
var merchant = new wishapi.Merchant({
key: 'your merchant api key'
});
merchant.authTest()
.then(function(success) {
console.log(success)
});
merchant.product('a product id')
.then(function(product) {
// a plain javascript object.
})
.catch(function(err) {
// something wrong.
// the err has details and error code.
});
Thanks Bluebird. We provide callback too.
merchant.fulfillOrder({
id: 'order id',
tracking_provider: 'USPS',
tracking_number: '12345678'
}, (err, success) {
if (err) {
console.error(err);
} else if (success) {
// ...
}
});
First, you need read Official api document. To understand every model property.
About Merchant class you can read an annotated source. It write by coffee script. But you don't need install it. The code you installed by npm is compiled vanilla javascript.
This api return some wish special error type. You can find them at errors annotated source.
Our code have pass 100% test converage currently.
If you find out any issues. Please let me know.
If you have any good idea. Send me a pull request.