Key steps include:
  • Leveraging our standardized error response model.
  • Keeping your error-handling logic up-to-date to adapt to any API changes.

Error response model

Our APIs return a structured error object for all errors to simplify issue diagnosis. The format is as follows:
{  
   "code":"<error_code>",  
   "title":"<error_title>",  
   "message":"<error_message>"  
}
Field definitions:
  • code: A unique, stable identifier for the error.
  • title: A brief summary of the issue.
  • message: Detailed guidance for resolving the error.

Field-level error details

For issues specific to individual fields, a fields object provides additional context. Examples:
{  
   "code":"0009",  
   "title":"Missing Fields in Request",  
   "message":"Your request is missing one or more required fields. Please refer to the documentation to ensure all necessary fields are included in your request.",  
   "fields": {  
      "{{field}}": "{{field}} is a required field"  
   }  
} 

Best practices for handling API errors

1. Focus on error codes

  • Error codes are stable and ideal for reliable handling logic.
  • Map error codes to specific resolutions to ensure compatibility with API updates.

2. Log and inform

  • Log errors for monitoring and troubleshooting.
  • Provide clear, actionable feedback to users with suggestions for resolution.

3. Stay updated

  • Regularly review error code documentation to align with new or updated conditions.
  • Keep error-handling logic adaptable to future changes.
Adhering to these practices ensures a robust integration and an exceptional user experience.