Reference API Scell.io
Version applicative : 1.2.1 (GET /api/v1/version) Derniere mise a jour : 2026-06-11 Base URL : https://api.scell.io/api/v1Note : Le mode sandbox est determine par le prefixe de la cle API (sk_test_ = sandbox, sk_live_ = production), non par l'URL. Modele d'authentification : une cle secrete sk_* appartient a un tenant. Le sous-tenant emetteur est cible via le parametre sub_tenant_id dans le payload (voir authentication.md). Le header primaire est X-API-Key (X-Tenant-Key est legacy).
Table des matieres
- Introduction
- Authentification
- Pagination et filtrage
- Codes d'erreur
- Rate limiting
- 1. Auth
- 2. Companies
- 3. Invoices
- 4. Signatures
- 5. Credit Notes (Avoirs)
- 6. API Keys
- 7. Balance
- 8. Webhooks
- 9. Incoming Invoices (Factures fournisseurs)
- 10. Tenant (Multi-Tenant B2B)
- 11. Sub-Tenants
- 12. Tenant Invoices
- 13. Tenant Credit Notes
- 14. Tenant Billing
- 15. Tenant Incoming Invoices
- 16. KYB Documents
- 17. Onboarding
- 18. Fiscal Entries
- 19. Fiscal Closings
- 20. Fiscal Compliance
- 21. Fiscal Integrity
- 22. Fiscal Rules
- 23. Fiscal Anchors
- 24. Fiscal Kill Switch
- 25. Fiscal Export
- 26. Admin
- 27. MCP Server
- 28. Sandbox
- 29. Tenant Authentication
- 30. Tenant Onboarding
- 31. ISCA Fiscal Documents
- 32. Public Endpoints
- 33. Buyers (Registre acheteurs)
- 34. Quotes (Devis)
- 35. Payment Schedule (Echeanciers)
- 36. Invoice Templates
- 37. Branding
- 38. Credit Packs
- 39. Recurring Invoices (Factures recurrentes)
- 40. Reference (Referentiel pays)
- 41. Sub-Tenant Fiscal (Seuils & Statut)
- 42. Products (Catalogue produits)
- 43. Product Categories (Categories produits)
- 44. Suppliers (Fournisseurs)
- 45. Documents (Apercu live)
Introduction
Scell.io est une plateforme B2B de facturation electronique (Factur-X/UBL/CII) et de signature electronique simple (eIDAS EU-SES) via API.
Toutes les requetes utilisent le format JSON. Toutes les reponses sont en JSON avec le header Content-Type: application/json.
URLs de base
| Environnement | URL |
|---|---|
| Production & Sandbox | https://api.scell.io/api/v1 |
Distinction sandbox/production : Le mode est determine par le prefixe de la cle API (pk_test_ / sk_test_ = sandbox, pk_live_ / sk_live_ = production), peu importe le header utilise (X-API-Key, X-Publishable-Key, ou le header legacy X-Tenant-Key). Le prefixe tk_* n'existe plus.
Tarification
| Operation | Prix unitaire |
|---|---|
| Facture electronique | 0.04 EUR |
| Signature electronique | 1.20 EUR |
| Avoir (credit note) | 0.04 EUR |
Authentification
L'API supporte 4 modes d'authentification selon le contexte d'utilisation.
1. Bearer Token (Dashboard)
Utilise par le frontend / dashboard web. Obtenu via POST /v1/auth/login.
Authorization: Bearer <TOKEN>2. API Key (API externe)
Utilise pour l'integration programmatique. Cle generee via le dashboard.
X-API-Key: sk_live_x8z...Prefixes :
sk_live_: Productionsk_test_: Sandbox
Modele de scope (depuis 2026-05-11) : la cle sk_* appartient a un tenant master. Pas de contrainte company_id. Le scope est decide par le payload :
- Sans
sub_tenant_id-> action sur le tenant master, company emettrice =tenant.default_company_id - Avec
sub_tenant_id-> action sur le sub-tenant (doit appartenir au tenant), company emettrice = premiere company du sub-tenant
Erreurs : 401 TENANT_NOT_RESOLVED, 404 SUB_TENANT_NOT_FOUND, 422 NO_ISSUER_COMPANY. Pour la supervision cross-sub-tenant, voir aussi les routes /v1/tenant/* (middleware tenant.key).
3. Tenant Key (Multi-Tenant)
Utilise par les partenaires integrant la facturation pour leurs clients. Cle secrete a conserver côte serveur.
X-Tenant-Key: sk_live_xxxxxxPrefixes :
sk_test_: Secret Key (Sandbox) - API backend, jamais expose côte clientsk_live_: Secret Key (Production) - API backend, jamais expose côte client
4. Publishable Key (Onboarding)
Utilise pour l'onboarding B2B des partenaires. Cle publiable pouvant etre expose côte client dans les widgets.
X-Publishable-Key: pk_test_xxxxxxPrefixes :
pk_test_: Publishable Key (Sandbox) - Widgets client, peut etre exposepk_live_: Publishable Key (Production) - Widgets client, peut etre expose
Pagination et filtrage
Les endpoints retournant des listes sont pagines.
Parametres de pagination
| Parametre | Type | Defaut | Description |
|---|---|---|---|
page | integer | 1 | Numero de page |
per_page | integer | 25 | Elements par page (max 100) |
Format de reponse paginee
{
"data": [],
"meta": {
"current_page": 1,
"last_page": 10,
"per_page": 25,
"total": 250
}
}Filtres communs
| Parametre | Type | Description |
|---|---|---|
status | string | Filtrer par statut |
from / date_from | date | Date de debut (YYYY-MM-DD) |
to / date_to | date | Date de fin (YYYY-MM-DD) |
environment | string | sandbox ou production |
company_id | uuid | Filtrer par entreprise |
Codes d'erreur
Format d'erreur standard
{
"message": "Description lisible de l'erreur",
"errors": {
"champ": ["Message de validation"]
},
"error_code": "CODE_METIER"
}Codes HTTP
| Code | Signification |
|---|---|
| 200 | Succes |
| 201 | Ressource creee |
| 400 | Requete invalide |
| 401 | Non authentifie |
| 403 | Acces interdit |
| 404 | Ressource introuvable |
| 422 | Erreur de validation |
| 429 | Rate limit depasse |
| 500 | Erreur serveur |
Codes metier
| Code | Signification |
|---|---|
INSUFFICIENT_BALANCE | Solde insuffisant pour l'operation |
INVOICE_IMMUTABLE | Facture non modifiable (champs fiscaux verrouilles) |
FISCAL_KILLSWITCH_ACTIVE | Kill-switch fiscal actif, operations bloquees |
SIGNATURE_EXPIRED | Demande de signature expiree |
ALREADY_COMPLETED | Signature deja terminee |
CANNOT_REMIND | Rappel impossible pour cette signature |
NO_PENDING_SIGNERS | Aucun signataire en attente |
FILE_NOT_FOUND | Fichier non disponible |
Rate limiting
| Contexte | Limite |
|---|---|
| Production (API Key) | 60 requetes/minute |
| Sandbox (API Key) | 1000 requetes/minute |
| Tenant API | 100 requetes/minute |
| Onboarding | 30 requetes/minute |
| Onboarding exchange | 5 requetes/minute |
| MCP | 60 requetes/minute |
Headers de reponse :
X-RateLimit-Limit: Limite totaleX-RateLimit-Remaining: Requetes restantesX-RateLimit-Reset: Timestamp de reinitialisation
1. Auth
POST /v1/auth/register
Inscription d'un nouvel utilisateur. Cree un compte et retourne un token d'acces.
Authentification : Aucune
Corps de la requete :
| Champ | Type | Requis | Description |
|---|---|---|---|
email | string (email) | oui | Adresse email |
password | string | oui | Mot de passe |
first_name | string | oui | Prenom |
last_name | string | oui | Nom |
phone | string | oui | Telephone (+33...) |
Reponse (201) :
{
"message": "Inscription reussie",
"user": {
"id": "uuid",
"email": "user@example.com",
"first_name": "Jean",
"last_name": "Dupont",
"phone": "+33612345678",
"role": "user",
"created_at": "2026-01-15T10:30:00Z"
},
"token": "1|AbCdEf123456..."
}Exemples :
# curl
curl -X POST https://api.scell.io/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "secret123",
"first_name": "Jean",
"last_name": "Dupont",
"phone": "+33612345678"
}'// JavaScript
const response = await fetch('https://api.scell.io/api/v1/auth/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'user@example.com',
password: 'secret123',
first_name: 'Jean',
last_name: 'Dupont',
phone: '+33612345678'
})
});
const data = await response.json();// PHP
$client = new \GuzzleHttp\Client();
$response = $client->post('https://api.scell.io/api/v1/auth/register', [
'json' => [
'email' => 'user@example.com',
'password' => 'secret123',
'first_name' => 'Jean',
'last_name' => 'Dupont',
'phone' => '+33612345678'
]
]);# Python
import requests
response = requests.post("https://api.scell.io/api/v1/auth/register", json={
"email": "user@example.com",
"password": "secret123",
"first_name": "Jean",
"last_name": "Dupont",
"phone": "+33612345678"
})
print(response.json())Erreurs : 422 (validation : email deja pris, mot de passe trop court)
POST /v1/auth/login
Authentifie un utilisateur et retourne un token d'acces.
Authentification : Aucune
Corps de la requete :
| Champ | Type | Requis | Description |
|---|---|---|---|
email | string (email) | oui | Adresse email |
password | string | oui | Mot de passe |
Reponse (200) :
{
"message": "Connexion reussie",
"user": {
"id": "uuid",
"email": "user@example.com",
"first_name": "Jean",
"last_name": "Dupont",
"role": "user"
},
"token": "1|AbCdEf123456..."
}curl -X POST https://api.scell.io/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "secret123"}'Erreurs : 422 (identifiants incorrects, compte desactive)
GET /v1/auth/google
Retourne l'URL de redirection pour l'authentification Google OAuth.
Authentification : Aucune
Reponse (200) :
{
"url": "https://accounts.google.com/o/oauth2/auth?client_id=..."
}curl -X GET https://api.scell.io/api/v1/auth/googleGET /v1/auth/google/callback
Gere le retour de Google OAuth. Cree ou connecte l'utilisateur et retourne un token.
Authentification : Aucune (callback Google)
Reponse (200) :
{
"message": "Connexion reussie via Google",
"user": { "id": "uuid", "email": "...", "first_name": "...", "last_name": "..." },
"token": "1|..."
}Erreurs : 401 (echec authentification Google)
POST /v1/auth/forgot-password
Envoie un email de reinitialisation de mot de passe.
Authentification : Aucune
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
email | string (email) | oui | Adresse email du compte |
curl -X POST https://api.scell.io/api/v1/auth/forgot-password \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com"}'POST /v1/auth/reset-password
Reinitialise le mot de passe avec le token recu par email.
Authentification : Aucune
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
token | string | oui | Token de reinitialisation |
email | string (email) | oui | Adresse email |
password | string | oui | Nouveau mot de passe |
password_confirmation | string | oui | Confirmation |
curl -X POST https://api.scell.io/api/v1/auth/reset-password \
-H "Content-Type: application/json" \
-d '{
"token": "abc123...",
"email": "user@example.com",
"password": "newpassword",
"password_confirmation": "newpassword"
}'POST /v1/auth/logout
Deconnexion : revoque le token actuel.
Authentification : Bearer Token
curl -X POST https://api.scell.io/api/v1/auth/logout \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"message": "Deconnexion reussie"
}GET /v1/auth/me
Retourne le profil de l'utilisateur authentifie.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/auth/me \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": {
"id": "uuid",
"email": "user@example.com",
"first_name": "Jean",
"last_name": "Dupont",
"phone": "+33612345678",
"role": "user",
"is_active": true,
"avatar_url": null,
"last_login_at": "2026-01-15T10:30:00Z",
"created_at": "2026-01-10T08:00:00Z"
}
}2. Companies
GET /v1/companies
Liste les entreprises de l'utilisateur connecte.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/companies \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": [
{
"id": "uuid",
"name": "Ma Societe",
"siret": "12345678901234",
"vat_number": "FR12345678901",
"legal_form": "SAS",
"address_line1": "1 Rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"country": "FR",
"status": "active",
"kyc_completed_at": null,
"created_at": "2026-01-10T08:00:00Z"
}
]
}POST /v1/companies
Cree une nouvelle entreprise.
Authentification : Bearer Token
Corps de la requete :
| Champ | Type | Requis | Description |
|---|---|---|---|
name | string | oui | Raison sociale |
siret | string (14 car.) | oui | Numero SIRET (unique) |
vat_number | string | non | Numero TVA intracommunautaire |
legal_form | string | non | Forme juridique (SAS, SARL...) |
address_line1 | string | oui | Adresse ligne 1 |
address_line2 | string | non | Adresse ligne 2 |
postal_code | string | oui | Code postal |
city | string | oui | Ville |
country | string (2 car.) | non | Code pays ISO (defaut: FR) |
phone | string | non | Telephone |
email | string (email) | non | Email de contact |
website | string (url) | non | Site web |
curl -X POST https://api.scell.io/api/v1/companies \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Ma Societe",
"siret": "12345678901234",
"address_line1": "1 Rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
}'Reponse (201) :
{
"message": "Entreprise creee avec succes",
"data": { "id": "uuid", "name": "Ma Societe", "siret": "12345678901234", "..." : "..." }
}Erreurs : 422 (SIRET invalide, SIRET deja enregistre)
GET /v1/companies/{id}
Recupere les details d'une entreprise.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/companies/{id} \
-H "Authorization: Bearer <TOKEN>"PUT /v1/companies/{id}
Met a jour une entreprise.
Authentification : Bearer Token
Corps : Memes champs que la creation (tous optionnels).
curl -X PUT https://api.scell.io/api/v1/companies/{id} \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"phone": "+33612345678", "email": "contact@masociete.fr"}'DELETE /v1/companies/{id}
Supprime une entreprise.
Authentification : Bearer Token
curl -X DELETE https://api.scell.io/api/v1/companies/{id} \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"message": "Entreprise supprimee"
}POST /v1/companies/{id}/kyc
Lance la procedure KYC pour une entreprise.
Authentification : Bearer Token
curl -X POST https://api.scell.io/api/v1/companies/{id}/kyc \
-H "Authorization: Bearer <TOKEN>"GET /v1/companies/{id}/kyc/status
Retourne le statut KYC d'une entreprise.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/companies/{id}/kyc/status \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": {
"status": "pending",
"completed_at": null,
"reference": null
}
}3. Invoices
POST /v1/invoices
Cree une nouvelle facture electronique. En production, debite 0.04 EUR du solde.
Authentification : API Key (X-API-Key)
Corps de la requete :
| Champ | Type | Requis | Description |
|---|---|---|---|
external_id | string | non | Identifiant externe (votre reference) |
invoice_number | string | oui | Numero de facture |
direction | string | oui | outgoing (vente) ou incoming (achat) |
output_format | string | oui | facturx, ubl ou cii |
issue_date | date | oui | Date d'emission (YYYY-MM-DD) |
due_date | date | non | Date d'echeance |
currency | string (3 car.) | non | Devise ISO (defaut: EUR) |
total_ht | number | oui | Montant HT |
total_tax | number | oui | Montant TVA |
total_ttc | number | oui | Montant TTC |
seller_siret | string (14 car.) | oui | SIRET vendeur |
seller_name | string | oui | Nom vendeur |
seller_address | object | oui | Adresse vendeur |
seller_address.line1 | string | oui | Ligne 1 |
seller_address.postal_code | string | oui | Code postal |
seller_address.city | string | oui | Ville |
seller_address.country | string (2 car.) | non | Code pays ISO |
buyer_siret | string (14 car.) | conditionnel | SIRET acheteur — requis SI buyer_country=FR ET buyer_is_individual n'est pas true. Voir B2C ci-dessous. |
buyer_name | string | oui | Nom acheteur (raison sociale OU nom complet du particulier) |
buyer_address | object | oui | Adresse acheteur (meme structure que seller) |
buyer_is_individual | boolean | non | Flag B2C. true si l'acheteur est un particulier (defaut: false). Quand true, buyer_siret / buyer_vat_number / buyer_legal_id deviennent optionnels et la generation Factur-X / UBL / CII omet BT-46/BT-47/BT-48 (BR-CO-26 EN16931). Les mentions legales B2B (Code de commerce L441-10) sont automatiquement supprimees. |
lines | array | oui | Lignes de facture (min: 1) |
lines[].description | string | oui | Description de la ligne |
lines[].quantity | number | oui | Quantite |
lines[].unit_price | number | oui | Prix unitaire HT |
lines[].tax_rate | number | oui | Taux TVA (%) |
lines[].total_ht | number | oui | Total HT de la ligne |
lines[].total_tax | number | oui | TVA de la ligne |
lines[].total_ttc | number | oui | TTC de la ligne |
lines[].vat_category | enum | non | Categorie TVA (autoliquidation intra-UE) : STANDARD, REDUCED, INTRACOM_GOODS (K, livraison intracom de biens, art. 262 ter I), EXPORT (G, export hors UE, art. 262 I), FRANCHISE_BASE (E, franchise en base, art. 293 B), EXEMPT_TRAINING (E, formation pro, art. 261-4-4°a)… |
lines[].supply_type | enum | non | goods | services (regle le lieu d'imposition) |
lines[].place_of_supply | string(2) | non | Pays de taxation (ISO 2) |
lines[].vat_override_reason | string | non | Justifie une categorie TVA forcee (tracee) |
archive_enabled | boolean | non | Archivage longue duree |
Resolution TVA autoritaire serveur. Le serveur recalcule la categorie TVA attendue. En cas de divergence non justifiee, il renvoie
409 VAT_CORRECTION_REQUIRED; passervat_override_reasonpour forcer (override trace). Les mentions Factur-X BT-120 (cadre legal bilingue) sont emises automatiquement selon la categorie.
B2B — Acheteur entreprise française (cas standard)
curl -X POST https://api.scell.io/api/v1/invoices \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "FACT-2026-001",
"direction": "outgoing",
"output_format": "facturx",
"issue_date": "2026-01-15",
"due_date": "2026-02-15",
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00,
"seller_siret": "12345678901234",
"seller_name": "Ma Societe SAS",
"seller_address": {
"line1": "1 Rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
},
"buyer_siret": "98765432109876",
"buyer_name": "Client SARL",
"buyer_address": {
"line1": "10 Avenue des Champs",
"postal_code": "75008",
"city": "Paris",
"country": "FR"
},
"lines": [
{
"description": "Prestation de conseil",
"quantity": 10,
"unit_price": 100.00,
"tax_rate": 20.00,
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00
}
]
}'B2C — Acheteur particulier (depuis backend v2026-05-03)
Pour un acheteur particulier (B2C), passer "buyer_is_individual": true. Le SIRET / VAT / legal_id deviennent alors optionnels et le Factur-X genere est conforme BR-CO-26.
curl -X POST https://api.scell.io/api/v1/invoices \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "FACT-2026-002",
"direction": "outgoing",
"output_format": "facturx",
"issue_date": "2026-05-03",
"due_date": "2026-06-03",
"total_ht": 150.00,
"total_tax": 30.00,
"total_ttc": 180.00,
"seller_siret": "12345678901234",
"seller_name": "Coach Pro SAS",
"seller_country": "FR",
"seller_address": {
"line1": "1 Rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
},
"buyer_name": "Marie Dupont",
"buyer_country": "FR",
"buyer_address": {
"line1": "12 Rue de Rivoli",
"postal_code": "75001",
"city": "Paris",
"country": "FR"
},
"buyer_is_individual": true,
"lines": [
{
"description": "Coaching individuel",
"quantity": 1,
"unit_price": 150.00,
"tax_rate": 20.00,
"total_ht": 150.00,
"total_tax": 30.00,
"total_ttc": 180.00
}
]
}'Effets cote serveur quand buyer_is_individual=true :
- Validation :
buyer_siret/buyer_vat_number/buyer_legal_idnon requis (meme sibuyer_country=FR). - Factur-X / UBL / CII genere : balises
BT-46(BuyerLegalOrganisation),BT-47(BuyerTaxIdentifier),BT-48(BuyerVATIdentifier) omises. SeulBT-44(Name) etBG-8(Address) sont conserves. Conforme EN16931 BR-CO-26. - Conditions de paiement : les mentions B2B obligatoires (Code de commerce L441-10 — penalites de retard 3x taux legal, indemnite forfaitaire 40 EUR) sont automatiquement supprimees.
- Les avoirs (credit notes) crees a partir d'une facture B2C heritent du flag
buyer_is_individual=true.
// JavaScript
const response = await fetch('https://api.scell.io/api/v1/invoices', {
method: 'POST',
headers: {
'X-API-Key': 'sk_live_xxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoice_number: 'FACT-2026-001',
direction: 'outgoing',
output_format: 'facturx',
issue_date: '2026-01-15',
total_ht: 1000.00,
total_tax: 200.00,
total_ttc: 1200.00,
seller_siret: '12345678901234',
seller_name: 'Ma Societe SAS',
seller_address: { line1: '1 Rue de la Paix', postal_code: '75001', city: 'Paris' },
buyer_siret: '98765432109876',
buyer_name: 'Client SARL',
buyer_address: { line1: '10 Avenue des Champs', postal_code: '75008', city: 'Paris' },
lines: [{
description: 'Prestation de conseil',
quantity: 10,
unit_price: 100.00,
tax_rate: 20.00,
total_ht: 1000.00,
total_tax: 200.00,
total_ttc: 1200.00
}]
})
});// PHP
$response = $client->post('https://api.scell.io/api/v1/invoices', [
'headers' => ['X-API-Key' => 'sk_live_xxx'],
'json' => [
'invoice_number' => 'FACT-2026-001',
'direction' => 'outgoing',
'output_format' => 'facturx',
'issue_date' => '2026-01-15',
'total_ht' => 1000.00,
'total_tax' => 200.00,
'total_ttc' => 1200.00,
'seller_siret' => '12345678901234',
'seller_name' => 'Ma Societe SAS',
'seller_address' => ['line1' => '1 Rue de la Paix', 'postal_code' => '75001', 'city' => 'Paris'],
'buyer_siret' => '98765432109876',
'buyer_name' => 'Client SARL',
'buyer_address' => ['line1' => '10 Avenue des Champs', 'postal_code' => '75008', 'city' => 'Paris'],
'lines' => [[
'description' => 'Prestation de conseil',
'quantity' => 10,
'unit_price' => 100.00,
'tax_rate' => 20.00,
'total_ht' => 1000.00,
'total_tax' => 200.00,
'total_ttc' => 1200.00
]]
]
]);# Python
import requests
response = requests.post("https://api.scell.io/api/v1/invoices",
headers={"X-API-Key": "sk_live_xxx"},
json={
"invoice_number": "FACT-2026-001",
"direction": "outgoing",
"output_format": "facturx",
"issue_date": "2026-01-15",
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00,
"seller_siret": "12345678901234",
"seller_name": "Ma Societe SAS",
"seller_address": {"line1": "1 Rue de la Paix", "postal_code": "75001", "city": "Paris"},
"buyer_siret": "98765432109876",
"buyer_name": "Client SARL",
"buyer_address": {"line1": "10 Avenue des Champs", "postal_code": "75008", "city": "Paris"},
"lines": [{
"description": "Prestation de conseil",
"quantity": 10,
"unit_price": 100.00,
"tax_rate": 20.00,
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00
}]
}
)Reponse (201) :
{
"message": "Facture creee avec succes",
"data": {
"id": "uuid",
"invoice_number": "FACT-2026-001",
"direction": "outgoing",
"output_format": "facturx",
"status": "draft",
"issue_date": "2026-01-15",
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00,
"seller_siret": "12345678901234",
"seller_name": "Ma Societe SAS",
"buyer_siret": "98765432109876",
"buyer_name": "Client SARL",
"lines": [...],
"created_at": "2026-01-15T10:30:00Z"
}
}Erreurs : 422 (validation), 402 (solde insuffisant)
GET /v1/invoices
Liste les factures de l'utilisateur.
Authentification : Bearer Token
Parametres de requete :
| Parametre | Type | Description |
|---|---|---|
company_id | uuid | Filtrer par entreprise |
status | string | Filtrer par statut (draft, validated, submitted, paid) |
direction | string | outgoing ou incoming |
environment | string | sandbox ou production |
from | date | Date de debut |
to | date | Date de fin |
per_page | integer | Elements par page (defaut: 25) |
curl -X GET "https://api.scell.io/api/v1/invoices?direction=outgoing&status=validated" \
-H "Authorization: Bearer <TOKEN>"GET /v1/invoices/{id}
Recupere les details d'une facture avec ses lignes.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/invoices/{id} \
-H "Authorization: Bearer <TOKEN>"GET /v1/invoices/{id}/download/{type}
Genere un lien de telechargement temporaire (15 minutes).
Authentification : API Key
Parametres de chemin :
| Parametre | Valeurs | Description |
|---|---|---|
type | original | Fichier original uploade |
converted | Version convertie (Factur-X, UBL...) | |
pdf | Version PDF visible |
curl -X GET https://api.scell.io/api/v1/invoices/{id}/download/pdf \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"url": "https://storage.scell.io/...",
"expires_at": "2026-01-15T10:45:00Z"
}GET /v1/invoices/{id}/audit-trail
Recupere la piste d'audit fiable (PAF) d'une facture.
Authentification : API Key
curl -X GET https://api.scell.io/api/v1/invoices/{id}/audit-trail \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"data": [
{
"action": "invoice.created",
"details": "Creation",
"actor_ip": "192.168.1.1",
"created_at": "2026-01-15T10:30:00Z"
},
{
"action": "invoice.submitted",
"details": "Soumission au PDP",
"actor_ip": "192.168.1.1",
"created_at": "2026-01-15T10:31:00Z"
}
],
"integrity_valid": true
}POST /v1/invoices/{id}/submit
Soumet une facture brouillon au PDP (Plateforme de Dematerialisation Partenaire).
Authentification : API Key
curl -X POST https://api.scell.io/api/v1/invoices/{id}/submit \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"message": "Facture soumise avec succes",
"data": {
"id": "uuid",
"status": "submitted",
"submitted_at": "2026-01-15T10:31:00Z"
}
}POST /v1/invoices/convert
Convertit une facture vers un autre format (UBL vers Factur-X, etc.).
Authentification : API Key
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
invoice_id | uuid | oui | ID de la facture a convertir |
target_format | string | oui | facturx, ubl ou cii |
curl -X POST https://api.scell.io/api/v1/invoices/convert \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"invoice_id": "uuid", "target_format": "facturx"}'4. Signatures
POST /v1/signatures
Cree une demande de signature electronique (eIDAS EU-SES). En production, debite 1.20 EUR.
Authentification : API Key (X-API-Key)
Corps de la requete :
| Champ | Type | Requis | Description |
|---|---|---|---|
external_id | string | non | Identifiant externe |
title | string | oui | Titre du document |
description | string | non | Description |
document | string (base64) | oui | Document PDF encode en Base64 |
document_name | string | oui | Nom du fichier |
signers | array | oui | Liste des signataires (1-10) |
signers[].first_name | string | oui | Prenom |
signers[].last_name | string | oui | Nom |
signers[].email | string (email) | oui* | Email (*requis si pas de phone) |
signers[].phone | string | oui* | Telephone (*requis si pas d'email) |
signers[].auth_method | string | oui | email, sms ou both |
signers[].message | string | non | Message custom envoye au signataire (max 500 chars, placeholder {OTP} remplace par le code OTP) |
signature_positions | array | non | Positions de signature |
signature_positions[].page | integer (>=1) | oui | Numero de page |
signature_positions[].x | number (0-5000) | oui | Position X |
signature_positions[].y | number (0-5000) | oui | Position Y |
signature_positions[].unit | string | non | percent (defaut) ou pixel |
signature_positions[].width | number | non | Largeur |
signature_positions[].height | number | non | Hauteur |
signature_positions[].page_width_px | number | non | Largeur page en px (@72dpi). Si absent : detection auto via parser PDF cote serveur, fallback A4 (595). |
signature_positions[].page_height_px | number | non | Hauteur page en px (@72dpi). Si absent : detection auto via parser PDF cote serveur, fallback A4 (842). |
ui_config | object | non | Personnalisation UI (21 champs conformes spec OpenAPI.com EU-SES v1.0.17) |
ui_config.sidebar_logo | string (url) | non | URL du logo affiche dans la sidebar |
ui_config.sidebar_background_color | string (hex #RRGGBB) | non | Couleur de fond sidebar |
ui_config.sidebar_title_color | string (hex) | non | Couleur des titres sidebar |
ui_config.sidebar_text_color | string (hex) | non | Couleur du texte sidebar |
ui_config.header_background_color | string (hex) | non | Couleur de fond header |
ui_config.header_title_color | string (hex) | non | Couleur du titre header |
ui_config.header_subtitle_color | string (hex) | non | Couleur du sous-titre header |
ui_config.footer_background_color | string (hex) | non | Couleur de fond footer |
ui_config.button_text_color | string (hex) | non | Couleur texte des boutons |
ui_config.button_text_color_hover | string (hex) | non | Couleur texte des boutons au survol |
ui_config.button_background_color | string (hex) | non | Couleur de fond des boutons |
ui_config.button_background_color_hover | string (hex) | non | Couleur de fond des boutons au survol |
ui_config.sign_button_text_color | string (hex) | non | Couleur texte du bouton de signature |
ui_config.sign_button_text_color_hover | string (hex) | non | Couleur texte du bouton de signature au survol |
ui_config.sign_button_background_color | string (hex) | non | Couleur de fond du bouton de signature |
ui_config.sign_button_background_color_hover | string (hex) | non | Couleur de fond du bouton de signature au survol |
ui_config.hide_sidebar | boolean | non | Masquer la sidebar |
ui_config.hide_header | boolean | non | Masquer le header |
ui_config.hide_download_validated | boolean | non | Masquer le bouton de telechargement apres validation |
ui_config.hide_download_signed | boolean | non | Masquer le bouton de telechargement du document signe |
ui_config.iframe_ancestors | array (max 20) | non | URLs autorisees a integrer la page de signature en iframe |
signature_options | object | non | Options de comportement de la signature |
signature_options.signature_mode | string | non | typed, drawn ou both |
signature_options.signer_must_read | boolean | non | Impose au signataire de faire defiler le document avant de signer |
signature_options.user_editable_data | object | non | Champs modifiables par le signataire : name, mobile, email (boolean chacun) |
signature_options.timezone | string | non | Fuseau horaire IANA (ex: Europe/Paris) |
redirect_complete_url | string (url) | non | URL de redirection apres signature |
redirect_cancel_url | string (url) | non | URL de redirection en cas d'annulation |
expires_at | datetime | non | Expiration (defaut: +30 jours) |
archive_enabled | boolean | non | Archivage longue duree |
curl -X POST https://api.scell.io/api/v1/signatures \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Contrat de prestation",
"document_name": "contrat.pdf",
"document": "<BASE64_CONTENT>",
"signers": [
{
"first_name": "Jean",
"last_name": "Dupont",
"email": "jean.dupont@example.com",
"auth_method": "email"
}
],
"redirect_complete_url": "https://mon-site.com/signature-ok",
"redirect_cancel_url": "https://mon-site.com/signature-annulee"
}'// JavaScript
const fs = require('fs');
const document = fs.readFileSync('contrat.pdf').toString('base64');
const response = await fetch('https://api.scell.io/api/v1/signatures', {
method: 'POST',
headers: {
'X-API-Key': 'sk_live_xxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Contrat de prestation',
document_name: 'contrat.pdf',
document: document,
signers: [{
first_name: 'Jean',
last_name: 'Dupont',
email: 'jean.dupont@example.com',
auth_method: 'email'
}]
})
});// PHP
$document = base64_encode(file_get_contents('contrat.pdf'));
$response = $client->post('https://api.scell.io/api/v1/signatures', [
'headers' => ['X-API-Key' => 'sk_live_xxx'],
'json' => [
'title' => 'Contrat de prestation',
'document_name' => 'contrat.pdf',
'document' => $document,
'signers' => [[
'first_name' => 'Jean',
'last_name' => 'Dupont',
'email' => 'jean.dupont@example.com',
'auth_method' => 'email'
]]
]
]);# Python
import base64, requests
with open("contrat.pdf", "rb") as f:
document = base64.b64encode(f.read()).decode()
response = requests.post("https://api.scell.io/api/v1/signatures",
headers={"X-API-Key": "sk_live_xxx"},
json={
"title": "Contrat de prestation",
"document_name": "contrat.pdf",
"document": document,
"signers": [{
"first_name": "Jean",
"last_name": "Dupont",
"email": "jean.dupont@example.com",
"auth_method": "email"
}]
}
)Reponse (201) :
{
"message": "Demande de signature creee",
"data": {
"id": "uuid",
"title": "Contrat de prestation",
"status": "pending",
"signers": [
{
"first_name": "Jean",
"last_name": "Dupont",
"email": "jean.dupont@example.com",
"status": "pending",
"signing_url": "https://sign.scell.io/..."
}
],
"expires_at": "2026-02-15T10:30:00Z",
"created_at": "2026-01-15T10:30:00Z"
}
}GET /v1/signatures
Liste les demandes de signature du tenant courant (scope tenant_id via company.tenant_id).
Authentification : Bearer Token (dashboard Sanctum) ou X-API-Key sk_live_* / sk_test_* (SDK)
Parametres :
| Parametre | Type | Description |
|---|---|---|
status | string | pending, completed, refused, expired |
environment | string | sandbox ou production |
company_id | uuid | Filtre par company (anti-IDOR : doit appartenir au tenant) |
sub_tenant_id | uuid | Filtre par sub-tenant (anti-IDOR : doit appartenir au tenant) |
per_page | integer | Elements par page (max 100) |
curl -X GET "https://api.scell.io/api/v1/signatures?status=pending&per_page=50" \
-H "X-API-Key: sk_live_xxx"GET /v1/signatures/{id}
Recupere les details d'une signature avec ses signataires (scope tenant via company.tenant_id).
Authentification : Bearer Token (dashboard Sanctum) ou X-API-Key sk_live_* / sk_test_* (SDK)
curl -X GET https://api.scell.io/api/v1/signatures/{id} \
-H "X-API-Key: sk_live_xxx"GET /v1/signatures/{id}/download/{type}
Telecharge les fichiers de signature.
Authentification : API Key
Types disponibles : original (document original), signed (document signe), audit_trail (dossier de preuve)
curl -X GET https://api.scell.io/api/v1/signatures/{id}/download/signed \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"url": "https://storage.scell.io/...",
"expires_at": "2026-01-15T10:45:00Z"
}POST /v1/signatures/{id}/remind
Envoie un rappel aux signataires en attente.
Authentification : API Key
curl -X POST https://api.scell.io/api/v1/signatures/{id}/remind \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"message": "Rappels envoyes",
"signers_reminded": 2
}Erreurs : 400 (CANNOT_REMIND, NO_PENDING_SIGNERS)
POST /v1/signatures/{id}/cancel
Annule une demande de signature en cours.
Authentification : API Key
curl -X POST https://api.scell.io/api/v1/signatures/{id}/cancel \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"message": "Signature annulee"
}Erreurs : 400 (ALREADY_COMPLETED - impossible d'annuler une signature terminee)
5. Credit Notes (Avoirs)
GET /v1/credit-notes
Liste les avoirs.
Authentification : Bearer Token
Parametres :
| Parametre | Type | Description |
|---|---|---|
status | string | draft ou sent |
invoice_id | uuid | Facture d'origine |
type | string | partial ou total |
per_page | integer | Elements par page (defaut: 15) |
curl -X GET "https://api.scell.io/api/v1/credit-notes?status=sent" \
-H "Authorization: Bearer <TOKEN>"POST /v1/credit-notes
Cree un avoir (credit note). Debite 0.04 EUR en production.
Authentification : Bearer Token
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
invoice_id | uuid | oui | ID de la facture d'origine |
type | enum | oui | partial ou total |
reason | string | oui | Motif de l'avoir |
lines | array | conditionnel | Requis si type=partial : selection de lignes de la facture d'origine |
lines[].invoice_line_id | uuid | oui | Ligne de la facture d'origine a crediter |
lines[].quantity | number | oui | Quantite a crediter (<= quantite restante creditible) |
Heritage du taux de TVA par ligne. Le prix unitaire et le taux de TVA exact de chaque ligne sont herites de la facture d'origine — une facture melant 20 % / 5,5 % / exonere est creditee ligne par ligne au bon taux. Les anciens champs libres (
items[].unit_price/tax_rate/total) ne sont plus acceptes en entree. Pour un avoir total (type=total),linesest optionnel (toutes les lignes restantes sont creditees).
# Avoir partiel : selectionner les lignes a crediter
curl -X POST https://api.scell.io/api/v1/credit-notes \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"invoice_id": "uuid-facture",
"type": "partial",
"reason": "Retour de marchandise",
"lines": [
{ "invoice_line_id": "uuid-ligne", "quantity": 1 }
]
}'Decouverte prealable (
GET /v1/invoices/{invoice}/remaining-creditable, SDKcreditNotes.remainingCreditable(invoiceId)) : retourne, par ligne,remaining_quantity,tax_rate,remaining_amount_htetcan_be_credited— l'etape qui precede un avoir partiel.
GET /v1/credit-notes/{id}
Recupere les details d'un avoir.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/credit-notes/{id} \
-H "Authorization: Bearer <TOKEN>"DELETE /v1/credit-notes/{id}
Supprime un avoir en brouillon. Les avoirs envoyes ne peuvent pas etre supprimes (autocertification ISCA — chaine fiscale immuable).
Authentification : Bearer Token
curl -X DELETE https://api.scell.io/api/v1/credit-notes/{id} \
-H "Authorization: Bearer <TOKEN>"Erreurs : 403 (l'avoir n'est pas en brouillon, suppression interdite)
POST /v1/credit-notes/{id}/send
Envoie un avoir (le fait passer de draft a sent). Irreversible.
Authentification : Bearer Token
curl -X POST https://api.scell.io/api/v1/credit-notes/{id}/send \
-H "Authorization: Bearer <TOKEN>"GET /v1/credit-notes/{id}/download
Telecharge le PDF de l'avoir.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/credit-notes/{id}/download \
-H "Authorization: Bearer <TOKEN>"GET /v1/invoices/{invoice}/remaining-creditable
Retourne les montants restants creditables pour une facture (pour eviter un avoir superieur au montant facture).
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/invoices/{invoice}/remaining-creditable \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": {
"invoice_id": "uuid",
"invoice_total_ht": 1000.00,
"already_credited_ht": 200.00,
"remaining_creditable_ht": 800.00,
"lines": [
{
"description": "Prestation",
"original_quantity": 10,
"credited_quantity": 2,
"remaining_quantity": 8
}
]
}
}6. API Keys
GET /v1/api-keys
Liste les cles API.
Authentification : Bearer Token
Parametres :
| Parametre | Type | Description |
|---|---|---|
company_id | uuid | Filtrer par entreprise |
environment | string | sandbox ou production |
curl -X GET "https://api.scell.io/api/v1/api-keys?environment=production" \
-H "Authorization: Bearer <TOKEN>"POST /v1/api-keys
Genere une nouvelle cle API. La cle complete n'est retournee qu'une seule fois.
Authentification : Bearer Token
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
name | string | oui | Nom descriptif |
company_id | uuid | oui | ID de l'entreprise |
environment | string | oui | sandbox ou production |
scopes | array | non | Permissions (invoices, signatures) |
expires_at | datetime | non | Date d'expiration |
curl -X POST https://api.scell.io/api/v1/api-keys \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Cle Production Server 1",
"company_id": "uuid",
"environment": "production",
"scopes": ["invoices", "signatures"]
}'Reponse (201) :
{
"message": "Cle API creee",
"data": {
"id": "uuid",
"name": "Cle Production Server 1",
"key": "sk_live_x8z...",
"prefix": "sk_live_x8z",
"environment": "production",
"scopes": ["invoices", "signatures"],
"created_at": "2026-01-15T10:30:00Z"
},
"warning": "Conservez cette cle en securite. Elle ne sera plus affichee."
}GET /v1/api-keys/{id}
Recupere les details d'une cle API (sans la cle complete).
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/api-keys/{id} \
-H "Authorization: Bearer <TOKEN>"DELETE /v1/api-keys/{id}
Revoque une cle API. Irreversible.
Authentification : Bearer Token
curl -X DELETE https://api.scell.io/api/v1/api-keys/{id} \
-H "Authorization: Bearer <TOKEN>"7. Balance
GET /v1/balance
Recupere le solde actuel et les parametres de rechargement.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/balance \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": {
"amount": 150.00,
"currency": "EUR",
"auto_reload_enabled": false,
"auto_reload_threshold": null,
"auto_reload_amount": null,
"low_balance_alert_threshold": 10.00,
"critical_balance_alert_threshold": 2.00
}
}Rechargement, paramètres et historique : voir 14. Tenant Billing. Les anciens endpoints
POST /v1/balance/reload,PUT /v1/balance/settingsetGET /v1/balance/transactionsont été remplacés par la surface/v1/tenant/billing/*(top-up,top-up/preview,top-up/confirm,transactions,packs). Le rechargement passe désormais par Stripe (PaymentIntent) en production.
8. Webhooks
GET /v1/webhooks
Liste les webhooks configures.
Authentification : Bearer Token
Parametres : company_id (uuid, optionnel)
curl -X GET https://api.scell.io/api/v1/webhooks \
-H "Authorization: Bearer <TOKEN>"POST /v1/webhooks
Configure un nouveau webhook.
Authentification : Bearer Token
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
url | string (url) | oui | URL de reception |
events | array | oui | Evenements a ecouter |
environment | string | oui | sandbox ou production |
headers | object | non | Headers personnalises |
retry_count | integer | non | Nombre de tentatives (0-5, defaut: 3) |
timeout_seconds | integer | non | Timeout (5-60, defaut: 30) |
Evenements disponibles :
| Evenement | Description |
|---|---|
invoice.created | Facture creee |
invoice.validated | Facture validee |
invoice.submitted | Facture soumise au PDP |
invoice.paid | Facture payee |
invoice.rejected | Facture rejetee |
signature.created | Signature creee |
signature.completed | Signature terminee |
signature.refused | Signature refusee |
signature.expired | Signature expiree |
credit_note.created | Avoir cree |
credit_note.sent | Avoir envoye |
curl -X POST https://api.scell.io/api/v1/webhooks \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://mon-site.com/webhooks/scell",
"events": ["invoice.validated", "signature.completed"],
"environment": "production"
}'Reponse (201) :
{
"message": "Webhook cree avec succes",
"data": {
"id": "uuid",
"url": "https://mon-site.com/webhooks/scell",
"secret": "whsec_abc123...",
"events": ["invoice.validated", "signature.completed"],
"environment": "production",
"is_active": true
}
}GET /v1/webhooks/{id}
Recupere les details d'un webhook.
curl -X GET https://api.scell.io/api/v1/webhooks/{id} \
-H "Authorization: Bearer <TOKEN>"PUT /v1/webhooks/{id}
Met a jour un webhook.
curl -X PUT https://api.scell.io/api/v1/webhooks/{id} \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"events": ["invoice.validated", "invoice.paid"], "is_active": true}'DELETE /v1/webhooks/{id}
Supprime un webhook.
curl -X DELETE https://api.scell.io/api/v1/webhooks/{id} \
-H "Authorization: Bearer <TOKEN>"POST /v1/webhooks/{id}/regenerate-secret
Regenere le secret de signature du webhook.
curl -X POST https://api.scell.io/api/v1/webhooks/{id}/regenerate-secret \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"message": "Secret regenere",
"secret": "whsec_new_xyz..."
}POST /v1/webhooks/{id}/test
Envoie un evenement de test au webhook.
curl -X POST https://api.scell.io/api/v1/webhooks/{id}/test \
-H "Authorization: Bearer <TOKEN>"GET /v1/webhooks/{id}/logs
Recupere les logs d'execution du webhook.
curl -X GET https://api.scell.io/api/v1/webhooks/{id}/logs \
-H "Authorization: Bearer <TOKEN>"Reponse (200) :
{
"data": [
{
"id": "uuid",
"event": "invoice.validated",
"status_code": 200,
"response_time_ms": 150,
"attempt": 1,
"created_at": "2026-01-15T10:30:00Z"
}
]
}9. Incoming Invoices (Factures fournisseurs)
GET /v1/invoices/incoming
Liste les factures fournisseurs recues.
Authentification : Bearer Token
curl -X GET https://api.scell.io/api/v1/invoices/incoming \
-H "Authorization: Bearer <TOKEN>"POST /v1/invoices/{invoice}/accept
Accepte une facture fournisseur.
curl -X POST https://api.scell.io/api/v1/invoices/{invoice}/accept \
-H "Authorization: Bearer <TOKEN>"POST /v1/invoices/{invoice}/reject
Rejette une facture fournisseur.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
reason | string | oui | Motif du rejet |
curl -X POST https://api.scell.io/api/v1/invoices/{invoice}/reject \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"reason": "Montant incorrect"}'POST /v1/invoices/{invoice}/dispute
Conteste une facture fournisseur.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
reason | string | oui | Motif de la contestation |
curl -X POST https://api.scell.io/api/v1/invoices/{invoice}/dispute \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"reason": "Prestation non conforme"}'POST /v1/invoices/{invoice}/mark-paid
Marque une facture fournisseur comme payee.
curl -X POST https://api.scell.io/api/v1/invoices/{invoice}/mark-paid \
-H "Authorization: Bearer <TOKEN>"GET /v1/invoices/{invoice}/download
Telecharge une facture fournisseur.
curl -X GET https://api.scell.io/api/v1/invoices/{invoice}/download \
-H "Authorization: Bearer <TOKEN>"10. Tenant (Multi-Tenant B2B)
API destinee aux partenaires integrant Scell.io pour leurs propres clients. Authentification via X-Tenant-Key.
GET /v1/tenant/me
Retourne le profil du tenant authentifie.
Authentification : Tenant Key
curl -X GET https://api.scell.io/api/v1/tenant/me \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"id": "uuid",
"name": "Mon Entreprise",
"slug": "mon-entreprise",
"legal_name": "Mon Entreprise SAS",
"siret": "12345678901234",
"vat_number": "FR12345678901",
"billing_email": "billing@monentreprise.fr",
"technical_email": "tech@monentreprise.fr",
"kyb_status": "verified",
"kyb_verified_at": "2026-01-10T08:00:00Z",
"balance": 500.00,
"environment": "production",
"created_at": "2026-01-05T10:00:00Z"
}
}PUT /v1/tenant/me
Met a jour le profil du tenant.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
billing_email | string (email) | non | Email de facturation |
technical_email | string (email) | non | Email technique |
contact_phone | string | non | Telephone |
webhook_url | string (url) | non | URL webhook globale |
settings | object | non | Parametres personnalises |
curl -X PUT https://api.scell.io/api/v1/tenant/me \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"billing_email": "new-billing@monentreprise.fr"}'GET /v1/tenant/balance
Retourne le solde du tenant.
curl -X GET https://api.scell.io/api/v1/tenant/balance \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/stats
Retourne les statistiques du tenant.
curl -X GET https://api.scell.io/api/v1/tenant/stats \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/stats/overview
Statistiques detaillees (tableau de bord).
curl -X GET https://api.scell.io/api/v1/tenant/stats/overview \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/stats/monthly
Statistiques mensuelles detaillees.
curl -X GET https://api.scell.io/api/v1/tenant/stats/monthly \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/regenerate-key
Regenere la cle API du tenant. L'ancienne cle est immediatement invalidee.
curl -X POST https://api.scell.io/api/v1/tenant/regenerate-key \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"message": "Cle regeneree",
"api_key": "sk_live_newkey...",
"warning": "L'ancienne cle est desormais invalide"
}11. Sub-Tenants
Gestion des sous-clients (sub-tenants) dans l'architecture multi-tenant.
GET /v1/tenant/sub-tenants
Liste les sub-tenants.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants
Cree un sub-tenant.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
external_id | string | oui | Identifiant dans votre systeme |
name | string | oui | Nom du sub-tenant |
email | string (email) | oui | Email de contact |
siret | string (14 car.) | non | SIRET |
vat_number | string | non | Numero TVA |
contact_person | string | non | Personne de contact |
phone | string | non | Telephone |
address | object | non | Adresse |
metadata | object | non | Donnees personnalisees |
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"external_id": "client_123",
"name": "Client ABC",
"email": "contact@client-abc.fr",
"siret": "98765432109876"
}'GET /v1/tenant/sub-tenants/{id}
Recupere un sub-tenant par ID.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/{id} \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/sub-tenants/by-external-id/{externalId}
Recherche un sub-tenant par identifiant externe.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/by-external-id/client_123 \
-H "X-Tenant-Key: sk_live_xxxxxx"PUT /v1/tenant/sub-tenants/{id}
Met a jour un sub-tenant.
curl -X PUT https://api.scell.io/api/v1/tenant/sub-tenants/{id} \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"name": "Client ABC - Mis a jour", "phone": "+33612345678"}'DELETE /v1/tenant/sub-tenants/{id}
Supprime un sub-tenant.
curl -X DELETE https://api.scell.io/api/v1/tenant/sub-tenants/{id} \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants/{id}/superpdp-disconnect
Revoque la connexion SuperPDP d'un sub-tenant et remet son onboarding_status a pending_superpdp. Les factures deja emises restent immuables (ISCA) ; les futures factures B2B basculent en mode papier jusqu'a reconnexion. Double surface : Sanctum (dashboard) et cle tenant SDK.
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{id}/superpdp-disconnect \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants/{id}/superpdp-reconnect
Deconnecte puis genere une nouvelle authorize_url SuperPDP en un seul appel.
Reponse 200 : { "authorize_url": "...", "state": "...", "data": { ... } }
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{id}/superpdp-reconnect \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants/{id}/superpdp-widget-token
Genere un jeton signe (URL signee HMAC, 24h, anti-IDOR, scope 1 sub-tenant) a passer au widget <scell-onboarding mode="superpdp" resume-token="...">. Body optionnel { "reset": true } pour forcer une deconnexion prealable.
Reponse 200 : { "resume_token": "...", "expires_at": "..." }
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{id}/superpdp-widget-token \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"reset": false}'POST /v1/widget/onboarding/sub-tenant/{subTenant}/superpdp-resume
Endpoint signe (URL signee, pas de cle API) consomme par le widget en mode superpdp. A partir du resume_token mint via superpdp-widget-token, il relance le tunnel SuperPDP du sub-tenant cible et retourne une authorize_url.
curl -X POST "https://api.scell.io/api/v1/widget/onboarding/sub-tenant/{subTenant}/superpdp-resume?signature=...&expires=..."POST /v1/me/superpdp/disconnect
Revoque et nullifie le lien SuperPDP du tenant master (self-onboarding). Reserve a la surface dashboard (Sanctum, cookieAuth) — pas accessible via cle API.
curl -X POST https://api.scell.io/api/v1/me/superpdp/disconnect \
-H "Cookie: scell_session=..." \
-H "X-XSRF-TOKEN: ..."GET /v1/tenant/sub-tenants/{subTenantId}/stats/overview
Statistiques d'un sub-tenant specifique.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/stats/overview \
-H "X-Tenant-Key: sk_live_xxxxxx"12. Tenant Invoices
POST /v1/tenant/invoices
Cree une facture directe (sans sub-tenant). Debite 0.04 EUR.
Authentification : Tenant Key
Corps : Meme structure que POST /v1/invoices (voir section 3).
curl -X POST https://api.scell.io/api/v1/tenant/invoices \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "FACT-2026-001",
"direction": "outgoing",
"output_format": "facturx",
"issue_date": "2026-01-15",
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00,
"seller_siret": "12345678901234",
"seller_name": "Ma Societe SAS",
"seller_address": {"line1": "1 Rue de la Paix", "postal_code": "75001", "city": "Paris"},
"buyer_siret": "98765432109876",
"buyer_name": "Client SARL",
"buyer_address": {"line1": "10 Avenue des Champs", "postal_code": "75008", "city": "Paris"},
"lines": [{"description": "Prestation", "quantity": 1, "unit_price": 1000.00, "tax_rate": 20.00, "total_ht": 1000.00, "total_tax": 200.00, "total_ttc": 1200.00}]
}'GET /v1/tenant/invoices
Liste toutes les factures du tenant.
curl -X GET "https://api.scell.io/api/v1/tenant/invoices?status=draft" \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants/{subTenantId}/invoices
Cree une facture pour un sub-tenant.
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/invoices \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{ ... }'GET /v1/tenant/sub-tenants/{subTenantId}/invoices
Liste les factures d'un sub-tenant.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/invoices \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/invoices/{invoiceId}
Recupere les details d'une facture.
curl -X GET https://api.scell.io/api/v1/tenant/invoices/{invoiceId} \
-H "X-Tenant-Key: sk_live_xxxxxx"PUT /v1/tenant/invoices/{invoiceId}
Met a jour une facture en brouillon.
curl -X PUT https://api.scell.io/api/v1/tenant/invoices/{invoiceId} \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"due_date": "2026-03-15"}'Erreurs : 403 (facture non modifiable si pas en statut draft)
DELETE /v1/tenant/invoices/{invoiceId}
Supprime une facture en brouillon.
curl -X DELETE https://api.scell.io/api/v1/tenant/invoices/{invoiceId} \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/invoices/{invoiceId}/submit
Soumet une facture au PDP.
curl -X POST https://api.scell.io/api/v1/tenant/invoices/{invoiceId}/submit \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/invoices/{invoiceId}/status
Recupere le statut d'une facture.
curl -X GET https://api.scell.io/api/v1/tenant/invoices/{invoiceId}/status \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"id": "uuid",
"status": "submitted",
"submitted_at": "2026-01-15T10:31:00Z",
"paid_at": null
}
}POST /v1/tenant/invoices/bulk
Creation en masse de factures (jusqu'a 100 par requete).
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
invoices | array | oui | Tableau de factures (meme structure que creation unitaire) |
curl -X POST https://api.scell.io/api/v1/tenant/invoices/bulk \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"invoices": [{ ... }, { ... }]}'Reponse (201) :
{
"message": "2 factures creees",
"data": {
"created": 2,
"failed": 0,
"invoices": [...]
}
}POST /v1/tenant/invoices/bulk-submit
Soumission en masse de factures.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
invoice_ids | array | oui | Liste des IDs de factures a soumettre |
curl -X POST https://api.scell.io/api/v1/tenant/invoices/bulk-submit \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"invoice_ids": ["uuid-1", "uuid-2", "uuid-3"]}'POST /v1/tenant/invoices/bulk-status
Recupere le statut de plusieurs factures en une requete.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
invoice_ids | array | oui | Liste des IDs |
curl -X POST https://api.scell.io/api/v1/tenant/invoices/bulk-status \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"invoice_ids": ["uuid-1", "uuid-2"]}'GET /v1/tenant/invoices/{invoiceId}/remaining-creditable
Montants restants creditables pour une facture tenant.
curl -X GET https://api.scell.io/api/v1/tenant/invoices/{invoiceId}/remaining-creditable \
-H "X-Tenant-Key: sk_live_xxxxxx"13. Tenant Credit Notes
POST /v1/tenant/credit-notes
Cree un avoir direct (sans sub-tenant). Debite 0.04 EUR.
curl -X POST https://api.scell.io/api/v1/tenant/credit-notes \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_id": "uuid-facture",
"reason": "Remise commerciale",
"items": [{"description": "Remise", "quantity": 1, "unit_price": 100.00, "tax_rate": 20.00}]
}'GET /v1/tenant/credit-notes
Liste les avoirs du tenant.
curl -X GET https://api.scell.io/api/v1/tenant/credit-notes \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/sub-tenants/{subTenantId}/credit-notes
Cree un avoir pour un sub-tenant.
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/credit-notes \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{ ... }'GET /v1/tenant/sub-tenants/{subTenantId}/credit-notes
Liste les avoirs d'un sub-tenant.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/credit-notes \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/credit-notes/{creditNoteId}
Recupere les details d'un avoir.
curl -X GET https://api.scell.io/api/v1/tenant/credit-notes/{creditNoteId} \
-H "X-Tenant-Key: sk_live_xxxxxx"PUT /v1/tenant/credit-notes/{creditNoteId}
Met a jour un avoir en brouillon.
curl -X PUT https://api.scell.io/api/v1/tenant/credit-notes/{creditNoteId} \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"reason": "Motif mis a jour"}'POST /v1/tenant/credit-notes/{creditNoteId}/send
Envoie un avoir (passage de draft a sent).
curl -X POST https://api.scell.io/api/v1/tenant/credit-notes/{creditNoteId}/send \
-H "X-Tenant-Key: sk_live_xxxxxx"DELETE /v1/tenant/credit-notes/{creditNoteId}
Supprime un avoir en brouillon.
curl -X DELETE https://api.scell.io/api/v1/tenant/credit-notes/{creditNoteId} \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/credit-notes/{creditNoteId}/download
Telecharge le PDF de l'avoir.
curl -X GET https://api.scell.io/api/v1/tenant/credit-notes/{creditNoteId}/download \
-H "X-Tenant-Key: sk_live_xxxxxx"14. Tenant Billing
Modèle de facturation unifié (depuis 2026-06-04, ADR 0008). L'ancienne facturation mensuelle de consommation (
GET /v1/tenant/billing/invoices,.../{invoice},.../{invoice}/download,.../{invoice}/pay) a été retirée : elle créait une double-facturation avec le modèle prépayé. La consommation est désormais un simple relevé (GET /v1/tenant/billing/usage) ; les achats plateforme (packs, factures Scell.io) vivent dans les factures classiques. Ces endpoints n'existent plus.
GET /v1/tenant/billing/usage
Recupere la consommation en cours.
curl -X GET https://api.scell.io/api/v1/tenant/billing/usage \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/billing/top-up
Initie une recharge du solde.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
amount | number | oui | Montant a recharger |
curl -X POST https://api.scell.io/api/v1/tenant/billing/top-up \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"amount": 100.00}'POST /v1/tenant/billing/top-up/confirm
Confirme une recharge apres paiement.
curl -X POST https://api.scell.io/api/v1/tenant/billing/top-up/confirm \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"payment_intent_id": "pi_xxx"}'GET /v1/tenant/billing/transactions
Historique des transactions du tenant.
curl -X GET https://api.scell.io/api/v1/tenant/billing/transactions \
-H "X-Tenant-Key: sk_live_xxxxxx"15. Tenant Incoming Invoices
POST /v1/tenant/sub-tenants/{subTenantId}/invoices/incoming
Enregistre une facture fournisseur pour un sub-tenant. Gratuit (pas de debit).
curl -X POST https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/invoices/incoming \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "FOURNISSEUR-001",
"issue_date": "2026-01-15",
"total_ht": 500.00,
"total_tax": 100.00,
"total_ttc": 600.00,
"seller_siret": "11111111111111",
"seller_name": "Fournisseur SA",
"buyer_siret": "22222222222222",
"buyer_name": "Mon Client"
}'GET /v1/tenant/sub-tenants/{subTenantId}/invoices/incoming
Liste les factures fournisseurs d'un sub-tenant.
curl -X GET https://api.scell.io/api/v1/tenant/sub-tenants/{subTenantId}/invoices/incoming \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/invoices/incoming/{invoiceId}
Details d'une facture fournisseur.
curl -X GET https://api.scell.io/api/v1/tenant/invoices/incoming/{invoiceId} \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/invoices/incoming/{invoiceId}/accept
Accepte une facture fournisseur.
curl -X POST https://api.scell.io/api/v1/tenant/invoices/incoming/{invoiceId}/accept \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/invoices/incoming/{invoiceId}/reject
Rejette une facture fournisseur.
curl -X POST https://api.scell.io/api/v1/tenant/invoices/incoming/{invoiceId}/reject \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"reason": "Montant incorrect"}'POST /v1/tenant/invoices/incoming/{invoiceId}/mark-paid
Marque une facture fournisseur comme payee.
curl -X POST https://api.scell.io/api/v1/tenant/invoices/incoming/{invoiceId}/mark-paid \
-H "X-Tenant-Key: sk_live_xxxxxx"16. KYB Documents
Gestion des documents KYB (Know Your Business) pour la verification d'identite des tenants.
GET /v1/tenant/kyb/status
Statut KYB du tenant.
curl -X GET https://api.scell.io/api/v1/tenant/kyb/status \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"status": "verified",
"verified_at": "2026-01-10T08:00:00Z",
"documents_count": 3,
"rejection_reason": null
}
}GET /v1/tenant/kyb/documents
Liste les documents KYB.
curl -X GET https://api.scell.io/api/v1/tenant/kyb/documents \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/kyb/documents
Upload un document KYB.
Corps (multipart/form-data) :
| Champ | Type | Requis | Description |
|---|---|---|---|
document | file | oui | Fichier (PDF, JPG, PNG, max 10 Mo) |
type | string | oui | kbis, id_card, articles, proof_of_address |
curl -X POST https://api.scell.io/api/v1/tenant/kyb/documents \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-F "document=@kbis.pdf" \
-F "type=kbis"GET /v1/tenant/kyb/documents/{document}
Details d'un document KYB.
curl -X GET https://api.scell.io/api/v1/tenant/kyb/documents/{document} \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/kyb/documents/{document}/download
Telecharge un document KYB.
curl -X GET https://api.scell.io/api/v1/tenant/kyb/documents/{document}/download \
-H "X-Tenant-Key: sk_live_xxxxxx"DELETE /v1/tenant/kyb/documents/{document}
Supprime un document KYB (avant verification uniquement).
curl -X DELETE https://api.scell.io/api/v1/tenant/kyb/documents/{document} \
-H "X-Tenant-Key: sk_live_xxxxxx"17. Onboarding
API d'onboarding B2B pour les partenaires. Inscrit des tenants via le tunnel SuperPDP (creation de compte, KYB, verification d'identite).
Authentification : Publishable Key (X-Publishable-Key)
Vue d'ensemble du flux :
- Le widget cree une session avec
POST /onboarding/sessions. - Le widget appelle
POST /onboarding/superpdp/authorizepour obtenir l'URL OAuth2 SuperPDP. - Le widget ouvre cette URL dans un popup. SuperPDP gere la creation de compte, le KYB et la verification d'identite.
- Une fois le tunnel SuperPDP termine, SuperPDP redirige vers
GET /api/v1/onboarding/superpdp/callback(endpoint backend). Cette page HTML poste un messagepostMessagea la fenetre parente et ferme le popup. - Le widget recoit le message et appelle
POST /onboarding/superpdp/callbackpour finaliser la creation du tenant Scell et obtenir l'authorization_code. - L'
authorization_codeest echange contre des credentials tenant viaPOST /onboarding/exchange.
POST /v1/onboarding/sessions
Cree une session d'onboarding.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
mode | string | oui | api, redirect ou embedded |
external_id | string | non | Identifiant dans votre systeme |
callback_url | string (url) | non | URL de callback apres completion |
state | string | non | Etat personnalise (retourne au callback) |
metadata | object | non | Donnees personnalisees |
curl -X POST https://api.scell.io/api/v1/onboarding/sessions \
-H "X-Publishable-Key: pk_test_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"mode": "embedded",
"callback_url": "https://myapp.com/callback",
"external_id": "user_123"
}'Reponse (201) :
{
"message": "Session creee",
"data": {
"id": "uuid",
"mode": "embedded",
"status": "pending",
"expires_at": "2026-01-15T11:30:00Z"
}
}GET /v1/onboarding/sessions/{id}
Recupere le statut d'une session.
Authentification : Publishable Key (X-Publishable-Key)
curl -X GET https://api.scell.io/api/v1/onboarding/sessions/{id} \
-H "X-Publishable-Key: pk_test_xxxxxx"Reponse (200) :
{
"data": {
"id": "uuid",
"status": "pending",
"mode": "embedded",
"expires_at": "2026-01-15T11:30:00Z"
}
}POST /v1/onboarding/superpdp/authorize
Genere l'URL d'autorisation OAuth2 SuperPDP vers laquelle le widget redirige l'utilisateur (dans un popup). SuperPDP prend ensuite en charge la creation de compte, le KYB et la verification d'identite.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
session_id | uuid | oui | ID de la session d'onboarding |
curl -X POST https://api.scell.io/api/v1/onboarding/superpdp/authorize \
-H "X-Publishable-Key: pk_test_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"session_id": "uuid"}'Reponse (200) :
{
"data": {
"authorize_url": "https://api.superpdp.tech/oauth2/authorize?client_id=...&redirect_uri=...&state=...&response_type=code",
"state": "random_state_string"
}
}Le widget ouvre authorize_url dans un popup. L'utilisateur accomplit l'ensemble du processus SuperPDP (inscription, KYB, identite). Aucune action supplementaire n'est requise cote widget jusqu'a la reception du postMessage de la fenetre popup.
POST /v1/onboarding/superpdp/callback
Finalise l'onboarding apres que SuperPDP a redirige vers le backend. Echange le code d'autorisation OAuth2 contre les tokens SuperPDP, cree le tenant Scell et retourne un authorization_code a echanger contre les credentials definitifs.
Cet endpoint est appele par le widget apres avoir recu le postMessage provenant de la page de callback HTML.
Authentification : Publishable Key (X-Publishable-Key)
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
session_id | uuid | oui | ID de la session d'onboarding |
code | string | oui | Code OAuth2 recu de SuperPDP via le postMessage |
state | string | oui | Valeur state retournee par SuperPDP (verification CSRF) |
curl -X POST https://api.scell.io/api/v1/onboarding/superpdp/callback \
-H "X-Publishable-Key: pk_test_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"session_id": "uuid",
"code": "superpdp_oauth_code_xyz",
"state": "random_state_string"
}'Reponse (200) :
{
"success": true,
"data": {
"authorization_code": "auth_code_xyz...",
"tenant": {
"id": "uuid",
"name": "Nom du Tenant",
"environment": "production"
}
}
}L'authorization_code est a usage unique. Utilisez-le immediatement avec POST /onboarding/exchange pour obtenir les credentials tenant (sk_live_*).
POST /v1/onboarding/exchange
Echange un code d'autorisation contre des credentials tenant. Rate limit strict (5/min).
Authentification : Aucune (publishable_key dans le corps)
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
publishable_key | string | oui | Cle publishable |
authorization_code | string | oui | Code d'autorisation recu depuis /superpdp/callback |
curl -X POST https://api.scell.io/api/v1/onboarding/exchange \
-H "Content-Type: application/json" \
-d '{
"publishable_key": "pk_test_xxxxxx",
"authorization_code": "auth_code_xyz..."
}'Reponse (200) :
{
"data": {
"tenant_id": "uuid",
"api_key": "sk_live_newkey...",
"environment": "production"
}
}18. Fiscal Entries
Grand-livre fiscal immutable autocertifie ISCA (Integrite, Securisation, Conservation, Archivage). Chaque operation (facture, avoir, paiement) est enregistree avec une chaine de hachage SHA256.
Authentification : Tenant Key + scope fiscal:read
GET /v1/tenant/fiscal/entries
Liste les ecritures du grand-livre fiscal.
Parametres :
| Parametre | Type | Description |
|---|---|---|
date_from | date | Date de debut |
date_to | date | Date de fin |
entry_type | string | Type d'ecriture (invoice_created, credit_note_issued, payment, closing) |
environment | string | production ou sandbox |
per_page | integer | Elements par page (defaut: 20) |
curl -X GET "https://api.scell.io/api/v1/tenant/fiscal/entries?date_from=2026-01-01&date_to=2026-12-31" \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"success": true,
"data": [
{
"id": "uuid",
"sequence_number": 42,
"entry_type": "invoice_created",
"entity_type": "invoice",
"entity_id": "uuid",
"fiscal_date": "2026-01-15T10:30:00Z",
"data_hash": "sha256:abc123...",
"previous_hash": "sha256:xyz789...",
"chain_hash": "sha256:def456...",
"legal_status": "donnee_fiscale",
"created_at": "2026-01-15T10:30:00Z"
}
],
"meta": { "current_page": 1, "last_page": 10, "per_page": 20, "total": 200 }
}19. Fiscal Closings
GET /v1/tenant/fiscal/closings
Liste les clotures fiscales (journalieres et mensuelles).
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/closings \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/fiscal/closings/daily
Declenche une cloture journaliere manuelle.
Authentification : Tenant Key + scope fiscal:write
curl -X POST https://api.scell.io/api/v1/tenant/fiscal/closings/daily \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"message": "Cloture journaliere effectuee",
"data": {
"id": "uuid",
"type": "daily",
"date": "2026-01-15",
"entries_count": 15,
"totals": {
"invoices_ht": 5000.00,
"credit_notes_ht": 200.00,
"net_ht": 4800.00
},
"closing_hash": "sha256:..."
}
}Les clotures journalieres sont aussi executees automatiquement a 00:00 UTC.
20. Fiscal Compliance
GET /v1/tenant/fiscal/compliance
Retourne le statut de conformite fiscale du tenant.
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/compliance \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"compliant": true,
"last_integrity_check": "2026-01-15T00:00:00Z",
"integrity_valid": true,
"last_daily_closing": "2026-01-14",
"last_monthly_closing": "2025-12-31",
"kill_switch_active": false,
"chain_length": 1250,
"warnings": []
}
}GET /v1/tenant/fiscal/attestation/{year}
Recupere l'attestation de conformite fiscale pour une annee.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/attestation/2026 \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/fiscal/attestation/{year}/download
Telecharge l'attestation au format PDF.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/attestation/2026/download \
-H "X-Tenant-Key: sk_live_xxxxxx"21. Fiscal Integrity
GET /v1/tenant/fiscal/integrity
Verifie l'integrite de la chaine de hachage fiscale.
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/integrity \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"valid": true,
"entries_checked": 1250,
"first_entry": "2026-01-01T00:00:00Z",
"last_entry": "2026-01-15T10:30:00Z",
"broken_links": [],
"checked_at": "2026-01-15T10:35:00Z"
}
}GET /v1/tenant/fiscal/integrity/history
Historique des verifications d'integrite.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/integrity/history \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/fiscal/integrity/{date}
Verification d'integrite pour une date specifique.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/integrity/2026-01-15 \
-H "X-Tenant-Key: sk_live_xxxxxx"22. Fiscal Rules
Regles fiscales applicables (taux TVA, exonerations, mentions obligatoires).
GET /v1/tenant/fiscal/rules
Liste les regles fiscales actives.
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/rules \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/fiscal/rules/{key}
Details d'une regle fiscale specifique.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/rules/vat_standard_rate \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/fiscal/rules/{key}/history
Historique des modifications d'une regle.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/rules/vat_standard_rate/history \
-H "X-Tenant-Key: sk_live_xxxxxx"GET /v1/tenant/fiscal/rules/export
Exporte toutes les regles fiscales.
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/rules/export \
-H "X-Tenant-Key: sk_live_xxxxxx"POST /v1/tenant/fiscal/rules
Cree une nouvelle regle fiscale.
Authentification : Tenant Key + scope fiscal:write
curl -X POST https://api.scell.io/api/v1/tenant/fiscal/rules \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"key": "vat_reduced_rate",
"value": 5.5,
"description": "Taux reduit TVA",
"effective_from": "2026-01-01"
}'PUT /v1/tenant/fiscal/rules/{id}
Met a jour une regle fiscale.
curl -X PUT https://api.scell.io/api/v1/tenant/fiscal/rules/{id} \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"value": 10.0, "effective_from": "2026-07-01"}'POST /v1/tenant/fiscal/rules/replay
Rejoue les regles fiscales sur les ecritures existantes (recalcul).
Authentification : Tenant Key + scope fiscal:write
curl -X POST https://api.scell.io/api/v1/tenant/fiscal/rules/replay \
-H "X-Tenant-Key: sk_live_xxxxxx"23. Fiscal Anchors
Ancrage cryptographique des donnees fiscales (horodatage RFC 3161).
GET /v1/tenant/fiscal/anchors
Liste les ancrages fiscaux.
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/anchors \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": [
{
"id": "uuid",
"type": "daily_closing",
"entity_id": "uuid",
"data_hash": "sha256:...",
"anchor_reference": "RFC3161:...",
"anchored_at": "2026-01-15T00:01:00Z",
"verified": true
}
]
}24. Fiscal Kill Switch
Mecanisme de securite permettant de bloquer toutes les operations fiscales en cas d'anomalie.
GET /v1/tenant/fiscal/kill-switch/status
Statut du kill-switch.
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/kill-switch/status \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"active": false,
"activated_at": null,
"activated_by": null,
"reason": null
}
}Durcissement step-up (depuis 2026-06-03). L'activation ET la desactivation exigent le scope
fiscal:adminexplicite (le guard est fail-closed : 403FISCAL_SCOPE_ADMIN_NOT_GRANTEDsinon), unereasond'au moins 20 caracteres, et — en production — une confirmation hors-bande : le premier appel renvoie 403OOB_CONFIRMATION_REQUIREDet envoie unconfirmation_tokenpar email a re-soumettre dans le body.
POST /v1/tenant/fiscal/kill-switch/activate
Active le kill-switch. Toutes les operations de creation de factures et avoirs sont bloquees.
Authentification : Tenant Key + scope fiscal:admin
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
reason | string | oui | Motif (>= 20 caracteres) |
confirmation_token | string | conditionnel | Token recu par email au 1er appel en production (re-soumettre pour confirmer) |
curl -X POST https://api.scell.io/api/v1/tenant/fiscal/kill-switch/activate \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"reason": "Anomalie detectee dans la chaine de hachage fiscale"}'Erreurs : 403 FISCAL_SCOPE_ADMIN_NOT_GRANTED (scope manquant), 422 (reason < 20 caracteres), 403 OOB_CONFIRMATION_REQUIRED (production, re-soumettre avec confirmation_token).
POST /v1/tenant/fiscal/kill-switch/deactivate
Desactive le kill-switch. Memes exigences step-up que l'activation (reason >= 20 caracteres + confirmation hors-bande en production).
Authentification : Tenant Key + scope fiscal:admin
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
reason | string | oui | Motif de reprise (>= 20 caracteres) |
confirmation_token | string | conditionnel | Token hors-bande (production) |
curl -X POST https://api.scell.io/api/v1/tenant/fiscal/kill-switch/deactivate \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"reason": "Incident resolu, reprise de la facturation normale"}'25. Fiscal Export
GET /v1/tenant/fiscal/fec
Exporte le Fichier des Ecritures Comptables (FEC) au format reglementaire.
Authentification : Tenant Key + scope fiscal:read
Parametres :
| Parametre | Type | Description |
|---|---|---|
year | integer | Annee d'export |
month | integer | Mois (optionnel) |
curl -X GET "https://api.scell.io/api/v1/tenant/fiscal/fec?year=2026" \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-o fec_2026.txtLe FEC est genere au format tabule conforme a l'article A47 A-1 du LPF.
GET /v1/tenant/fiscal/forensic-export
Export forensique complet (toutes les donnees avec preuves de chaine).
Authentification : Tenant Key + scope fiscal:read
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/forensic-export \
-H "X-Tenant-Key: sk_live_xxxxxx"26. Admin
Endpoints reserves aux administrateurs de la plateforme Scell.io.
Authentification : Bearer Token + permission admin access
GET /v1/admin/stats
Statistiques globales de la plateforme.
curl -X GET https://api.scell.io/api/v1/admin/stats \
-H "Authorization: Bearer <ADMIN_TOKEN>"GET /v1/admin/users
Liste des utilisateurs.
curl -X GET https://api.scell.io/api/v1/admin/users \
-H "Authorization: Bearer <ADMIN_TOKEN>"POST /v1/admin/users/{id}/toggle-status
Active ou desactive un utilisateur.
curl -X POST https://api.scell.io/api/v1/admin/users/{id}/toggle-status \
-H "Authorization: Bearer <ADMIN_TOKEN>"GET /v1/admin/companies
Liste des entreprises (admin).
curl -X GET https://api.scell.io/api/v1/admin/companies \
-H "Authorization: Bearer <ADMIN_TOKEN>"GET /v1/admin/companies/{id}
Details d'une entreprise (admin).
curl -X GET https://api.scell.io/api/v1/admin/companies/{id} \
-H "Authorization: Bearer <ADMIN_TOKEN>"POST /v1/admin/companies/{id}/toggle-status
Active ou desactive une entreprise.
curl -X POST https://api.scell.io/api/v1/admin/companies/{id}/toggle-status \
-H "Authorization: Bearer <ADMIN_TOKEN>"POST /v1/admin/users/{userId}/credit
Ajoute des credits a un utilisateur.
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
amount | number | oui | Montant a crediter |
reason | string | oui | Motif |
curl -X POST https://api.scell.io/api/v1/admin/users/{userId}/credit \
-H "Authorization: Bearer <ADMIN_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"amount": 50.00, "reason": "Credit offert"}'POST /v1/admin/users/{userId}/debit
Retire des credits a un utilisateur.
curl -X POST https://api.scell.io/api/v1/admin/users/{userId}/debit \
-H "Authorization: Bearer <ADMIN_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"amount": 10.00, "reason": "Ajustement"}'Admin KYB
| Methode | Endpoint | Description |
|---|---|---|
| GET | /v1/admin/kyb/pending | Documents KYB en attente de validation |
| POST | /v1/admin/kyb/documents/{document}/review | Valider ou rejeter un document KYB |
| GET | /v1/admin/kyb/documents/{document}/download | Telecharger un document KYB |
Admin OpenAPI (Signature Provider)
| Methode | Endpoint | Description |
|---|---|---|
| GET | /v1/admin/openapi/config | Configuration OpenAPI.com |
| POST | /v1/admin/openapi/config | Sauvegarder la configuration |
| POST | /v1/admin/openapi/config/verify | Verifier la configuration |
| GET | /v1/admin/openapi/credit | Credit restant OpenAPI.com |
| GET | /v1/admin/openapi/tokens | Lister les tokens OAuth |
| POST | /v1/admin/openapi/tokens | Creer un token OAuth |
| DELETE | /v1/admin/openapi/tokens/{id} | Supprimer un token |
| POST | /v1/admin/openapi/tokens/{id}/refresh | Rafraichir un token |
27. MCP Server
Serveur MCP (Model Context Protocol) pour l'integration avec les agents IA (Claude, etc.).
GET /mcp
Informations du serveur MCP.
Authentification : Aucune
curl -X GET https://api.scell.io/mcpReponse (200) :
{
"name": "scell-mcp-server",
"version": "1.2.1",
"protocol": "2024-11-05",
"tools_count": 54,
"capabilities": ["tools", "resources"]
}POST /mcp
Endpoint JSON-RPC 2.0 principal. Supporte les methodes MCP standard.
Authentification : X-API-Key
Methodes disponibles :
| Methode | Description |
|---|---|
initialize | Initialise la session MCP |
tools/list | Liste les 54 outils disponibles |
tools/call | Execute un outil |
curl -X POST https://api.scell.io/mcp \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}'Outils disponibles (54) : voir le detail complet par categorie dans docs/dev/mcp-server.md. Apercu :
| Categorie | Outils |
|---|---|
| Factures | create_invoice, get_invoice, list_invoices, download_invoice |
| Signatures | create_signature, get_signature, list_signatures, download_signed, cancel_signature, send_reminder |
| Avoirs | create_credit_note, get_credit_note, list_credit_notes, download_credit_note, delete_credit_note, send_credit_note, get_remaining_creditable |
| Devis | 11 outils scell_*_quote (ajoutes en SDK MCP v2.11.0) |
| Fiscal | list_fiscal_entries, list_fiscal_closings, check_fiscal_integrity, get_fiscal_compliance, get_fiscal_attestation, get_kill_switch_status, list_fiscal_rules |
| Compte | get_balance, get_audit_trail |
| Validation | validate_siret, validate_vat |
| Systeme | health_check, validate_api_key |
GET /mcp/stream
Transport SSE (Server-Sent Events) pour les reponses en streaming.
curl -X GET https://api.scell.io/mcp/stream \
-H "X-API-Key: sk_live_xxx" \
-H "Accept: text/event-stream"Sandbox
L'environnement sandbox permet de tester l'API sans debit reel.
Endpoints sandbox
Tous les endpoints sont aussi disponibles via le prefix /v1/sandbox/ :
POST /v1/sandbox/invoices
GET /v1/sandbox/invoices
GET /v1/sandbox/invoices/{id}
GET /v1/sandbox/invoices/{id}/download/{type}
GET /v1/sandbox/invoices/{id}/audit-trail
POST /v1/sandbox/signatures
GET /v1/sandbox/signatures
GET /v1/sandbox/signatures/{id}
GET /v1/sandbox/signatures/{id}/download/{type}
POST /v1/sandbox/signatures/{id}/remind
POST /v1/sandbox/signatures/{id}/cancelDifferences avec la production
| Aspect | Production | Sandbox |
|---|---|---|
| Facturation | 0.04 EUR/facture | Gratuit |
| Signature | 1.20 EUR/signature | Gratuit |
| Rate limit | 60/min | 1000/min |
| Prefixe cle | sk_live_ | sk_test_ |
| Envoi reel | Oui | Non (simule) |
Webhooks entrants (providers)
Endpoints recevant les callbacks des fournisseurs externes.
| Endpoint | Provider | Description |
|---|---|---|
POST /webhooks/openapi/signature | OpenAPI.com | Callback de signature electronique |
POST /webhooks/superpdp/invoice | SuperPDP | Callback de facturation PDP |
POST /webhooks/superpdp/document | SuperPDP | Callback de document |
POST /webhooks/superpdp | SuperPDP | Callback generique |
Ces endpoints ne sont pas destines a etre appeles par les integrateurs. Ils sont documentes a titre de reference technique.
Health Check
GET /api/health
Verification de disponibilite de l'API.
curl -X GET https://api.scell.io/api/healthReponse (200) :
{
"status": "ok",
"timestamp": "2026-01-15T10:30:00Z"
}Resume des endpoints
| Section | Endpoints | Authentification |
|---|---|---|
| Auth | 8 | Aucune / Bearer Token |
| Companies | 7 | Bearer Token |
| Invoices | 7 | API Key / Bearer Token |
| Signatures | 6 | API Key / Bearer Token |
| Credit Notes | 7 | Bearer Token |
| API Keys | 4 | Bearer Token |
| Balance | 4 | Bearer Token |
| Webhooks | 8 | Bearer Token |
| Incoming Invoices | 5 | Bearer Token |
| Tenant | 7 | Tenant Key |
| Sub-Tenants | 7 | Tenant Key |
| Tenant Invoices | 12 | Tenant Key |
| Tenant Credit Notes | 9 | Tenant Key |
| Tenant Billing | 7 | Tenant Key |
| Tenant Incoming Invoices | 6 | Tenant Key |
| KYB Documents | 6 | Tenant Key |
| Onboarding | 7 | Publishable Key |
| Fiscal | 20 | Tenant Key + scope |
| Admin | 16 | Bearer Token (admin) |
| MCP | 3 | API Key |
| Sandbox | 11 | API Key (sk_test_) |
| Tenant Auth | 7 | Aucune / Tenant Key |
| Tenant Onboarding | 7 | Tenant Key / Publishable Key |
| ISCA Fiscal Documents | 3 | Tenant Key |
| Public | 1 | Aucune |
28. Sandbox
Le sandbox reproduit tous les endpoints de production avec des donnees de test. Utiliser des cles sk_test_ pour acceder au mode sandbox.
Authentification : API Key (sk_test_ prefix)
POST /v1/sandbox/invoices
Cree une facture de test. Meme corps de requete que POST /v1/invoices.
curl -X POST https://api.scell.io/api/v1/sandbox/invoices \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "TEST-2026-001",
"direction": "outgoing",
"output_format": "facturx",
"issue_date": "2026-01-15",
"total_ht": 1000.00,
"total_tax": 200.00,
"total_ttc": 1200.00,
"seller_siret": "12345678901234",
"seller_name": "Ma Societe SAS",
"seller_address": {"line1": "1 Rue de la Paix", "postal_code": "75001", "city": "Paris"},
"buyer_siret": "98765432109876",
"buyer_name": "Client SARL",
"buyer_address": {"line1": "10 Avenue des Champs", "postal_code": "75008", "city": "Paris"},
"lines": [{"description": "Test", "quantity": 1, "unit_price": 1000.00, "tax_rate": 20.00, "total_ht": 1000.00, "total_tax": 200.00, "total_ttc": 1200.00}]
}'Reponse (201) :
{
"message": "Facture de test creee",
"data": {
"id": "uuid",
"invoice_number": "TEST-2026-001",
"status": "draft",
"environment": "sandbox",
"created_at": "2026-01-15T10:30:00Z"
}
}GET /v1/sandbox/invoices
Liste les factures de test. Meme pagination que GET /v1/invoices.
curl -X GET "https://api.scell.io/api/v1/sandbox/invoices?per_page=20&page=1" \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"data": [...],
"meta": {"current_page": 1, "last_page": 1, "per_page": 20, "total": 5}
}GET /v1/sandbox/invoices/{id}
Recupere une facture de test par son ID.
curl -X GET https://api.scell.io/api/v1/sandbox/invoices/{id} \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"data": {
"id": "uuid",
"invoice_number": "TEST-2026-001",
"status": "draft",
"environment": "sandbox",
"total_ttc": 1200.00
}
}Erreurs : 404 (facture introuvable)
GET /v1/sandbox/invoices/{id}/audit-trail
Piste d'audit d'une facture de test.
curl -X GET https://api.scell.io/api/v1/sandbox/invoices/{id}/audit-trail \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"data": [
{
"event": "invoice_created",
"performed_at": "2026-01-15T10:30:00Z",
"actor": "api_key:sk_test_..."
}
]
}GET /v1/sandbox/invoices/{id}/download/{type}
Telecharge une facture de test. Types disponibles : pdf, xml, facturx.
curl -X GET https://api.scell.io/api/v1/sandbox/invoices/{id}/download/pdf \
-H "X-API-Key: sk_test_xxx" \
-o invoice_test.pdfReponse : Fichier binaire avec header Content-Type adapte (application/pdf, application/xml, application/octet-stream).
Erreurs : 404 (facture introuvable), 422 (type invalide)
POST /v1/sandbox/signatures
Cree une demande de signature de test. Meme corps que POST /v1/signatures.
curl -X POST https://api.scell.io/api/v1/sandbox/signatures \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Contrat de test",
"signers": [{"name": "Jean Dupont", "email": "jean@example.com"}],
"document_base64": "base64encodedpdf..."
}'Reponse (201) :
{
"message": "Signature de test creee",
"data": {
"id": "uuid",
"title": "Contrat de test",
"status": "pending",
"environment": "sandbox",
"created_at": "2026-01-15T10:30:00Z"
}
}GET /v1/sandbox/signatures
Liste les demandes de signature de test.
curl -X GET https://api.scell.io/api/v1/sandbox/signatures \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"data": [...],
"meta": {"current_page": 1, "last_page": 1, "per_page": 20, "total": 3}
}GET /v1/sandbox/signatures/{id}
Recupere une demande de signature de test par son ID.
curl -X GET https://api.scell.io/api/v1/sandbox/signatures/{id} \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"data": {
"id": "uuid",
"title": "Contrat de test",
"status": "pending",
"environment": "sandbox",
"signers": [{"name": "Jean Dupont", "email": "jean@example.com", "signed_at": null}]
}
}Erreurs : 404 (signature introuvable)
POST /v1/sandbox/signatures/{id}/cancel
Annule une demande de signature de test.
curl -X POST https://api.scell.io/api/v1/sandbox/signatures/{id}/cancel \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"message": "Signature de test annulee",
"data": {"id": "uuid", "status": "cancelled"}
}Erreurs : 404 (signature introuvable), 422 (deja annulee ou completee)
GET /v1/sandbox/signatures/{id}/download/{type}
Telecharge les documents d'une signature de test. Types disponibles : signed_pdf, proof.
curl -X GET https://api.scell.io/api/v1/sandbox/signatures/{id}/download/signed_pdf \
-H "X-API-Key: sk_test_xxx" \
-o signed_test.pdfReponse : Fichier binaire (application/pdf pour signed_pdf, application/json pour proof).
Erreurs : 404 (signature introuvable), 422 (type invalide), 409 (signature non completee)
POST /v1/sandbox/signatures/{id}/remind
Envoie un rappel pour une signature de test.
curl -X POST https://api.scell.io/api/v1/sandbox/signatures/{id}/remind \
-H "X-API-Key: sk_test_xxx"Reponse (200) :
{
"message": "Rappel envoye (simulation sandbox)",
"data": {"reminded_at": "2026-01-15T11:00:00Z"}
}Erreurs : 404 (signature introuvable), 422 (signature deja completee ou annulee)
29. Tenant Authentication
Authentification des tenants via cle publishable ou cle tenant.
POST /v1/tenant/auth/register
Inscrit un nouveau tenant. Utilise une cle publishable pour identifier le partenaire.
Authentification : Aucune (cle publishable dans le corps)
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
publishable_key | string | oui | Cle publishable du partenaire |
name | string | oui | Nom du tenant |
email | string (email) | oui | Email de contact |
password | string | oui | Mot de passe |
siret | string (14 car.) | oui | Numero SIRET |
curl -X POST https://api.scell.io/api/v1/tenant/auth/register \
-H "Content-Type: application/json" \
-d '{
"publishable_key": "pk_live_xxxxxx",
"name": "Mon Tenant",
"email": "contact@mon-tenant.fr",
"password": "motdepasse",
"siret": "12345678901234"
}'Reponse (201) :
{
"message": "Tenant cree avec succes",
"data": {
"tenant_id": "uuid",
"api_key": "sk_live_newkey...",
"environment": "production"
}
}Erreurs : 422 (validation), 409 (email deja utilise)
POST /v1/tenant/auth/login
Authentifie un tenant et retourne un token.
Authentification : Aucune
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
email | string (email) | oui | Email du tenant |
password | string | oui | Mot de passe |
curl -X POST https://api.scell.io/api/v1/tenant/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "contact@mon-tenant.fr", "password": "motdepasse"}'Reponse (200) :
{
"data": {
"token": "sk_live_...",
"tenant_id": "uuid",
"expires_at": null
}
}Erreurs : 401 (identifiants invalides), 429 (trop de tentatives)
POST /v1/tenant/auth/logout
Revoque le token tenant actuel.
Authentification : Tenant Key
curl -X POST https://api.scell.io/api/v1/tenant/auth/logout \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"message": "Deconnexion reussie"
}GET /v1/tenant/auth/me
Recupere le profil du tenant authentifie.
Authentification : Tenant Key
curl -X GET https://api.scell.io/api/v1/tenant/auth/me \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"id": "uuid",
"name": "Mon Tenant",
"email": "contact@mon-tenant.fr",
"siret": "12345678901234",
"kyb_status": "verified",
"environment": "production",
"created_at": "2026-01-10T08:00:00Z"
}
}GET /v1/tenant/auth/keys
Liste les cles API du tenant.
Authentification : Tenant Key
curl -X GET https://api.scell.io/api/v1/tenant/auth/keys \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": [
{
"id": "uuid",
"type": "secret",
"prefix": "sk_live_",
"last_four": "xxxx",
"created_at": "2026-01-10T08:00:00Z",
"last_used_at": "2026-01-15T10:30:00Z"
}
]
}POST /v1/tenant/auth/keys/secret
Genere une nouvelle cle secrete pour le tenant.
Authentification : Tenant Key
curl -X POST https://api.scell.io/api/v1/tenant/auth/keys/secret \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (201) :
{
"message": "Cle secrete generee",
"data": {
"id": "uuid",
"key": "sk_live_newkey...",
"type": "secret",
"created_at": "2026-01-15T10:30:00Z"
}
}La cle complete n'est visible qu'une seule fois. Conservez-la immediatement.
POST /v1/tenant/auth/keys/publishable
Genere une nouvelle cle publishable pour le tenant.
Authentification : Tenant Key
curl -X POST https://api.scell.io/api/v1/tenant/auth/keys/publishable \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (201) :
{
"message": "Cle publishable generee",
"data": {
"id": "uuid",
"key": "pk_live_newkey...",
"type": "publishable",
"created_at": "2026-01-15T10:30:00Z"
}
}30. Tenant Onboarding
Flux d'onboarding pour les tenants souhaitant inscrire leurs propres sous-tenants via une interface integree.
POST /v1/tenant/onboarding/sessions
Cree une session d'onboarding pour un sous-tenant.
Authentification : Tenant Key ou Publishable Key
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
mode | string | oui | api, redirect ou embedded |
external_id | string | non | Identifiant dans votre systeme |
callback_url | string (url) | non | URL de callback apres completion |
metadata | object | non | Donnees personnalisees |
curl -X POST https://api.scell.io/api/v1/tenant/onboarding/sessions \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"mode": "redirect",
"callback_url": "https://monapp.com/callback",
"external_id": "client_456"
}'Reponse (201) :
{
"message": "Session creee",
"data": {
"id": "uuid",
"mode": "redirect",
"status": "pending",
"redirect_url": "https://app.scell.io/onboarding/uuid",
"expires_at": "2026-01-15T11:30:00Z"
}
}GET /v1/tenant/onboarding/sessions/{id}
Recupere le statut d'une session d'onboarding.
Authentification : Tenant Key ou Publishable Key
curl -X GET https://api.scell.io/api/v1/tenant/onboarding/sessions/{id} \
-H "X-Tenant-Key: sk_live_xxxxxx"Reponse (200) :
{
"data": {
"id": "uuid",
"status": "completed",
"external_id": "client_456",
"sub_tenant_id": "uuid",
"completed_at": "2026-01-15T11:00:00Z"
}
}Erreurs : 404 (session introuvable)
POST /v1/tenant/onboarding/superpdp/authorize
Genere l'URL OAuth2 SuperPDP a ouvrir dans un popup. SuperPDP gere ensuite l'inscription, le KYB et la verification d'identite.
Authentification : Publishable Key
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
session_id | uuid | oui | ID de la session d'onboarding |
curl -X POST https://api.scell.io/api/v1/tenant/onboarding/superpdp/authorize \
-H "X-Publishable-Key: pk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"session_id": "session_uuid"}'Reponse (200) :
{
"authorize_url": "https://api.superpdp.tech/oauth2/authorize?client_id=...&state=...&redirect_uri=...&response_type=code",
"state": "scell_session_state_random"
}Erreurs : 404 (session introuvable), 503 (SuperPDP indisponible)
POST /v1/tenant/onboarding/exchange
Echange un token de session contre des credentials d'authentification. Rate limit strict (5/min).
Authentification : Publishable Key
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
session_id | uuid | oui | ID de la session completee |
authorization_code | string | oui | Code d'autorisation recu apres completion |
curl -X POST https://api.scell.io/api/v1/tenant/onboarding/exchange \
-H "X-Publishable-Key: pk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"session_id": "uuid",
"authorization_code": "auth_code_xyz..."
}'Reponse (200) :
{
"data": {
"sub_tenant_id": "uuid",
"api_key": "sk_live_subtenantkey...",
"environment": "production"
}
}Erreurs : 401 (code invalide), 410 (code expire), 429 (trop de tentatives)
POST /v1/tenant/onboarding/superpdp/callback
Echange le code OAuth2 SuperPDP contre des tokens, recupere les infos entreprise depuis SuperPDP, cree le sous-tenant Scell avec les tokens stockes et retourne un authorization_code Scell.
Authentification : Publishable Key
Corps :
| Champ | Type | Requis | Description |
|---|---|---|---|
session_id | uuid | oui | ID de la session |
code | string | oui | Code OAuth2 retourne par SuperPDP apres inscription |
state | string | oui | State retourne par /superpdp/authorize (verification CSRF) |
curl -X POST https://api.scell.io/api/v1/tenant/onboarding/superpdp/callback \
-H "X-Publishable-Key: pk_live_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"session_id": "session_uuid",
"code": "auth_xyz789...",
"state": "scell_session_state_random"
}'Reponse (200) :
{
"success": true,
"authorization_code": "scell_auth_code_xyz",
"tenant": {
"id": "uuid",
"name": "Acme SAS",
"siret": "12345678901234",
"environment": "production"
}
}Erreurs : 400 (state invalide ou session expiree), 404 (session introuvable), 503 (echec exchange ou SuperPDP indisponible)
31. ISCA Fiscal Documents
Documents fiscaux ISCA (Independant Software and Compliance Attestation) disponibles en telechargement pour les tenants.
Authentification : Tenant Key
GET /v1/tenant/fiscal/isca/self-attestation/download
Telecharge l'auto-attestation ISCA (PDF).
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/isca/self-attestation/download \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-o isca_self_attestation.pdfReponse : Fichier PDF (Content-Type: application/pdf).
Erreurs : 401 (non authentifie), 403 (acces refuse)
GET /v1/tenant/fiscal/isca/technical-dossier/download
Telecharge le dossier technique ISCA (PDF).
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/isca/technical-dossier/download \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-o isca_technical_dossier.pdfReponse : Fichier PDF (Content-Type: application/pdf).
Erreurs : 401 (non authentifie), 403 (acces refuse)
GET /v1/tenant/fiscal/isca/measures-register/download
Telecharge le registre des mesures ISCA (PDF).
curl -X GET https://api.scell.io/api/v1/tenant/fiscal/isca/measures-register/download \
-H "X-Tenant-Key: sk_live_xxxxxx" \
-o isca_measures_register.pdfReponse : Fichier PDF (Content-Type: application/pdf).
Erreurs : 401 (non authentifie), 403 (acces refuse)
32. Public Endpoints
Endpoints publics ne necessitant aucune authentification.
GET /v1/pricing
Retourne les informations de tarification publiques.
Authentification : Aucune
curl -X GET https://api.scell.io/api/v1/pricingReponse (200) :
{
"data": {
"invoice_price": 0.04,
"signature_price": 1.20,
"credit_note_price": 0.04,
"currency": "EUR"
}
}| Sandbox | 12 | API Key | | Health | 1 | Aucune | | Total | 370 | |
33. Buyers (Registre acheteurs)
Registre d'acheteurs reutilisables, scope strict (tenant_id, sub_tenant_id). Surface partagee : Sanctum (dashboard) et sk_*/pk_* (SDKs). Une facture peut referencer un buyer via buyer_id (snapshot fige a l'emission).
| Methode | Route | Description |
|---|---|---|
GET | /v1/buyers | Lister (paginate, recherche q sur name/siret/email, filtre is_individual) |
POST | /v1/buyers | Creer un acheteur |
GET | /v1/buyers/{buyer} | Detail |
PATCH / PUT | /v1/buyers/{buyer} | Modifier |
DELETE | /v1/buyers/{buyer} | Supprimer (soft delete) |
POST | /v1/buyers/vat-context | Resoudre le contexte TVA d'un acheteur (FR / UE / hors-UE) |
POST /v1/buyers
Authentification : X-API-Key: sk_* ou Bearer (dashboard)
curl -X POST https://api.scell.io/api/v1/buyers \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "ACME SAS",
"is_individual": false,
"siret": "12345678901234",
"vat_number": "FR12345678901",
"email": "facturation@acme.fr",
"country": "FR",
"billing_address": {
"line1": "10 rue de la Paix",
"postal_code": "75002",
"city": "Paris",
"country": "FR"
},
"shipping_address": {
"name": "Entrepot Lyon",
"line1": "5 quai Perrache",
"postal_code": "69002",
"city": "Lyon",
"country": "FR"
}
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
name | string | Oui | Raison sociale ou nom du particulier |
is_individual | boolean | Non | true pour un acheteur B2C |
siret | string | Non | Valide via ValidSiret |
vat_number | string | Non | Valide via ValidVatNumber |
legal_id / legal_id_scheme | string | Non | Identifiant legal alternatif |
email / phone | string | Non | Coordonnees |
country | string(2) | Oui | ISO 3166-1 alpha-2 |
billing_address | object | Oui | line1, postal_code, city, country requis ; line2, region optionnels |
shipping_address | object | Non | BG-13 ; name optionnel, sinon meme structure que billing_address |
metadata | object | Non | Donnees libres |
notes | string | Non | Max 5000 caracteres |
34. Quotes (Devis)
Gestion des devis (numerotation DEV-YYYY-NNNN par tenant/sub-tenant/annee). Surface partagee Sanctum + sk_*/pk_*. Les devis disposent d'une chaine d'audit SHA-256 separee de la chaine fiscale ISCA.
Endpoints tenant
| Methode | Route | Description |
|---|---|---|
GET | /v1/quotes | Lister les devis |
POST | /v1/quotes | Creer un devis |
POST | /v1/quotes/preview | Apercu PDF non-persiste |
GET | /v1/quotes/{quote} | Detail |
PATCH / PUT | /v1/quotes/{quote} | Modifier (brouillon uniquement) |
DELETE | /v1/quotes/{quote} | Supprimer (brouillon/archive uniquement) |
POST | /v1/quotes/{quote}/send | Envoyer (statut sent) |
POST | /v1/quotes/{quote}/cancel | Annuler (statut archived) |
POST | /v1/quotes/{quote}/duplicate | Dupliquer |
POST | /v1/quotes/{quote}/convert-to-deposit | Creer une facture acompte (type Factur-X 386) |
POST | /v1/quotes/{quote}/convert-to-balance | Creer une facture solde (type Factur-X 380) |
POST | /v1/quotes/{quote}/regenerate-public-link | Regenerer le lien public signe (90j) |
POST | /v1/quotes/{quote}/revoke-public-link | Revoquer l'acces public |
GET | /v1/quotes/{quote}/audit-log | Journal d'audit immuable |
GET | /v1/quotes/{quote}/pdf | Telecharger le PDF |
Endpoints publics (page de signature, sans authentification)
| Methode | Route | Description |
|---|---|---|
GET | /v1/public/quotes/{token} | Consulter un devis via le token signe |
POST | /v1/public/quotes/{token}/sign | Signer (canvas + nom + case a cocher) |
POST | /v1/public/quotes/{token}/refuse | Refuser |
GET | /v1/public/quotes/{token}/download | Telecharger le PDF public |
Endpoints admin (cross-tenant, can:admin access)
| Methode | Route | Description |
|---|---|---|
GET | /v1/quotes/stats | Statistiques globales |
GET | /v1/quotes/integrity-check | Verification de la chaine de hachage |
GET | /v1/quotes/audit-export | Export d'audit |
POST /v1/quotes
curl -X POST https://api.scell.io/api/v1/quotes \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"issue_date": "2026-05-28",
"expiration_date": "2026-06-30",
"currency": "EUR",
"title": "Devis amenagement",
"buyer_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"signature_required": true,
"lines": [
{
"description": "Prestation de conseil",
"quantity": 10,
"unit_price_ht": 800,
"tax_rate": 20
}
]
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
sub_tenant_id | uuid | Non | Cible un sous-tenant emetteur (anti-IDOR 404) |
issue_date | date | Oui | |
expiration_date | date | Non | after_or_equal:issue_date |
currency | string(3) | Oui | |
title / description / internal_notes / external_id | string | Non | |
invoice_template_id | uuid | Non | Template applique a la facture issue du devis |
callback_url | url | Non | Redirection apres signature/refus (query status, quote_id, ...) |
signature_required | boolean | Non | |
auto_convert_on_accept | boolean | Non | Convertit automatiquement en facture a l'acceptation |
buyer_id | uuid | XOR | Reference au registre (sinon champs buyer_* requis) |
buyer_name / buyer_country / buyer_address | mixte | Conditionnel | Requis si buyer_id absent |
lines | array | Oui | Min 1 ; chaque ligne : description, quantity, unit_price_ht, tax_rate requis |
Scellement du devis signe (PAdES + ancrage Bitcoin)
A l'acceptation d'un devis, son PDF est signe au format PAdES et l'empreinte SHA-256 du document scelle est ancree dans la blockchain Bitcoin via OpenTimestamps (meme moteur OTS que les clotures fiscales — preuve d'integrite infalsifiable et horodatee). L'objet sealing est expose sur la ressource Devis une fois le sceau pose.
Champ sealing.* | Type | Description |
|---|---|---|
is_sealed | boolean | true une fois le devis scelle |
pades_signed_at | datetime | Date de la signature PAdES |
signed_pdf_sha256 | string | Empreinte SHA-256 du PDF scelle (= valeur ancree Bitcoin) |
ots_status | enum | pending | confirmed | failed (etat de l'ancrage Bitcoin) |
ots_submitted_at | datetime | Soumission aux calendriers OpenTimestamps |
ots_bitcoin_confirmed_at | datetime | Confirmation de l'ancrage dans un bloc Bitcoin |
bitcoin_block_height | int | Hauteur du bloc Bitcoin d'ancrage |
ots_proof_base64 | string | Receipt OpenTimestamps .ots (base64) |
Tous les sous-champs sont nullables sauf
is_sealed. SDKs :Quote.sealing(JS / PHP). L'outil MCPscell_get_quoteremonte le sceau comme preuve d'inviolabilite.
35. Payment Schedule (Echeanciers)
Echeanciers de paiement attaches a un devis. Permet de definir des jalons (acomptes successifs + solde) convertis en factures.
| Methode | Route | Description |
|---|---|---|
GET | /v1/quotes/{quote}/payment-schedule | Lister les lignes d'echeancier |
POST | /v1/quotes/{quote}/payment-schedule | Definir l'echeancier complet (remplace tout) |
PATCH | /v1/quotes/{quote}/payment-schedule | Ajouter/modifier/supprimer en lot |
DELETE | /v1/quotes/{quote}/payment-schedule | Effacer l'echeancier |
POST | /v1/quotes/{quote}/payment-schedule/lines/{line}/convert | Convertir une ligne en facture |
GET | /v1/quotes/{quote}/payment-summary | Resume agrege (total facture / restant) |
GET | /v1/payment-schedule-presets | Prereglages disponibles (lecture seule) |
POST /v1/quotes/{quote}/payment-schedule
curl -X POST https://api.scell.io/api/v1/quotes/{quote}/payment-schedule \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"lines": [
{ "amount_type": "percent", "amount_value": 30, "milestone_label": "Acompte commande" },
{ "amount_type": "percent", "amount_value": 70, "milestone_label": "Solde livraison" }
]
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
lines | array | Oui | Min 1, max 50 |
lines.*.amount_type | enum | Oui | percent ou amount |
lines.*.amount_value | number | Oui | > 0, max 4 decimales |
lines.*.due_date | date | Non | after_or_equal:today |
lines.*.milestone_label | string | Non | Max 255 |
lines.*.description | string | Non | Max 1000 |
lines.*.auto_generate | boolean | Non | Generation automatique de la facture |
36. Invoice Templates
Personnalisation visuelle des factures et avoirs (logo, couleurs, mentions). Scope tenant ou sub_tenant cote API publique (le scope system est reserve a l'administration). Surface partagee Sanctum + sk_*/pk_*.
| Methode | Route | Description |
|---|---|---|
GET | /v1/invoice-templates | Lister les templates |
POST | /v1/invoice-templates | Creer un template |
GET | /v1/invoice-templates/{template} | Detail |
PATCH / PUT | /v1/invoice-templates/{template} | Modifier |
DELETE | /v1/invoice-templates/{template} | Supprimer |
PUT | /v1/invoice-templates/{template}/default | Definir comme template par defaut |
POST | /v1/invoice-templates/{template}/logo | Uploader un logo |
POST | /v1/invoice-templates/derive-colors-from-email-logo | Deriver les couleurs depuis le logo e-mail |
POST /v1/invoice-templates
curl -X POST https://api.scell.io/api/v1/invoice-templates \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"scope": "tenant",
"name": "Template societe",
"primary_color": "#0066FF",
"logo_position": "top-left",
"footer_text": "Merci de votre confiance"
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
scope | enum | Oui | tenant ou sub_tenant |
sub_tenant_id | uuid | Conditionnel | Requis si scope=sub_tenant |
name | string | Oui | |
description | string | Non | |
is_default | boolean | Non | |
is_enabled | boolean | Non | Defaut true. false = le template est ignore au rendu, repli automatique sur le template systeme. Accepte en create et update. |
is_available_to_subtenants | boolean | Non | |
logo_url | url | Non | |
logo_position | enum | Non | Positions autorisees du logo |
primary_color / accent_color / text_color / background_color | string | Non | Hex #RGB/#RRGGBB/#RRGGBBAA ou transparent |
header_text / footer_text / custom_mentions | string | Non | |
advanced_options / metadata | object | Non |
POST /v1/invoice-templates/derive-colors-from-email-logo
Extrait les couleurs dominantes (primary_color + accent_color) du logo e-mail configure dans le branding, et les applique au template de facture par defaut du scope courant (le template par defaut est cree s'il n'existe pas).
Authentification : X-API-Key: sk_* ou Bearer (dashboard)
curl -X POST https://api.scell.io/api/v1/invoice-templates/derive-colors-from-email-logo \
-H "X-API-Key: sk_live_xxx"Reponse (200) :
{
"data": {
"id": "uuid",
"scope": "tenant",
"is_default": true,
"primary_color": "#1A73E8",
"accent_color": "#FBBC04",
"...": "..."
}
}Erreurs : 404 (aucun logo e-mail configure sur le branding), 422 (logo inaccessible ou couleurs trop neutres pour etre exploitables).
37. Branding
Personnalisation du branding des emails transactionnels (logo, couleur, footer, signature). Le master tenant gere son branding ; les sous-tenants ont le leur.
| Methode | Route | Description |
|---|---|---|
GET | /v1/branding/tenant | Branding du tenant master |
PUT / PATCH | /v1/branding/tenant | Mettre a jour le branding du tenant |
GET | /v1/branding/sub-tenants/{subTenant} | Branding d'un sous-tenant |
PUT / PATCH | /v1/branding/sub-tenants/{subTenant} | Mettre a jour le branding d'un sous-tenant |
POST | /v1/branding/tenant/logo | Upload direct (multipart) du logo e-mail du tenant |
POST | /v1/branding/sub-tenants/{subTenant}/logo | Upload direct (multipart) du logo e-mail d'un sous-tenant |
GET | /v1/branding/tenant/preview | Apercu de l'email brande (overrides non persistes en query) |
GET | /v1/branding/sub-tenants/{subTenant}/preview | Apercu brande d'un sous-tenant (memes overrides) |
PUT /v1/branding/tenant
curl -X PUT https://api.scell.io/api/v1/branding/tenant \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"brand_logo_url": "https://cdn.example.com/logo.png",
"brand_primary_color": "#0066FF",
"brand_email_footer": "Mon Entreprise SAS - 10 rue de la Paix, 75002 Paris",
"brand_email_signature": "L equipe Mon Entreprise"
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
brand_logo_url | url | Non | Max 500 |
brand_primary_color | string | Non | Hex #RRGGBB |
brand_email_footer | string | Non | Max 2000 |
brand_email_signature | string | Non | Max 500 |
brand_email_enabled | boolean | Non | Active / desactive l'application du branding sur les emails transactionnels |
L'objet Branding retourne expose aussi
computed_email_footer(lecture seule) : le pied de page effectivement rendu dans les emails (fallback calcule quandbrand_email_footerest vide).
POST /v1/branding/tenant/logo
Upload direct multipart du logo e-mail (champ logo). Formats acceptes : jpeg, png, webp, svg/svgz. Taille max : 2 Mo. Les SVG sont normalises cote serveur. Variante sous-tenant : POST /v1/branding/sub-tenants/{subTenant}/logo.
curl -X POST https://api.scell.io/api/v1/branding/tenant/logo \
-H "X-API-Key: sk_live_xxx" \
-F "logo=@logo.png"Reponse (200) : objet Branding a plat (brand_logo_url, brand_primary_color, brand_email_footer, brand_email_signature, brand_email_enabled, computed_email_footer, ...).
GET /v1/branding/tenant/preview
Apercu HTML de l'email brande tel qu'il apparaitra au destinataire. Accepte des overrides non persistes en query pour previsualiser une configuration avant enregistrement. Variante sous-tenant : GET /v1/branding/sub-tenants/{subTenant}/preview.
| Query param | Type | Notes |
|---|---|---|
brand_primary_color | string | Hex #RRGGBB |
brand_email_footer | string | Max 2000 |
brand_email_signature | string | Max 1000 |
brand_logo_url | url | Max 2048 |
curl -G https://api.scell.io/api/v1/branding/tenant/preview \
-H "X-API-Key: sk_live_xxx" \
--data-urlencode "brand_primary_color=#0066FF" \
--data-urlencode "brand_email_signature=L equipe Mon Entreprise"38. Credit Packs
Packs de credits prepayes achetables (avec bonus). La liste est publique ; l'achat passe par le bloc billing tenant.
| Methode | Route | Auth | Description |
|---|---|---|---|
GET | /v1/packs/public | Aucune | Catalogue public des packs actifs |
GET | /v1/tenant/billing/packs | X-API-Key: sk_* | Paliers actifs (vue tenant) |
POST | /v1/tenant/billing/packs/{packSlug}/checkout | X-API-Key: sk_* | Acheter un pack |
En sandbox (
sk_test_*),checkoutcredite directement la balance. En production (sk_live_*), il cree un Stripe PaymentIntent ; le webhook Stripe genere ensuite une facture Factur-X du master tenant Scell.io, la soumet a SuperPDP, envoie le PDF a l'acheteur et credite la balance.
GET /v1/packs/public
Authentification : Aucune
curl -X GET https://api.scell.io/api/v1/packs/publicReponse (200) :
{
"data": [
{
"id": "uuid",
"slug": "pro",
"name": "Pack Pro",
"description": "...",
"amount_eur": 10000,
"amount_euros": 100.0,
"credits_eur": 11000,
"credits_euros": 110.0,
"bonus_eur": 1000,
"bonus_euros": 10.0,
"bonus_percent": 10.0,
"currency": "EUR",
"position": 2,
"is_recommended": true
}
]
}Les montants
*_eursont exprimes en centimes (entiers) ; les champs*_eurossont la conversion en euros (decimaux).
39. Recurring Invoices (Factures recurrentes)
Profils de facturation recurrente / abonnement : la plateforme emet automatiquement une facture a chaque echeance de la cadence configuree. Authentification X-API-Key sk_* (modele cle = tenant ; cibler un sous-tenant via sub_tenant_id dans le body).
Muter un profil n'affecte que les echeances futures : les factures deja emises restent immuables (chaine ISCA). Les ecritures sont gardees par les middlewares
fiscal.kill-switchetkyb.billing-cutoff.
| Methode | Endpoint | Description |
|---|---|---|
| GET | /api/v1/recurring-invoices | Liste paginee des profils |
| POST | /api/v1/recurring-invoices | Cree un profil |
| GET | /api/v1/recurring-invoices/{id} | Detail d'un profil |
| PUT | /api/v1/recurring-invoices/{id} | Met a jour un profil (echeances futures uniquement) |
| DELETE | /api/v1/recurring-invoices/{id} | Supprime un profil |
| GET | /api/v1/recurring-invoices/{id}/occurrences | Liste des echeances (chaque echeance -> une facture) |
| POST | /api/v1/recurring-invoices/{id}/pause | Suspend le profil |
| POST | /api/v1/recurring-invoices/{id}/activate | Reactive le profil |
| POST | /api/v1/recurring-invoices/{id}/cancel | Annulation terminale |
| POST | /api/v1/recurring-invoices/{id}/run-now | Declenche une emission hors-cycle (202 Accepted) |
Champs d'un profil :
| Champ | Type | Description |
|---|---|---|
buyer_id | uuid | Raccourci registre acheteur (ou champs buyer_* inline) |
lines | array | Lignes du gabarit (meme structure qu'une facture) |
recurrence.interval_unit | enum | day | week | month | year |
recurrence.interval_count | int | Multiplicateur de l'intervalle (ex: 2 = tous les 2 mois) |
recurrence.day_of_month | int | Optionnel (cadence mensuelle/annuelle) |
recurrence.day_of_week | int | Optionnel (cadence hebdomadaire) |
end_mode | enum | never | on_date | after_occurrences |
emission_mode | enum | draft (brouillon) | auto_send (emission + envoi automatiques) |
status | enum | active | paused | completed | cancelled |
# Creer un abonnement mensuel auto-emis le 1er du mois
curl -X POST https://api.scell.io/api/v1/recurring-invoices \
-H "X-API-Key: sk_live_xxx" -H "Content-Type: application/json" \
-d '{
"buyer_id": "uuid-acheteur",
"lines": [{"description": "Abonnement Pro", "unit_price": 4900, "quantity": 1, "vat_rate": 20}],
"recurrence": {"interval_unit": "month", "interval_count": 1, "day_of_month": 1},
"end_mode": "never",
"emission_mode": "auto_send"
}'SDKs : JS
client.recurringInvoices.*, PHP$client->recurringInvoices(), MCPscell_*_recurring_invoice(9 outils). Webhooks :recurring_invoice.emitted,recurring_invoice.completed,recurring_invoice.failed,recurring_invoice.upcoming(gates parauto_notifications_enabled).
40. Reference (Referentiel pays)
Referentiel des regles d'identification fiscale par pays, pour construire des formulaires acheteur/vendeur adaptes (numero de TVA, identifiant national, formes juridiques). Authentification requise (api.flexible : Sanctum, sk_* ou pk_*).
| Methode | Endpoint | Description |
|---|---|---|
| GET | /api/v1/reference/countries | Liste des pays references |
| GET | /api/v1/reference/countries/{code} | Detail d'un pays (code ISO 2 lettres) |
Pour chaque pays :
| Champ | Description |
|---|---|
vat | Numero de TVA : label, example, regex, vies_checkable (verifiable VIES) |
national_id | Identifiant national : label, scheme (ISO 6523), example, regex, required_for_b2b |
legal_forms | Formes juridiques connues du pays |
curl https://api.scell.io/api/v1/reference/countries/FR \
-H "X-API-Key: sk_live_xxx"SDKs : JS
client.reference.countries()/client.reference.country(code). Cable surScellClient,ScellApiClientetScellPublicClient.
41. Sub-Tenant Fiscal (Seuils & Statut)
Suivi des seuils auto-entrepreneur (loi 2025-1044) et gestion du statut fiscal declare d'un sous-tenant. Auth X-API-Key sk_* ou Sanctum (dashboard).
| Methode | Endpoint | Description |
|---|---|---|
| GET | /api/v1/sub-tenants/{id}/thresholds | Jauges de seuils (franchise TVA + plafond micro-regime) |
| POST | /api/v1/sub-tenants/{id}/thresholds/simulate | Simulateur pre-emission (lecture seule) |
| PATCH | /api/v1/sub-tenants/{id}/fiscal-status | Met a jour le statut fiscal declare |
GET .../thresholds retourne, par categorie de revenu, le CA HT cumule, le niveau d'alerte (warning_80 … micro_ceiling_exceeded), la date de franchissement projetee et un champ disclaimer (purement informatif, ne constitue pas un conseil fiscal). Les seuils sont des regles fiscales datees (franchise TVA en base 37 500 € / majore 41 250 € ; plafond micro 83 600 € / majore 91 900 €).
POST .../thresholds/simulate projette les jauges comme si une facture hypothetique de amount (HT) en categorie category etait emise — sans rien enregistrer. Permet d'alerter l'utilisateur AVANT d'emettre s'il franchit un seuil.
PATCH .../fiscal-status met a jour regime, vat_status, type d'activite, date de debut, numero de TVA. Basculer vat_status a liable fait que Scell.io facture la TVA sur les factures suivantes et retire la mention art. 293 B ; un vat_number devient alors requis.
# Simuler l'impact d'une facture de 1 200 € HT (prestations de services)
curl -X POST https://api.scell.io/api/v1/sub-tenants/{id}/thresholds/simulate \
-H "X-API-Key: sk_live_xxx" -H "Content-Type: application/json" \
-d '{"amount": 120000, "category": "services"}'SDKs : JS
client.subTenants.getThresholds(id),simulateThresholds(id, {...}),updateFiscalStatus(id, {...}). Notifications asynchrones via la commandeae:monitor-thresholds(distincte du GET). Voir aussi la page Conformite Fiscale pour le detail des seuils.
42. Products (Catalogue produits)
Catalogue de produits/services reutilisables, scope strict (tenant_id, sub_tenant_id). Surface partagee : Sanctum (dashboard) et sk_*/pk_* (SDKs). Une ligne de facture ou de devis peut referencer un produit via product_id (auto-remplissage cote serveur + lien soft) ou creer un produit a la volee via save_to_catalog=true (upsert atomique, dedup par SKU puis par nom).
| Methode | Route | Description |
|---|---|---|
GET | /v1/products | Lister (paginate, q sur name/sku, filtres revenue_category, product_category_id, is_active) |
POST | /v1/products | Creer un produit |
GET | /v1/products/{product} | Detail |
PATCH / PUT | /v1/products/{product} | Modifier |
DELETE | /v1/products/{product} | Desactiver (is_active=false, soft delete) |
POST /v1/products
Authentification : X-API-Key: sk_* ou Bearer (dashboard)
curl -X POST https://api.scell.io/api/v1/products \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Consultation strategie",
"sku": "CONSULT-STRAT-01",
"revenue_category": "service",
"unit": "C62",
"unit_price_ht": 150000,
"default_tax_rate": 20,
"product_category_id": "uuid-de-la-categorie"
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
name | string | Oui | Nom du produit ou service |
description | string | Non | Description libre |
sku | string | Non | Reference interne (cle d'upsert si save_to_catalog) |
revenue_category | goods | service | accommodation | null | Non | Mappe sur le type de ligne Factur-X |
unit | string | Non | Code UN/ECE (C62 = piece, defaut) |
unit_price_ht | number | Oui | Prix unitaire HT en centimes |
default_tax_rate | number | Non | Taux de TVA par defaut (defaut : 20) |
default_discount_rate | number | null | Non | Remise en % |
currency | string | Non | ISO 4217 (defaut : EUR) |
product_category_id | uuid | null | Non | Categorie parente (scope verifie, 422 si hors scope) |
metadata | object | Non | Cle-valeur libre |
notes | string | Non | Notes internes |
Champs de reponse
| Champ | Type | Notes |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
sub_tenant_id | uuid | null | |
product_category_id | uuid | null | |
name | string | |
description | string | null | |
sku | string | null | |
revenue_category | string | null | goods, service, accommodation |
revenue_category_label | string | null | Libelle traduit |
unit | string | Code UN/ECE |
unit_price_ht | number | En centimes |
default_tax_rate | number | |
default_discount_rate | number | null | |
currency | string | |
is_active | boolean | false = desactive (soft delete) |
product_category | object | null | Categorie parente (imbriquee) |
metadata | object | |
notes | string | null | |
created_at | datetime | ISO 8601 |
updated_at | datetime | ISO 8601 |
Utilisation sur les lignes de facture/devis
Trois nouveaux champs optionnels sur chaque element lines[] :
| Champ | Type | Description |
|---|---|---|
product_id | uuid | null | Pre-remplit la ligne cote serveur (description, prix HT, taux TVA, unite, remise) + cree un lien soft sur la facture/devis. 422 si product_id hors scope du tenant/sub-tenant. |
save_to_catalog | boolean | Upsert atomique backend : cree ou met a jour un produit dans le catalogue depuis les donnees de la ligne (dedup priorite SKU puis nom). |
product_category_id | uuid | null | Range le produit cree par save_to_catalog dans cette categorie. 422 si hors scope. |
SDKs : JS
client.products.create({...}),list({q, revenue_category, product_category_id, is_active}),get(id),update(id, {...}),delete(id). PHP$scell->products()->create([...]). MCP :scell_create_product,scell_list_products,scell_get_product,scell_update_product,scell_delete_product.
43. Product Categories (Categories produits)
Categories pour organiser le catalogue produits/services. Scope strict (tenant_id, sub_tenant_id). Surface partagee : Sanctum (dashboard) et sk_*/pk_* (SDKs).
| Methode | Route | Description |
|---|---|---|
GET | /v1/product-categories | Lister (paginate, q sur name, per_page) |
POST | /v1/product-categories | Creer une categorie |
GET | /v1/product-categories/{category} | Detail |
PATCH / PUT | /v1/product-categories/{category} | Modifier |
DELETE | /v1/product-categories/{category} | Supprimer (refuse si produits associes) |
POST /v1/product-categories
Authentification : X-API-Key: sk_* ou Bearer (dashboard)
curl -X POST https://api.scell.io/api/v1/product-categories \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Prestations de conseil",
"color": "#0066FF",
"description": "Services de conseil et d'\''expertise",
"position": 1
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
name | string | Oui | Nom de la categorie |
color | string | null | Non | Couleur hexadecimale #RRGGBB |
description | string | Non | Description libre |
position | integer | Non | Ordre d'affichage |
metadata | object | Non | Cle-valeur libre |
Champs de reponse
| Champ | Type | Notes |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
sub_tenant_id | uuid | null | |
name | string | |
color | string | null | #RRGGBB |
description | string | null | |
position | integer | Ordre d'affichage |
products_count | integer | Nombre de produits dans cette categorie |
metadata | object | |
created_at | datetime | ISO 8601 |
updated_at | datetime | ISO 8601 |
SDKs : JS
client.productCategories.create({...}),list({q, per_page}),get(id),update(id, {...}),delete(id). PHP$scell->productCategories()->create([...]). MCP :scell_create_product_category,scell_list_product_categories,scell_get_product_category,scell_update_product_category,scell_delete_product_category.
44. Suppliers (Fournisseurs)
Breaking change v3.0.0 (2026-06-07) — Les fournisseurs sont desormais derives automatiquement des factures entrantes (
POST /api/v1/incoming-invoices). La creation et la suppression manuelles sont supprimees. Seule la mise a jour des champs de contact et d'enrichissement subsiste.
Les fournisseurs (suppliers) representent les emetteurs des factures recues. Ils sont crees et mis a jour automatiquement par le serveur lors de l'import d'une facture entrante : les champs d'identite (raison sociale, SIRET, adresse) sont synchronises depuis les metadonnees seller_* de la facture. Ils ne peuvent pas etre crees ni supprimes manuellement.
Scope strict (tenant_id, sub_tenant_id). Surface partagee : Sanctum (dashboard) et sk_*/pk_* (SDKs).
Endpoints disponibles
| Methode | Route | Description |
|---|---|---|
GET | /v1/suppliers | Lister les fournisseurs (paginate, q sur name/siret/email, per_page) |
GET | /v1/suppliers/{id} | Detail d'un fournisseur |
PATCH | /v1/suppliers/{id} | Enrichir les champs de contact (voir champs autorises ci-dessous) |
POST | /v1/suppliers | Supprime — 405 Method Not Allowed |
DELETE | /v1/suppliers/{id} | Supprime — 405 Method Not Allowed |
Champs en lecture seule (identite)
Ces champs sont synchronises depuis la facture entrante source et ne peuvent pas etre modifies via l'API :
| Champ | Type | Source |
|---|---|---|
name | string | seller_name de la facture entrante |
siret | string | null | seller_siret de la facture entrante |
vat_number | string | null | seller_vat_number de la facture entrante |
address | object | null | seller_address de la facture entrante |
country | string | null | seller_country de la facture entrante |
PATCH /v1/suppliers/{id}
Seul endpoint d'ecriture maintenu. Accepte uniquement les champs suivants :
Authentification : X-API-Key: sk_* ou Bearer (dashboard)
curl -X PATCH https://api.scell.io/api/v1/suppliers/SUP_ID \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"email": "compta@fournisseur.fr",
"phone": "+33123456789",
"notes": "Relance sous 48h",
"metadata": { "erp_id": "FOURN-001" }
}'| Champ | Type | Requis | Notes |
|---|---|---|---|
email | string | null | Non | Email de contact fournisseur |
phone | string | null | Non | Telephone de contact |
notes | string | null | Non | Notes internes (non transmises au fournisseur) |
metadata | object | Non | Cle-valeur libre |
Tout autre champ envoye dans le corps de la requete (notamment name, siret, address) est ignore ou rejete avec 422 SUPPLIER_IDENTITY_READONLY.
GET /v1/suppliers
curl https://api.scell.io/api/v1/suppliers?q=dupont&per_page=25 \
-H "X-API-Key: sk_test_xxx"Query params :
| Param | Type | Notes |
|---|---|---|
q | string | Recherche sur name, siret, email |
per_page | integer | Defaut 15, max 100 |
sub_tenant_id | uuid | Filtre par sous-tenant (anti-IDOR, doit appartenir au tenant) |
Champs de reponse (GET list / GET detail)
| Champ | Type | Notes |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
sub_tenant_id | uuid | null | |
name | string | Lecture seule — identite |
siret | string | null | Lecture seule — identite |
vat_number | string | null | Lecture seule — identite |
address | object | null | Lecture seule — identite |
country | string | null | Lecture seule — identite |
email | string | null | Modifiable via PATCH |
phone | string | null | Modifiable via PATCH |
notes | string | null | Modifiable via PATCH |
metadata | object | Modifiable via PATCH |
incoming_invoices_count | integer | Nombre de factures recues associees |
created_at | datetime | ISO 8601 |
updated_at | datetime | ISO 8601 |
Creer un fournisseur (workflow v3.0.0)
Les fournisseurs ne se creent plus manuellement. Pour ajouter un fournisseur au registre, importez une facture entrante emise par ce fournisseur :
curl -X POST https://api.scell.io/api/v1/incoming-invoices \
-H "X-API-Key: sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"seller_name": "ACME SAS",
"seller_siret": "12345678900010",
"invoice_number": "FACT-2026-001",
"issue_date": "2026-06-07",
"total_ttc": 1200.00,
...
}'Le serveur cree ou met a jour automatiquement la fiche fournisseur correspondante.
SDKs (v3.0.0)
| SDK | Methode | Statut |
|---|---|---|
JS @scell/sdk | client.suppliers.list({q, per_page}) | Disponible |
JS @scell/sdk | client.suppliers.get(id) | Disponible |
JS @scell/sdk | client.suppliers.update(id, {email, phone, notes, metadata}) | Disponible |
JS @scell/sdk | client.suppliers.create({...}) | Retire en v3.0.0 |
JS @scell/sdk | client.suppliers.delete(id) | Retire en v3.0.0 |
PHP scell/sdk | $scell->suppliers()->list([...]) | Disponible |
PHP scell/sdk | $scell->suppliers()->get($id) | Disponible |
PHP scell/sdk | $scell->suppliers()->update($id, [...]) | Disponible |
PHP scell/sdk | $scell->suppliers()->create([...]) | Retire en v3.0.0 |
PHP scell/sdk | $scell->suppliers()->delete($id) | Retire en v3.0.0 |
MCP @scell/mcp-client | scell_list_suppliers | Disponible |
MCP @scell/mcp-client | scell_get_supplier | Disponible |
MCP @scell/mcp-client | scell_update_supplier | Disponible |
MCP @scell/mcp-client | scell_create_supplier | Retire en v3.0.0 |
MCP @scell/mcp-client | scell_delete_supplier | Retire en v3.0.0 |
45. Documents (Apercu live)
POST /v1/documents/preview
Apercu HTML live et non persiste d'un document en cours de saisie (facture, avoir ou devis) : le serveur rend le document avec le vrai template, le branding et les mentions de la societe emettrice — sans rien creer ni debiter. Alimente l'apercu A4 temps reel du dashboard pendant la creation.
Authentification : X-API-Key: sk_* ou Bearer (dashboard) — surface api.flexible
Corps de la requete :
| Champ | Type | Requis | Notes |
|---|---|---|---|
type | enum | Oui | invoice | credit_note | quote |
document_number | string | Non | Numero affiche sur l'apercu |
buyer | object | Non | name, siret, vat_number, email, phone, is_individual, address (line1, line2, postal_code, city, country) |
lines | array | Non | Max 200 lignes : description, quantity, unit_price, tax_rate |
issue_date | date | Non | YYYY-MM-DD |
due_date | date | Non | YYYY-MM-DD |
currency | string (3 car.) | Non | ISO 4217 |
notes | string | Non | |
payment_terms | string | Non | Max 2000 |
curl -X POST https://api.scell.io/api/v1/documents/preview \
-H "X-API-Key: sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"type": "invoice",
"document_number": "FACT-2026-042",
"buyer": {
"name": "Client SARL",
"siret": "98765432109876",
"address": { "line1": "10 Avenue des Champs", "postal_code": "75008", "city": "Paris", "country": "FR" }
},
"lines": [
{ "description": "Prestation de conseil", "quantity": 2, "unit_price": 500.00, "tax_rate": 20 }
],
"issue_date": "2026-06-11",
"currency": "EUR"
}'Reponse (200) : text/html (header Cache-Control: no-store) — ideal pour un <iframe srcdoc>. Rien n'est persiste cote serveur.
Erreurs : 422 (validation : type manquant, plus de 200 lignes, payment_terms > 2000 caracteres...).