Skip to main content

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

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
We also advise you to have your integration tested by a third party, particularly if that third party is not a developer themselves.
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.
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
Security:
  • 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
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
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
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:
  1. 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)
  2. Provide integration details:
    • Which API endpoints you’re using
    • Whether you’re using webhooks
    • Any special requirements or use cases
  3. Wait for approval:
    • Our team will review your request
    • We may ask for additional information
    • Once approved, your production API keys will be activated
  4. 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:

Best Practices for Production

Network issues and temporary failures can occur. Implement exponential backoff for retries.
Cache responses when appropriate to reduce API calls and improve performance.
  • Cache reference data (categories, tax rates)
  • Respect cache headers
  • Implement cache invalidation strategies
Track key metrics:
  • API response times
  • Error rates by endpoint
  • Success rates
  • Rate limit usage
  • Webhook delivery success
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:
  1. Identify the issue - Use logs and monitoring to diagnose
  2. Assess impact - Determine how many users are affected
  3. Decide on action - Fix forward or rollback
  4. Execute rollback - Revert to previous stable version if needed
  5. Communicate - Inform affected users and stakeholders
  6. Post-mortem - Analyze what went wrong and how to prevent it

Conclusion

Going into production is an exciting milestone. By following this guide and our best practices, you’ll ensure a smooth launch and reliable operation of your Smartbills integration. If you have any questions or need assistance, don’t hesitate to reach out to our support team at [email protected].