needle module
npm install needle
shirtsio.js
var api_key = 'abc'; // secret Shirts.io API key
var shirtsio = require('shirtsio.js')(api_key);
shirtsio.products.list_categories(
function(err, response) {
if (err) {
console.log(err);
return;
}
console.log(response);
console.log(response.length);
}
);
Detail see example.js
All methods takes a callback as their last parameter. The callback is called with a Javascript
Error
(if any) and then the response.
shirtio.products- retrieve categories, products and inventory.list_categories- retrieve categories.list_products(category_id)- retrieve products.get_product(product_id)- retrieve product.inventory_count(product_id, color, state)- retrieve inventory count
shirtio.status- retrieve status information.check_order_status(parameter)- retrieve current status on the order
shirtio.quote- retrieve quote.get_quote(parameters)- retrieve quote
shirtio.billing- retrieve payment information and update payment status.payment(parameters)- retrieve payment information.update_payment_status(parameters)- update payment status
shirtio.webHook- add, delete, retrieve webhook(s) and add payment webhook.add_webhook(parameters)- add webhook.delete_webhook(url)- delete webhook.list_webhook- retrieve webhooks.add_payment_webhook(url)- add payment webhook
shirtio.order- Placing an Order.place_order(parameters)- placing an Order