Magento API

Component ID

2256843

Component name

Magento API

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

1166

Component created

Component changed

Component body

This module is an implementation of the "smalot/magento-client" project hosted on GitHub.
That's the best way to communicate with Magento against its Soap v1 API.

This module can be used to build products import, orders reportings, "Key Performance Indicators" dashboards, customer account synchronization and so more ...

Requirements

You need at least to use PHP 5.3 due to "namespace" use on API classes.

Setup

// Add this at the end of the "settings.php" file.
$conf['magento_providers'] = array(
  'default' => array(
    'name'     => 'Magento Demo',
    'url'      => 'http://yourdomain.tld/magento/',
    'api_user' => 'demo',
    'api_key'  => 'magento',
  ),
);

Implementation

// Create remote adapter which wrap soapclient.
$provider = magento_api_provider_get('default');
 
// Test connectivity.
if ($result = $provider->ping()) {
  // Prepare single call.
  $categoryManager = new SmalotMagentoCatalogCategory($provider);
  $tree            = $categoryManager->getTree()->execute();
 
  var_dump($tree);
}

For more information about library, please refers to official documentation.

Credits

Original idea & sponsoring : Actualys