https://github.com/marketcloud/marketcloud-node
Marketcloud nodejs client library
https://github.com/marketcloud/marketcloud-node
api ecommerce nodejs shopping-cart
Last synced: 9 months ago
JSON representation
Marketcloud nodejs client library
- Host: GitHub
- URL: https://github.com/marketcloud/marketcloud-node
- Owner: Marketcloud
- License: gpl-2.0
- Created: 2015-04-18T18:08:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-09-03T13:36:37.000Z (over 8 years ago)
- Last Synced: 2025-06-07T05:38:45.918Z (10 months ago)
- Topics: api, ecommerce, nodejs, shopping-cart
- Language: JavaScript
- Homepage: http://www.marketcloud.it
- Size: 56.6 KB
- Stars: 22
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Marketcloud/marketcloud-node) [](https://snyk.io/test/github/snyk/goof) []
# Marketcloud NodeJS SDK

This is the repository for Marketcloud's official nodejs client library. Please refer to the [website](https://www.marketcloud.it) 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
```javascript
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:
```javascript
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
});
```