SOAP faultcode list

SOAP faultcode list

September 7, 2026 · Illustrated author avatarBy Stefan Bogdanescu
SOAP faultcode list

Handling SOAP Faultcodes in Magento API Import Scripts

As you’re developing a script to import products from an XML file into your Magento store using the SOAP API, one of the key challenges is effectively handling errors that may occur during the process. The SOAP protocol defines fault codes which can help us understand and manage these issues.

Understanding SOAP Faultcodes in Magento API

In the context of the Magento SOAP API, the fault codes represent specific types of errors or exceptions thrown by the system when processing the API requests. These faults are returned as part of a Fault structure within the response message.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <!-- Header details here -->
    </s:Header>
    <s:Body>
        <faultcode>101</faultcode>
        <faultstring>Product not exists.</faultstring>
    </s:Body>
</s:Envelope>

Identifying Magento API Faultcodes

While a comprehensive official list of all possible Magento SOAP fault codes is not readily available, through extensive testing and documentation review, we’ve identified some common ones:

  1. 101 - Product not exists.
  2. 102 - Invalid product SKU.
  3. 103 - Duplicate category.
  4. 104 - Attribute does not exist.
  5. 105 - The specified attribute set name already exists.

Best Practices for Handling SOAP Faultcodes

To effectively handle these faults in your script, you should follow a structured approach:

Step 1: Parse the SOAP Response

After making an API call, always parse the XML response to check if it contains any fault codes. Magento’s SoapClient can directly parse and decode the fault codes for you.

try {
    $response = $proxy->call($methodName, array('arg1' => $value));
} catch (Exception $e) {
    echo 'Fault code: ', $e->faultcode;
    echo 'Fault string: ', $e->faultstring;
}

Step 2: Map Faultcodes to Meaningful Errors

Once you have the fault code, map it to a meaningful error message in your application. This will help you provide clear feedback about why an import failed.

Conclusion

Incorporating SOAP faultcode handling into your Magento API import script is crucial for maintaining the stability and robustness of your system. Regularly checking these codes allows you to catch and recover from common issues without halting the entire import process.

Remember, if you need further assistance with Magento development or any other aspects of your e-commerce project, don’t hesitate to reach out to our team at LaravelCompany - we’re always ready to help!

Catalog API Import/Export Errors

Our network