Skip to content

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

  1. Introduction
  2. Environnements / Environments
  3. Cles API / API Keys
  4. Base de donnees / Database
  5. Services Simules / Mocked Services
  6. Tarification / Pricing
  7. Webhooks
  8. Bonnes Pratiques / Best Practices
  9. 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

AspectProductionSandbox
URL APIhttps://api.scell.io/api/v1https://api.scell.io/api/v1
DetectionPrefixe cle API livePrefixe cle API test/sandbox
Base de donneespgsqlpgsql_sandbox
Services externesReels (SuperPDP, OpenAPI.com)Simules (Mock)
FacturationDebit du soldeGratuit
Validite juridiqueOuiNon

EN

AspectProductionSandbox
API URLhttps://api.scell.io/api/v1https://api.scell.io/api/v1
DetectionAPI key prefix liveAPI key prefix test/sandbox
Databasepgsqlpgsql_sandbox
External servicesReal (SuperPDP, OpenAPI.com)Mocked
BillingBalance debitFree
Legal validityYesNo

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 cleProductionSandbox
Cle API standardsk_live_...sk_test_...
Cle Tenantsk_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

  1. Connectez-vous a votre tableau de bord Scell.io
  2. Allez dans Parametres > Cles API
  3. Copiez vos cles sandbox (prefixe test ou sandbox)

EN

  1. Log in to your Scell.io dashboard
  2. Go to Settings > API Keys
  3. Copy your sandbox keys (prefix test or sandbox)

Exemples d'utilisation / Usage examples

bash
# 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 keys

5. 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

SIRETDescription
00000000000001Entreprise Test Vendeur
00000000000002Entreprise Test Acheteur
00000000000003Entreprise Test 3
12345678901234SIRET de test generique
000*Tout SIRET commencant par 000 est valide

TVA de test / Test VAT numbers

TVADescription
FR00000000000TVA France test
FR00123456789TVA France test 2
DE000000000TVA Allemagne test
FR00*Tout numero commencant par FR00 est valide
DE000*Tout numero commencant par DE000 est valide

Comportement / Behavior

bash
# 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'IDStatut simule
_rejected_rejected
_error_error
_processing_processing
_accepted_accepted
(defaut)transmitted
bash
# 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

json
[
  {
    "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 OTPUtilisation
123456Code OTP toujours accepte en sandbox
bash
# 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).

ParametreValeur par defaut
auto_sign_after_seconds10

Simulation d'echecs / Failure simulation

Pattern dans l'IDComportement
_fail_Echec de signature
_cancelled_Signature annulee
_expired_Signature expiree
_partial_Signature partielle
_waiting_En attente des signataires
(defaut)Signature completee
bash
# 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

bash
# 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

OperationProductionSandbox
Facture electronique0.04 EURGratuit
Avoir electronique0.04 EURGratuit
Signature electronique1.20 EURGratuit
Facture entranteGratuitGratuit
Verification SIRET0.02 EURGratuit
WebhookGratuitGratuit
Stockage0.01 EUR/MoGratuit

En sandbox, aucun debit n'est effectue sur votre solde.

EN

OperationProductionSandbox
Electronic invoice0.04 EURFree
Credit note0.04 EURFree
Electronic signature1.20 EURFree
Incoming invoiceFreeFree
SIRET verification0.02 EURFree
WebhookFreeFree
Storage0.01 EUR/MoFree

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

bash
# 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:

MethodeValeur
Signature de testsandbox_test_signature
Secret sandboxsandbox_webhook_secret
php
// 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

json
{
  "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

  1. Commencez toujours par le sandbox

    • Testez votre integration complete avant de passer en production
    • Validez tous vos workflows avec des donnees de test
  2. Utilisez les SIRET/TVA de test

    • 000* pour les SIRET
    • FR00* ou DE000* pour les TVA
    • Evitez d'utiliser de vraies donnees d'entreprise en sandbox
  3. Testez les cas d'erreur

    • Utilisez les patterns _fail_, _rejected_ pour simuler des echecs
    • Verifiez que votre application gere correctement les erreurs
  4. Configurez vos webhooks en sandbox

    • Utilisez des outils comme webhook.site pour capturer les evenements
    • Testez la verification de signature
  5. Verifiez les indicateurs [SANDBOX]

    • Tous les documents/reponses sandbox contiennent "sandbox": true
    • Les messages sont prefixes par [SANDBOX]
  6. Ne pas utiliser en production

    • Les cles test/sandbox ne fonctionnent PAS en production
    • Les documents signes en sandbox n'ont AUCUNE valeur juridique

EN

  1. Always start with sandbox

    • Test your complete integration before going to production
    • Validate all your workflows with test data
  2. Use test SIRET/VAT

    • 000* for SIRET
    • FR00* or DE000* for VAT
    • Avoid using real company data in sandbox
  3. Test error cases

    • Use patterns _fail_, _rejected_ to simulate failures
    • Verify your application handles errors correctly
  4. Configure webhooks in sandbox

    • Use tools like webhook.site to capture events
    • Test signature verification
  5. Check [SANDBOX] indicators

    • All sandbox documents/responses contain "sandbox": true
    • Messages are prefixed with [SANDBOX]
  6. Do not use in production

    • test/sandbox keys 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_ par sk_live_
    • Remplacez sk_test_ par sk_live_
  • [ ] Donnees d'entreprise

    • Utilisez des vrais SIRET (pas 000*)
    • Utilisez des vrais numeros TVA (pas FR00*)
  • [ ] Webhooks

    • Mettez a jour le secret de verification
    • Retirez la signature de test sandbox_test_signature
  • [ ] OTP

    • L'OTP 123456 ne fonctionnera plus
    • Implementez la reception OTP par SMS/Email
  • [ ] 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_ with sk_live_
    • Replace sk_test_ with sk_live_
  • [ ] Company data

    • Use real SIRET (not 000*)
    • Use real VAT numbers (not FR00*)
  • [ ] Webhooks

    • Update the verification secret
    • Remove test signature sandbox_test_signature
  • [ ] OTP

    • OTP 123456 will no longer work
    • Implement OTP reception via SMS/Email
  • [ ] 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

bash
# AVANT (Sandbox) / BEFORE (Sandbox)
export SCELL_API_KEY="sk_test_abc123def456"

# APRES (Production) / AFTER (Production)
export SCELL_API_KEY="sk_live_xyz789ghi012"
javascript
// 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:

LimiteProductionSandbox
Appels API / minute601000
Soumissions documents / heure100500

Support

FR

En cas de probleme avec le sandbox :

EN

If you encounter issues with sandbox:


Resume / Summary

AspectSandbox
Prefixe clesk_test_, sk_test_
OTP universel123456
SIRET valides000*, 12345678901234
TVA validesFR00*, DE000*
Signature webhooksandbox_test_signature
CoutGratuit / Free
Validite juridiqueNon / No

Derniere mise a jour / Last updated: 2026-01-25

Documentation Scell.io