Overview
The Contazen API does not have a dedicated sandbox environment. However, there are several strategies you can use to safely test your integration without affecting real business data.Recommended Testing Strategies
1. Create a Test Invoice Series
The most effective approach is to create a dedicated invoice series for testing purposes.1
Create Test Series
Log into your Contazen account and navigate to Settings → Invoice SeriesCreate a new series with a clear test identifier, for example:
- Series name:
TEST
- Starting number:
1
- Format:
TEST-{number}
2
Use Test Series in API
When creating test invoices via API, specify your test series:
3
Clean Up Test Data
To manage test invoices in Contazen:Individual Deletion:
- Navigate to the invoices list
- Filter by your TEST series
- Click on each invoice to open it
- Delete only if the invoice is:
- Still in draft status
- Already voided (has a storno)
- Is a storno invoice itself
- Contazen does not support bulk deletion of invoices
- Paid or partially paid invoices cannot be deleted
- For non-draft invoices, create a storno (void) instead
- Consider keeping test invoices in draft status for easy cleanup
2. Create Test Clients
Create dedicated test clients to avoid mixing test data with real customers:Prefix test client names with “TEST -” to easily identify and filter them later.
3. Use Draft Mode
Always create test invoices as drafts first:- Don’t affect invoice numbering
- Can be deleted without creating gaps
- Won’t be submitted to ANAF e-Factura
- Can be easily identified and bulk deleted
4. E-Factura Test Environment (SPV)
For testing e-Factura integration, use the SPV test environment:E-Factura testing requires OAuth authentication to be completed. Configure it at:
Settings → E-Factura → ANAF OAuth
SPV Environment Options
Environment | Description | Use Case |
---|---|---|
live | Production ANAF system (default) | Real invoices |
test | SPV test environment | Integration testing |
The SPV test environment allows you to test the full e-Factura flow without submitting real invoices to ANAF.
Testing Checklist
Before going to production, test these scenarios:- Invoice Creation
- Client Management
- E-Factura
- Other Operations
- ✅ Create draft invoices
- ✅ Create final invoices with test series
- ✅ Test with different VAT rates (21%, 19%, 11%, 9%, 5%, 0%)
- ✅ Test reverse charge (taxare inversă)
- ✅ Test multi-currency invoices
- ✅ Test with existing products
- ✅ Test creating new products
Best Practices
1. Separate Test Data
- Use consistent prefixes:
TEST -
for clients,TEST
for invoice series - Use a dedicated email for test notifications
- Document your test client and invoice IDs for easy cleanup
2. Rate Limiting
The API allows 100 requests per minute. During testing:- Add delays between requests
- Use pagination properly
- Cache responses when possible
3. Error Handling
Test error scenarios:- Invalid API key
- Missing required fields
- Invalid CUI formats
- Duplicate clients
- Payment on paid invoices
- Deleting used products
4. Data Cleanup
Create a cleanup script to remove test data:OAuth Configuration for E-Factura
E-Factura features require OAuth authentication with ANAF. Without proper OAuth configuration, e-Factura submissions will fail.
Setup Steps
- Navigate to Settings → E-Factura in your Contazen account
- Click Configure ANAF OAuth
- Complete the OAuth flow with your ANAF credentials
- Verify the connection status shows “Connected”
Testing OAuth Integration
Production Readiness
Before switching to production:- ✅ Remove all test data
- ✅ Switch
spv_environment
to"live"
(or omit it) - ✅ Update API keys if using different ones
- ✅ Verify OAuth is connected for production
- ✅ Test with one real invoice first
- ✅ Monitor error logs closely
Remember: There’s no way to “undo” a submitted e-Factura invoice in production. Always test thoroughly in SPV environment first.