Error format for Shopper APIs

Understand the error code format for the Shopper APIs.

In the development and integration process of working with the Shopper APIs, understanding how error responses are structured is crucial for diagnosing and resolving issues that may arise. The API distinguishes itself by providing detailed error messages following a structured format. This format includes essential information such as the type of error, an optional system info parameter, and a clear problem description. Below is an overview of the error response format used by the Shopper APIs, designed to assist developers in quickly identifying and addressing issues.

The Shopper APIs use the following format for errors:

"errors": {
  "error": [
    {
      "relation": "https://api.digitalriver.com/v1/shoppers/SubmitCartResource",
      "code": "{error-code}",
      "subcode": "{error-subcode}",
      "description": "{error-description}"
    }
  ]
}

How to Handle Errors

When you encounter an error response from the Shopper APIs, follow these steps to handle and resolve the issues effectively:

  1. Identify the error: Review the code and subcode in the error response. These fields classify the error, helping you understand its nature and potential cause.

  2. Understand the error: Read the description field to get a clear understanding of what went wrong. This description provides insight into the issue and can suggest immediate fixes.

  3. Consult documentation: See the Error codes for Shopper APIs section relevant to the error encountered. This can provide additional context or solutions.

  4. Implement fixes: Based on the information gathered, make the necessary adjustments to your request or handling logic. This might entail fixing payloads, adjusting headers, or handling expected errors more gracefully in your application.

  5. Log and monitor: Always log errors and monitor their frequency. Persistent errors could indicate deeper issues with integration or with the API itself. Monitoring can help in identifying patterns or recurring issues.

  6. Contact support: If you encounter an API error that keeps occurring and cannot be resolved, you should create a case in the Solution Center. You can contact your CSM for more help or escalate the issue if necessary. In addition, if we log the error on our system, we may have monitoring set up to automatically create a case when a particular error occurs multiple times within a specific timeframe to help us investigate and address the issue promptly.

By systematically following these steps, you can minimize the impact of errors on your application and improve the overall stability and reliability of your integration with the Shopper APIs.

Last updated