Going into Production
Smartbills has designed its production and test modes so that they operate in a substantially similar manner. Changing mode therefore mainly comes down to your access point to the URL. If you are a developer, or a developer is creating an integration for you, follow the tips below before going live.Request Access
Before you launch into production, your client must be authorized with our team.Production access is disabled by default. When you are ready to go into production, please contact us at [email protected].
Pre-Launch Checklist
1. Complete Integration Testing
1. Complete Integration Testing
Be vigilant and test your integration with:
- Incomplete data - Test with missing optional fields
- Invalid data - Test with incorrect formats and types
- Duplicate data - Try the same query multiple times to see what happens
- Edge cases - Test boundary conditions and unusual scenarios
2. Implement Robust Error Handling
2. Implement Robust Error Handling
It’s always a shame to discover in production mode that your code was not written to support all possible types of errors, including those that should “never” occur.Make sure your code is defensive and handles all possible errors, not just the most common ones.When testing your error handling process, pay close attention to the information that is returned to the user.
3. Set Up Logging
3. Set Up Logging
Smartbills saves all requests sent with your API keys, which can then be viewed in the Dashboard.We advise you to also back up all important data on your side, even if this may seem redundant. Your logs will save the day if your server can’t connect to Smartbills or if there is a problem with your API keys.Best Practices:
- Log all API requests and responses
- Include timestamps and request IDs
- Monitor error rates and response times
- Set up alerts for unusual patterns
- Regularly check that your logs only store the information you need
- Do not store any confidential information (e.g., credit card information or personally identifiable information)
- Implement log rotation and retention policies
4. Verify Webhook Configuration
4. Verify Webhook Configuration
Your Smartbills account can have both test and production webhook endpoints.If you use webhooks, make sure you have:
- Defined production endpoints in your Smartbills account
- Confirmed that the production endpoint works exactly like your test endpoint
- Implemented webhook signature verification
- Set up proper error handling and retry logic
5. Secure Your API Keys
5. Secure Your API Keys
As a security measure, we advise you to:
- Change your API keys regularly
- Change keys just before switching to production mode
- Ensure keys are not represented or stored in multiple places
- Remove keys from version control software
- Use environment variables for key storage
- Implement key rotation procedures
6. Understand Data Separation
6. Understand Data Separation
Smartbills objects created in test mode (for example, receipts, customers, and products) cannot be used in production mode.This prevents your test data from being accidentally used in your production code.Important:
- Test and production data are completely isolated
- User accounts are separate between environments
- Webhooks are sent to different endpoints
- API keys only work in their respective environment
Production Readiness Checklist
Before requesting production access, ensure you have completed the following:- Tested all API endpoints in pre-production
- Implemented comprehensive error handling
- Set up logging and monitoring
- Configured production webhook endpoints
- Secured and rotated API keys
- Tested with various data scenarios (valid, invalid, incomplete)
- Implemented rate limit handling
- Set up alerts for errors and anomalies
- Documented your integration
- Trained your team on the integration
Requesting Production Access
Once you’ve completed the checklist above:-
Email our team at [email protected] with:
- Your company name and contact information
- A brief description of your integration
- Expected API usage volume
- Go-live date (if known)
-
Provide integration details:
- Which API endpoints you’re using
- Whether you’re using webhooks
- Any special requirements or use cases
-
Wait for approval:
- Our team will review your request
- We may ask for additional information
- Once approved, your production API keys will be activated
-
Test in production:
- Start with a small subset of users
- Monitor closely for any issues
- Gradually roll out to all users
Post-Launch Monitoring
After going live, continue to monitor your integration:Monitor API Usage
Track your API request volume, response times, and error rates
Review Logs Regularly
Check logs for errors, warnings, and unusual patterns
Set Up Alerts
Configure alerts for high error rates or API downtime
Stay Updated
Subscribe to our developer newsletter for updates and changes
Support
If you encounter any issues during your production launch:- Email: [email protected]
- Developer Portal: https://developers.smartbills.io
- Status Page: https://status.smartbills.io
Best Practices for Production
Implement Retry Logic
Implement Retry Logic
Network issues and temporary failures can occur. Implement exponential backoff for retries.
Cache Appropriately
Cache Appropriately
Cache responses when appropriate to reduce API calls and improve performance.
- Cache reference data (categories, tax rates)
- Respect cache headers
- Implement cache invalidation strategies
Monitor Performance
Monitor Performance
Track key metrics:
- API response times
- Error rates by endpoint
- Success rates
- Rate limit usage
- Webhook delivery success
Plan for Scaling
Plan for Scaling
As your usage grows:
- Contact us about rate limit increases
- Implement request queuing
- Consider batch operations
- Optimize your API usage patterns
Common Production Issues
Rollback Plan
Have a rollback plan in case issues arise:- Identify the issue - Use logs and monitoring to diagnose
- Assess impact - Determine how many users are affected
- Decide on action - Fix forward or rollback
- Execute rollback - Revert to previous stable version if needed
- Communicate - Inform affected users and stakeholders
- Post-mortem - Analyze what went wrong and how to prevent it