# marketcloud-node

> Marketcloud NodeJS sdk

Latest version **2.2.0** (published 2017-09-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install marketcloud-node
pnpm add marketcloud-node
yarn add marketcloud-node
bun add marketcloud-node
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2017-09-03 |
| First published | 2016-01-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Marketcloud.it |
| Maintainers | fatmatto |
| Keywords | ecommerce, api, nodejs, backend |

## Links

- npm: https://www.npmjs.com/package/marketcloud-node
- Repository: https://github.com/Marketcloud/marketcloud-node
- Homepage: https://github.com/Marketcloud/marketcloud-node#readme
- Issues: https://github.com/Marketcloud/marketcloud-node/issues
- npm.io page: https://npm.io/package/marketcloud-node

## Dependencies (2)

- [bluebird](https://npm.io/package/bluebird.md) ^3.4.1
- [superagent](https://npm.io/package/superagent.md) ^3.5.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2017-09-03
- 2.1.1 — 2017-08-23
- 2.1.0 — 2017-08-05
- 2.0.5 — 2017-05-08
- 2.0.4 — 2017-04-23
- 2.0.3 — 2017-04-03
- 2.0.2 — 2017-03-01
- 2.0.0 — 2017-02-02
- 1.1.6 — 2016-10-13
- 1.1.3 — 2016-08-01
- 1.1.2 — 2016-07-24
- 1.1.1 — 2016-07-24
- 1.1.0 — 2016-07-24
- 1.0.6 — 2016-04-12
- 1.0.5 — 2016-02-29
- … 5 more at https://npm.io/package/marketcloud-node/versions

## README

[![Build Status](https://travis-ci.org/Marketcloud/marketcloud-node.svg?branch=master)](https://travis-ci.org/Marketcloud/marketcloud-node) [![Known Vulnerabilities](https://snyk.io/test/github/Marketcloud/marketcloud-node/badge.svg)](https://snyk.io/test/github/snyk/goof) [![Code Climate](https://codeclimate.com/github/Marketcloud/marketcloud-node/badges/gpa.svg)]
# Marketcloud NodeJS SDK
![Marketcloud](http://www.marketcloud.it/img/logo/new_with_text.png)

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
 });
```

---
_Source: https://npm.io/package/marketcloud-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
