LogoLogo
System status
Commerce API references
Commerce API references
  • Commerce API references
  • Warnings and error codes
    • Errors
    • Error codes
      • HTTP response status codes
      • Error format for Shopper APIs
      • Error codes for Shopper APIs
        • 400 Bad Request
        • 401 Unauthorized
        • 403 Forbidden
        • 404 Not Found
        • 405 Method Not Allowed
        • 409 Conflict
        • 412 Precondition Failed
        • 413 Payload Too Large
        • 500 Internal Server Error
      • Error format for Admin APIs
        • Async error objects
        • Sync error objects
        • Deployment objects
        • Warning objects
      • Error codes for Admin APIs
        • Error patterns
        • Supported image types
        • Asynchronous response error codes
        • Deployment error codes
        • Synchronous response error codes
  • Commerce API reference guide
    • API structure
      • API keys
      • Supported OAuth and Commerce API formats
      • Mini cart widget
      • Custom attributes
      • Fields used as keys
      • Fields and expand query parameters
      • Caching responses
      • CORS support
      • JSONP support
      • Transport
      • Service profiles
      • Supported protocols and formats
      • Elements
      • Rate limiting
      • Locale and currency
      • Exchange rate
      • Product identifier
      • Product external reference identifier (ERID)
      • Customer external reference identifier ERID
      • Cancel request process
      • Failover and redundancy
      • Troubleshooting API calls
    • Shopper APIs reference
      • Carts
        • Offers
          • Offer types
          • POP offers
          • Applied offers
          • Eligible offers
      • Orders
      • Returns
      • Links
    • Admin APIs reference
      • Subscriptions
      • Sites
      • Products
      • Live changes
      • Authorized shipping and billing countries
      • Merchandising
      • Disclosures
    • Glossary
Powered by GitBook
On this page
  1. Warnings and error codes
  2. Error codes

HTTP response status codes

Understand HTTP response status codes.

PreviousError codesNextError format for Shopper APIs

Last updated 5 months ago

When interacting with a web service, such as the Commerce API, it's crucial to interpret the feedback your requests receive. This feedback is communicated through HTTP response status codes, organized into several ranges, each representing a different type of response. Successfully executed requests return codes in the , indicating a successful operation. Errors caused by the client, such as missing parameters or processing issues, result in . On the other hand, server-side errors produce indicating problems with the server itself. An error code may sometimes accompany these HTTP status codes to explain the error concisely. Understanding these codes is essential for efficiently diagnosing and resolving issues with API requests.

Advanced tips for interacting with APIs

Understanding the basic principles of API interaction, such as recognizing HTTP status codes, is fundamental when working with web services like the Commerce API. However, diving into more nuanced aspects of API communication is imperative to build more resilient, efficient, and user-friendly applications.

The following tips can significantly improve your application's interaction with web services. Knowing and handling API rate limits and meticulously parsing error codes will also prevent common pitfalls and enhance your application's overall reliability.

  1. Inspect response headers: Beyond the status code, response headers can provide crucial contexts, like rate limits or deprecation warnings.

  2. : Implementing a retry mechanism with exponential backoff for 5xx server errors can improve the robustness of your application.

  3. Leverage HTTP methods appropriately: Ensure you're using the correct HTTP method (GET, POST, PUT, DELETE) for the action you intend to perform, as this impacts both server response and behavior.

  4. : Be aware of the API's rate limits to avoid hitting them, which would result in a 429 Too Many Requests status code.

  5. Parse error codes carefully: In addition to the HTTP status code, look at the API-specific error code (if available), which can offer more detailed insight into what went wrong.

  6. Test with a REST client: Before integrating the API into your application, experiment with endpoints using a REST client to better understand the responses.

  7. Contact support: If you encounter an API error that keeps occurring, you should create a case in the . 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.

Understanding and applying these advanced tips can significantly enhance your interactions with web services and improve the reliability and efficiency of your API integrations.

4xx codes
5xx codes
Use retries for 5xx errors
Monitor API rate limits
Solution Center
2xx range