Warnings object
Understand the warnings object.
While interacting with Shopper APIs, you might encounter situations where their actions only partially align with the expected requirements or constraints. Instead of outright failures, the API responds with warnings in such cases. These warnings serve as gentle alerts to the users that some aspects did not meet certain conditions or expectations while the server processed their request. Understanding and addressing these warnings can enhance the user experience by guiding adjustments to their requests to fully benefit from the services offered. The Warnings
object returned in the response plays a crucial role in this communication process, detailing the nature of the warning with a code and a description. This mechanism ensures that users are well-informed and can make necessary changes or decisions based on the feedback provided.
A warning is triggered when something unexpected occurs that is not severe enough to complete the request and implies that the request did not do what you intended. The warning will appear in the response. You can decide whether to continue with the checkout. For example, a shopper uses a product-restricted line item coupon code when the product is not in a cart or a shipping offer coupon code when the shipping method is unavailable for the cart or country.
A warnings
object should contain the following details: the code and description associated with the warning in a 200 OK
response.
The Shopper APIs use the following format for warnings:
When you receive a warning in the response from a Shopper API, it indicates that the request did not meet certain conditions when the system processed your request. Here's how you can address and resolve these warnings:
Review the warning: Carefully read the warning's code and description to understand the nature of the issue. The description will often provide insight into what was unexpected or why the request did not meet the criteria.
Adjust your request: Based on the warning's details, modify your request to align with the required conditions or expectations. It might involve changing parameters, adding necessary information, or removing conflicting elements.
Refer to documentation: Consult the Shopper API documentation for more information on the warning codes and suggested actions. The documentation often provides examples and guidelines that can help resolve the warning.
Test and validate: After adjusting your request, test it to ensure the warning no longer appears and your request achieves the desired outcome.
Contact support: If you encounter an API error that keeps occurring, 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.
Promptly resolving warnings ensures a smoother and more efficient integration with Shopper APIs, leading to a better overall experience.
Last updated