Magento 1.6.2 SOAP API错误:使用salesOrderShipmentCreate并继续获取DB完整


Magento 1.6.2 SOAP API Errors: Using salesOrderShipmentCreate and continue to get DB integrity violations

我正在尝试与Magento API集成,以从履行中心的csv文件创建发货。我继续得到这个错误:

Caught create exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000381' for key 2

似乎没有办法绕过它。以下是PHP代码:

<?php
$order  = '100000636';
$carrier = 'fedex';
$proxy = new SoapClient($host.'api/v2_soap/?wsdl');
$sessionId = $proxy->login($user, $pass);
// Create new shipment
try {
    $newShipmentId = $proxy->salesOrderShipmentCreate($sessionId, $order, array('13', '1'), 'shipment comment',false,false);
} catch (Exception $e) {
    echo 'Caught create exception: ' .$e->getMessage();
}
var_dump($newShipmentId);

如果increment_last_id的值小于用于最近成功创建的装运的实际增量ID,请检查eav_entity_store表。如果是,请尝试将其替换为实际的最后一个值。知道:

  • 发货的entity_type_id默认应为8,否则使用eav_entity_type表中与shipment对应的值
  • 如果不在单店模式下运行,请检查相关store_id的值
相关文章:
  • 没有找到相关文章