0.0.2 • Published 8 years ago
magento2 v0.0.2
Consume Magento 2 REST API
Currently a work in progress.
Wrapper for connecting to Magento 2 REST API.
Example Usage
This uses restler as a HTTP Client library, please see their documentation for more examples/sample usage.
var Magento2Api = require('magento2');
magento = new Magento2Api({
url: 'http://example.com', // without trailing slash
username: 'username',
password: 'password'
});
magento.get('categories').on('complete', function(result) {
if (result instanceof Error) {
console.log('Error:', result.message);
this.retry(5000); // try again after 5 sec
} else {
console.log(result);
}
});
Options
Option | Type | Required | Description |
---|---|---|---|
url | String | yes | Your Store URL, example: http://example.com (without trailing slash) |
username | String | yes | Your API username |
password | String | yes | Your API password |
version | Interger | no | API version, default is 1 |
encoding | String | no | Encoding, default is 'utf-8' |
End points
For a complete list of endpoints see:
Those implemented in this module:
0.0.2
8 years ago