Mode Sandbox / Sandbox Mode
FR : Guide complet pour tester l'API Scell.io en environnement sandbox EN : Complete guide to testing the Scell.io API in sandbox environment
Table des matieres / Table of Contents
- Introduction
- Environnements / Environments
- Cles API / API Keys
- Base de donnees / Database
- Services Simules / Mocked Services
- Tarification / Pricing
- Webhooks
- Bonnes Pratiques / Best Practices
- Migration vers Production
1. Introduction
FR
Le mode sandbox de Scell.io vous permet de tester l'integration de notre API sans :
- Emettre de vraies factures electroniques
- Effectuer de vraies signatures electroniques
- Consommer votre solde de credits
- Affecter des donnees de production
Toutes les operations en sandbox sont 100% simulees mais reproduisent fidelement le comportement de l'API de production.
EN
The Scell.io sandbox mode allows you to test API integration without:
- Issuing real electronic invoices
- Performing real electronic signatures
- Consuming your credit balance
- Affecting production data
All sandbox operations are 100% simulated but faithfully reproduce the production API behavior.
2. Environnements / Environments
FR
| Aspect | Production | Sandbox |
|---|---|---|
| URL API | https://api.scell.io/api/v1 | https://api.scell.io/api/v1 |
| Detection | Prefixe cle API live | Prefixe cle API test/sandbox |
| Base de donnees | pgsql | pgsql_sandbox |
| Services externes | Reels (SuperPDP, OpenAPI.com) | Simules (Mock) |
| Facturation | Debit du solde | Gratuit |
| Validite juridique | Oui | Non |
EN
| Aspect | Production | Sandbox |
|---|---|---|
| API URL | https://api.scell.io/api/v1 | https://api.scell.io/api/v1 |
| Detection | API key prefix live | API key prefix test/sandbox |
| Database | pgsql | pgsql_sandbox |
| External services | Real (SuperPDP, OpenAPI.com) | Mocked |
| Billing | Balance debit | Free |
| Legal validity | Yes | No |
Note : L'URL de l'API est la meme. L'environnement est automatiquement detecte via le prefixe de la cle API.
3. Cles API / API Keys
Prefixes / Prefixes
| Type de cle | Production | Sandbox |
|---|---|---|
| Cle API standard | sk_live_... | sk_test_... |
| Cle Tenant | sk_live_... | sk_test_... |
Note : La "Cle API standard" (
SCELL_API_KEY) et la "Cle Tenant" (SCELL_TENANT_KEY) sont la meme cle (sk_*). Le nom de la variable d'environnement differe selon la documentation, mais vous n'avez qu'une seule cle secrete a generer et stocker.
Obtenir vos cles / Getting your keys
FR
- Connectez-vous a votre tableau de bord Scell.io
- Allez dans Parametres > Cles API
- Copiez vos cles sandbox (prefixe
testousandbox)
EN
- Log in to your Scell.io dashboard
- Go to Settings > API Keys
- Copy your sandbox keys (prefix
testorsandbox)
Exemples d'utilisation / Usage examples
# Production - X-API-Key
curl -X GET "https://api.scell.io/api/v1/invoices" \
-H "X-API-Key: sk_live_abc123..."
# Sandbox - X-API-Key
curl -X GET "https://api.scell.io/api/v1/invoices" \
-H "X-API-Key: sk_test_xyz789..."
# Production - X-Tenant-Key
curl -X GET "https://api.scell.io/api/v1/tenant/invoices" \
-H "X-Tenant-Key: sk_live_abc123..."
# Sandbox - X-Tenant-Key
curl -X GET "https://api.scell.io/api/v1/tenant/invoices" \
-H "X-Tenant-Key: sk_test_xyz789..."
# Production - X-API-Key (Tenant)
curl -X POST "https://api.scell.io/api/v1/tenant/onboarding/start" \
-H "X-API-Key: sk_live_abc123..."
# Sandbox - X-API-Key (Tenant)
curl -X POST "https://api.scell.io/api/v1/tenant/onboarding/start" \
-H "X-API-Key: sk_test_xyz789..."4. Base de donnees / Database
FR
Le sandbox utilise une base de donnees completement separee (pgsql_sandbox). Cela garantit :
- Isolation totale : vos tests n'affectent jamais les donnees de production
- Donnees de test : vous pouvez creer, modifier, supprimer sans risque
- Reinitialisation : la base sandbox peut etre purgee a tout moment via le dashboard
EN
The sandbox uses a completely separate database (pgsql_sandbox). This ensures:
- Total isolation : your tests never affect production data
- Test data : you can create, modify, delete without risk
- Reset : the sandbox database can be purged anytime via the dashboard
Schema
Production Sandbox
+-----------------+ +-----------------+
| pgsql | | pgsql_sandbox |
| | | |
| - tenants | | - tenants |
| - invoices | | - invoices |
| - signatures | | - signatures |
| - ... | | - ... |
+-----------------+ +-----------------+
^ ^
| |
live keys test/sandbox keys5. Services Simules / Mocked Services
5.1 SuperPDP (Facturation)
SuperPDP est la plateforme de facturation electronique (Factur-X, UBL, CII). En sandbox, toutes les operations sont simulees.
SuperPDP is the electronic invoicing platform (Factur-X, UBL, CII). In sandbox, all operations are simulated.
SIRET de test / Test SIRETs
| SIRET | Description |
|---|---|
00000000000001 | Entreprise Test Vendeur |
00000000000002 | Entreprise Test Acheteur |
00000000000003 | Entreprise Test 3 |
12345678901234 | SIRET de test generique |
000* | Tout SIRET commencant par 000 est valide |
TVA de test / Test VAT numbers
| TVA | Description |
|---|---|
FR00000000000 | TVA France test |
FR00123456789 | TVA France test 2 |
DE000000000 | TVA Allemagne test |
FR00* | Tout numero commencant par FR00 est valide |
DE000* | Tout numero commencant par DE000 est valide |
Comportement / Behavior
# Soumettre une facture / Submit an invoice
curl -X POST "https://api.scell.io/api/v1/invoices/INV-001/submit" \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json"
# Reponse / Response
{
"success": true,
"data": {
"superpdp_id": "sandbox_inv_550e8400-e29b-41d4-a716-446655440000",
"status": "transmitted",
"sandbox": true,
"message": "[SANDBOX] Facture soumise avec succes (simulation)"
}
}Simulation de statuts / Status simulation
Vous pouvez tester differents statuts en incluant des patterns dans vos IDs :
| Pattern dans l'ID | Statut simule |
|---|---|
_rejected_ | rejected |
_error_ | error |
_processing_ | processing |
_accepted_ | accepted |
| (defaut) | transmitted |
# Tester un statut rejet / Test rejected status
curl -X GET "https://api.scell.io/api/v1/invoices/status/sandbox_inv_rejected_test" \
-H "X-API-Key: sk_test_xxx"Entreprises de test pre-configurees / Pre-configured test companies
[
{
"name": "Entreprise Test Vendeur",
"siret": "00000000000001",
"vat_number": "FR00000000001",
"address": {
"street": "1 Avenue du Test",
"city": "Paris",
"postal_code": "75001",
"country": "FR"
}
},
{
"name": "Entreprise Test Acheteur",
"siret": "00000000000002",
"vat_number": "FR00000000002",
"address": {
"street": "2 Rue de la Simulation",
"city": "Lyon",
"postal_code": "69001",
"country": "FR"
}
},
{
"name": "Entreprise Test Allemande",
"siret": null,
"vat_number": "DE000000001",
"address": {
"street": "10 Teststrasse",
"city": "Berlin",
"postal_code": "10115",
"country": "DE"
}
}
]5.2 OpenAPI (Signatures)
OpenAPI.com est le service de signature electronique (eIDAS EU-SES). En sandbox, toutes les signatures sont simulees.
OpenAPI.com is the electronic signature service (eIDAS EU-SES). In sandbox, all signatures are simulated.
OTP Universel / Universal OTP
| Code OTP | Utilisation |
|---|---|
123456 | Code OTP toujours accepte en sandbox |
# Verifier l'OTP / Verify OTP
curl -X POST "https://api.scell.io/api/v1/signatures/SIGN-001/verify-otp" \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{"otp": "123456"}'
# Reponse / Response
{
"success": true,
"data": {
"status": "signed",
"message": "[SANDBOX] OTP valide - Signature effectuee",
"sandbox": true
}
}Auto-signature / Auto-sign
En sandbox, les signatures se completent automatiquement apres un delai configurable (defaut : 10 secondes).
In sandbox, signatures complete automatically after a configurable delay (default: 10 seconds).
| Parametre | Valeur par defaut |
|---|---|
auto_sign_after_seconds | 10 |
Simulation d'echecs / Failure simulation
| Pattern dans l'ID | Comportement |
|---|---|
_fail_ | Echec de signature |
_cancelled_ | Signature annulee |
_expired_ | Signature expiree |
_partial_ | Signature partielle |
_waiting_ | En attente des signataires |
| (defaut) | Signature completee |
# Tester un echec / Test failure
curl -X POST "https://api.scell.io/api/v1/signatures" \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Test_fail_document",
"document_path": "/path/to/doc.pdf",
"signers": [{"email": "test@example.com", "first_name": "Test", "last_name": "User"}]
}'Credits illimites / Unlimited credits
# Verifier le solde / Check balance
curl -X GET "https://api.scell.io/api/v1/account/credit" \
-H "X-API-Key: sk_test_xxx"
# Reponse / Response
{
"success": true,
"data": {
"credit": 999999.00,
"currency": "EUR",
"sandbox": true,
"message": "[SANDBOX] Credit illimite en mode test"
}
}Documents telecharges / Downloaded documents
Les documents signes en sandbox contiennent un watermark [SANDBOX] pour les differencier des documents de production.
Documents signed in sandbox contain a [SANDBOX] watermark to differentiate them from production documents.
6. Tarification / Pricing
FR
| Operation | Production | Sandbox |
|---|---|---|
| Facture electronique | 0.04 EUR | Gratuit |
| Avoir electronique | 0.04 EUR | Gratuit |
| Signature electronique | 1.20 EUR | Gratuit |
| Facture entrante | Gratuit | Gratuit |
| Verification SIRET | 0.02 EUR | Gratuit |
| Webhook | Gratuit | Gratuit |
| Stockage | 0.01 EUR/Mo | Gratuit |
En sandbox, aucun debit n'est effectue sur votre solde.
EN
| Operation | Production | Sandbox |
|---|---|---|
| Electronic invoice | 0.04 EUR | Free |
| Credit note | 0.04 EUR | Free |
| Electronic signature | 1.20 EUR | Free |
| Incoming invoice | Free | Free |
| SIRET verification | 0.02 EUR | Free |
| Webhook | Free | Free |
| Storage | 0.01 EUR/Mo | Free |
In sandbox, no charges are made to your balance.
7. Webhooks
FR
Les webhooks fonctionnent normalement en sandbox. Vous recevez les evenements sur vos URL configurees.
EN
Webhooks work normally in sandbox. You receive events on your configured URLs.
Configuration
# Configurer un webhook / Configure a webhook
curl -X POST "https://api.scell.io/api/v1/webhooks" \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/scell",
"events": ["invoice.transmitted", "signature.completed"]
}'Signature de verification / Verification signature
En sandbox, vous pouvez utiliser la signature de test pour simplifier le developpement :
In sandbox, you can use the test signature to simplify development:
| Methode | Valeur |
|---|---|
| Signature de test | sandbox_test_signature |
| Secret sandbox | sandbox_webhook_secret |
// PHP - Verification simplifiee en sandbox
$signature = $_SERVER['HTTP_X_SCELL_SIGNATURE'] ?? '';
// Methode 1: Signature de test
if ($signature === 'sandbox_test_signature') {
// Webhook valide (sandbox uniquement)
}
// Methode 2: HMAC standard
$payload = file_get_contents('php://input');
$expected = hash_hmac('sha256', $payload, 'sandbox_webhook_secret');
if (hash_equals($expected, $signature)) {
// Webhook valide
}Payload d'exemple / Example payload
{
"event": "signature.completed",
"timestamp": "2026-01-25T15:30:00Z",
"data": {
"signature_id": "sandbox_sig_550e8400-e29b-41d4-a716-446655440000",
"status": "signed",
"sandbox": true,
"message": "[SANDBOX] Signature completee (simulation)"
}
}8. Bonnes Pratiques / Best Practices
FR
Commencez toujours par le sandbox
- Testez votre integration complete avant de passer en production
- Validez tous vos workflows avec des donnees de test
Utilisez les SIRET/TVA de test
000*pour les SIRETFR00*ouDE000*pour les TVA- Evitez d'utiliser de vraies donnees d'entreprise en sandbox
Testez les cas d'erreur
- Utilisez les patterns
_fail_,_rejected_pour simuler des echecs - Verifiez que votre application gere correctement les erreurs
- Utilisez les patterns
Configurez vos webhooks en sandbox
- Utilisez des outils comme webhook.site pour capturer les evenements
- Testez la verification de signature
Verifiez les indicateurs [SANDBOX]
- Tous les documents/reponses sandbox contiennent
"sandbox": true - Les messages sont prefixes par
[SANDBOX]
- Tous les documents/reponses sandbox contiennent
Ne pas utiliser en production
- Les cles
test/sandboxne fonctionnent PAS en production - Les documents signes en sandbox n'ont AUCUNE valeur juridique
- Les cles
EN
Always start with sandbox
- Test your complete integration before going to production
- Validate all your workflows with test data
Use test SIRET/VAT
000*for SIRETFR00*orDE000*for VAT- Avoid using real company data in sandbox
Test error cases
- Use patterns
_fail_,_rejected_to simulate failures - Verify your application handles errors correctly
- Use patterns
Configure webhooks in sandbox
- Use tools like webhook.site to capture events
- Test signature verification
Check [SANDBOX] indicators
- All sandbox documents/responses contain
"sandbox": true - Messages are prefixed with
[SANDBOX]
- All sandbox documents/responses contain
Do not use in production
test/sandboxkeys do NOT work in production- Documents signed in sandbox have NO legal value
9. Migration vers Production / Production Migration
Checklist
FR
[ ] Cles API
- Remplacez
sk_test_parsk_live_ - Remplacez
sk_test_parsk_live_
- Remplacez
[ ] Donnees d'entreprise
- Utilisez des vrais SIRET (pas
000*) - Utilisez des vrais numeros TVA (pas
FR00*)
- Utilisez des vrais SIRET (pas
[ ] Webhooks
- Mettez a jour le secret de verification
- Retirez la signature de test
sandbox_test_signature
[ ] OTP
- L'OTP
123456ne fonctionnera plus - Implementez la reception OTP par SMS/Email
- L'OTP
[ ] Tests
- Effectuez un test de bout en bout avec de vraies donnees
- Verifiez la reception des webhooks
[ ] Solde
- Verifiez que votre compte a du credit
- Configurez les alertes de solde bas
EN
[ ] API Keys
- Replace
sk_test_withsk_live_ - Replace
sk_test_withsk_live_
- Replace
[ ] Company data
- Use real SIRET (not
000*) - Use real VAT numbers (not
FR00*)
- Use real SIRET (not
[ ] Webhooks
- Update the verification secret
- Remove test signature
sandbox_test_signature
[ ] OTP
- OTP
123456will no longer work - Implement OTP reception via SMS/Email
- OTP
[ ] Testing
- Perform end-to-end test with real data
- Verify webhook reception
[ ] Balance
- Verify your account has credit
- Configure low balance alerts
Exemple de migration / Migration example
# AVANT (Sandbox) / BEFORE (Sandbox)
export SCELL_API_KEY="sk_test_abc123def456"
# APRES (Production) / AFTER (Production)
export SCELL_API_KEY="sk_live_xyz789ghi012"// config.js
const config = {
// AVANT / BEFORE
// apiKey: process.env.SCELL_TEST_API_KEY,
// APRES / AFTER
apiKey: process.env.SCELL_LIVE_API_KEY,
};Rate Limits
Les rate limits sont relaxes en sandbox pour faciliter les tests :
Rate limits are relaxed in sandbox to facilitate testing:
| Limite | Production | Sandbox |
|---|---|---|
| Appels API / minute | 60 | 1000 |
| Soumissions documents / heure | 100 | 500 |
Support
FR
En cas de probleme avec le sandbox :
- Consultez la documentation API
- Contactez le support : support@scell.io
- Ouvrez un ticket sur le dashboard
EN
If you encounter issues with sandbox:
- Check the API documentation
- Contact support: support@scell.io
- Open a ticket on the dashboard
Resume / Summary
| Aspect | Sandbox |
|---|---|
| Prefixe cle | sk_test_, sk_test_ |
| OTP universel | 123456 |
| SIRET valides | 000*, 12345678901234 |
| TVA valides | FR00*, DE000* |
| Signature webhook | sandbox_test_signature |
| Cout | Gratuit / Free |
| Validite juridique | Non / No |
Derniere mise a jour / Last updated: 2026-01-25