Skip to main content

Standard Error Response

HTTP Status Codes

Common Error Codes

Authentication Errors

authentication_required
  • Status: 401
  • Cause: No authentication credentials provided
  • Solution: Include valid Bearer token in Authorization header
invalid_token
  • Status: 401
  • Cause: Token is invalid, malformed, or expired
  • Solution: Refresh token or re-authenticate

Authorization Errors

permission_denied
  • Status: 403
  • Cause: Token is valid but lacks permission for this resource
  • Solution: Verify business_id matches token scope

Validation Errors

validation_error
  • Status: 400
  • Cause: Request data failed validation rules
  • Solution: Check details field for specific field errors
Example:

Resource Errors

business_not_found
  • Status: 404
  • Cause: Business ID doesn’t exist or doesn’t belong to your partner
  • Solution: Verify business_id is correct
invoice_not_found
  • Status: 404
  • Cause: Invoice ID doesn’t exist for this business
  • Solution: Verify invoice_id is correct
duplicate_external_id
  • Status: 409
  • Cause: A resource with this external_id already exists
  • Solution: This is expected for idempotent requests - use the existing resource

Retry Strategy

When to Retry

Retry these:
  • 500-level errors (server errors)
  • Network timeouts
  • Connection errors
Don’t retry these:
  • 400-level errors (client errors)
  • 401 Unauthorized (refresh token instead)
  • 403 Forbidden (fix permissions)
  • 404 Not Found (resource doesn’t exist)

Exponential Backoff

Manual Retry with Backoff

Error Logging Best Practices

Common Scenarios

Handling Validation Errors

Handling Authentication Errors

Next Steps

Authentication

Learn about token management

API Reference

See specific endpoint error responses