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

  1. Check that getAuthToken is provided in config
  2. Verify your backend endpoint is returning a valid token
  3. Enable debug: true in config to see detailed logs

Session keeps refreshing

  1. Ensure getAuthToken returns a fresh token each time
  2. Check that your server's clock is synchronized
  3. Verify the token timestamp is in milliseconds, not seconds

Callbacks not firing

  1. Ensure callbacks are passed to the correct component/method
  2. Check browser console for any errors
  3. 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