将信息从 Netsuite 发送到 Magento Api

Send info from Netsuite to Magento Api

我正在尝试通过 Magento API 将信息从 Netsuite 发送到 Magento。在正常情况下,我执行

    $user       =   'user';
    $pass       =   'password';

    $url        =   'http://example.hosting.com/magento/api/soap/?wsdl';
    $webClient  =   new SoapClient($url);
    $webSession =   $webClient->login($user, $pass);

    $result     =   $webClient->call($webSession, 'ApiMethod', 'data');

购买 我不明白如何在 Netsuite 脚本中制作它。我找到了一个方法 nlapiRequestURL,但我不明白如何进行登录和发送会话。

谢谢。

如果您计划在 NetSuite 中托管代码以与 Magento 对话,您可能最好使用 Magento 的 REST API since it will be much easier to use. Otherwise you'd need a Javascript SOAP client,它不是 NetSuite 的一部分并且不太可能在该环境中正常工作。

使用 REST API,您基本上可以为每种类型的记录访问不同的端点,例如

然后分析您的响应以获得您需要的数据,或者post您想要创建的数据。