1.0.3 • Published 7 years ago
magento-api-xmlrpc-extended v1.0.3
Magento XMLRPC API Wrapper
Forked from https://www.npmjs.com/package/magento-api-xmlrpc
This wrapper lets you talk to Magento v1.x via XMLRPC. This is the most reliable and up to date magento wrapper, with lots of bug fixes and extended support for Ebizmart SagePay api end-points.
Original wrapper: bitbucket.org/icecom/magentoapi , developed by https://www.npmjs.com/~icecom and https://www.npmjs.com/~2ps.
Installation
npm i -S magento-api-xmlrpc-extended
Usage
const MagentoAPI = require('magento-api-xmlrpc-extended');
const magentoAPI = new MagentoAPI({
host: 'shop-domain.com',
port: 80,
path: '/api/xmlrpc/',
login: 'api_username',
pass: 'api_password'
});
magentoAPI.login((error, sessionId) =>
{
// Error
if (error) {
console.log('error', error);
return;
}
// Test
console.log('sessionId', sessionId);
// Rest of your code...
});
If need be, you can manually change the session id.
magentoAPI.changeSession(newSessionId);
(Ebizmart) Sage Pay API Usage
List transactions
magentoAPI.sagePayTransaction.list((error, transactionList) => {
if (error) {
console.log('error', error);
return;
}
console.log(transactionList);
});
Transaction Info
let request = {
'vpstxcode': 'EA049E74-A774-4322-80E6-1B317A90C2EB'
};
magentoAPI.sagePayTransaction.info(request, (error, transactionInfo) => {
if (error) {
console.log('error', error);
return;
}
console.log(transactionInfo);
});
All of the API methods take an object of params as the first argument, and a callback as the second.
Or, if no params are sent, just a callback as the first argument.
Methods
- Catalog Category
- Catalog Category Attribute
- Catalog Product
- Catalog Product Attribute
- Catalog Product Attribute Media
- Catalog Product Attribute Set
- Catalog Product Custom Option
- Catalog Product Custom Option Value
- Catalog Product Downloadable Link
- Catalog Product Link
- Catalog Product Tag
- Catalog Product Tier Price
- Catalog Product Type
- Catalog Inventory Stock Item
- Checkout Cart
- Checkout Cart Coupon
- Checkout Cart Customer
- Checkout Cart Payment
- Checkout Cart Product
- Checkout Cart Shipping
- Core
- Customer
- Customer Address
- Customer Group
- Directory Country
- Directory Region
- Sales Order
- Sales Order Credit Memo
- Sales Order Invoice
- Sales Order Shipment
- Store