Skip to main content

Overview

Robust error handling ensures your integration remains reliable and provides a great user experience even when things go wrong.

Error Response Format

All Sticker API errors follow a consistent format:

HTTP Status Codes

4xx Client Errors

Errors caused by the requestUsually don’t retry

5xx Server Errors

Errors on Sticker’s sideSafe to retry with backoff

Common Error Codes

Authentication Errors (401, 403)

How to handle:
  • Verify your API key is correct
  • Check you’re using the right header (Authorization: Bearer vs X-API-Key)
  • Ensure key hasn’t been revoked
  • Don’t retry without fixing the issue

Validation Errors (400)

How to handle:
  • Validate input before sending
  • Show field-specific error messages
  • Don’t retry without fixing validation issues

Resource Errors (404, 409)

How to handle:
  • For 404: Ensure setup was completed first
  • For 409: Use existing resource ID
  • Check your data consistency

Rate Limiting (429)

How to handle:
  • Implement exponential backoff
  • Respect retry_after header
  • Cache organization data to reduce calls
  • Consider request throttling

Server Errors (500, 503)

How to handle:
  • Retry with exponential backoff
  • Log error for investigation
  • Show user-friendly message
  • Alert on persistent failures

Retry Logic

Exponential Backoff

Implement smart retries for transient failures:

Retry Decision Tree

User-Friendly Error Messages

Transform technical errors into helpful messages:

Error Handling Patterns

Organization Setup

User Handshake

iframe Loading

Error Logging

Structured Logging

Log errors with context for debugging:

Error Metrics

Track error rates and patterns:

Fallback Strategies

Graceful Degradation

Provide alternatives when integration fails:

Circuit Breaker

Prevent cascading failures:

Testing Error Handling

Test how your integration handles errors:

Next Steps

Security Guide

Security best practices for your integration

Best Practices

Tips for a robust integration