2.2.0 • Published 8 years ago

marketcloud-node v2.2.0

Weekly downloads
9
License
ISC
Repository
github
Last release
8 years ago

Build Status Known Vulnerabilities [Code Climate]

Marketcloud NodeJS SDK

Marketcloud

This is the repository for Marketcloud's official nodejs client library. Please refer to the website for documentation and more information

Installation

npm install marketcloud-node

Updating

Please remember to check the changelog for important information whenever updating to the latest version!

Documentation

The official documentation is available at http://www.marketcloud.it/documentation/nodejs

API overview

You can interact with the api through a Marketcloud.Client instance

var Marketcloud = require('marketcloud-node');
var marketcloud = new Marketcloud.Client({
   public_key : 'your-public-key-here',
   secret_key : 'your-secret-key-here'
})

Every resource method, returns a promise:

var product = {
  name : 'Sandman #3',
  price : 9.99,
  stock_type : 'track',
  stock_level : 10,
  author : 'Neil Gaiman',
  publisher : 'Vertigo',
  images : ['https://images.com/comic_cover.jpg']
}

		
//Save the product
marketcloud.products.create(product)
.then(function(response){
  var product_id = response.data.id
  expect(response.status).to.equal(true)
})


//Retrieve a particular product
marketcloud.products.getById(123)
.then(function(response){  
  console.log("The product is",response.data)
});



// Create an order
var new_order = {
   billing_address : {...},
   shipping_address : {...},
   items : [{product_id:1, variant_id : 1,quantity:1}]
}

marketcloud.orders.create(new_order)
.then(function(response){
	// Handle success
	// Log order data
	console.log(response.data);
})
.catch(function(error){
 // Handle error
 });
2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.0

9 years ago

1.1.6

9 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago