Error Reference
HTTP Status Codes
All API endpoints return standard HTTP status codes:
| Code | Meaning | Description |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Invalid parameters or malformed request |
401 | Unauthorized | Invalid or expired handshake token |
404 | Not Found | Customer or subscription not found |
500 | Server Error | Internal server error |
Error Response Format
{
"error": "Customer not found"
} Common Errors
Token Errors
| Error | Cause | Solution |
|---|---|---|
Invalid token format | Token is malformed or missing parts | Ensure token has format payload.signature |
Token expired | Token timestamp is more than 5 minutes old | Generate a new token with current timestamp |
Invalid signature | HMAC signature doesn't match | Verify you're using the correct private key |
Brand not found | The brandPub in token doesn't exist | Check your public key is correct |
Customer Errors
| Error | Cause | Solution |
|---|---|---|
Customer not found | Stripe customer ID doesn't exist | Verify the customer exists in Stripe |
No active subscription | Customer has no active subscriptions | Ensure customer has an active subscription |
Subscription not found | Specified subscription ID doesn't exist | Verify the subscription ID is correct |
Troubleshooting
SDK won't initialize
- Check that
getAuthTokenis provided in config - Verify your backend endpoint is returning a valid token
- Enable
debug: truein config to see detailed logs
Session keeps refreshing
- Ensure
getAuthTokenreturns a fresh token each time - Check that your server's clock is synchronized
- Verify the token timestamp is in milliseconds, not seconds
Callbacks not firing
- Ensure callbacks are passed to the correct component/method
- Check browser console for any errors
- Verify the retention/subscription flow completed successfully
Debug Mode
Enable debug mode to see detailed SDK logs:
const renumerate = new Renumerate({
getAuthToken,
debug: true // Enable debug logging
}); This will log:
- Session establishment and refresh events
- API request/response details
- Callback invocations
- Error details