API REST
Chaque action de l'interface Celerp correspond à un endpoint REST : la même API que l'interface utilise en interne. Automatisez vos processus, connectez d'autres systèmes ou créez vos propres outils. L'API s'exécute localement, sur vos données ; rien n'est envoyé dans le cloud.
🔗 URL de base
http://localhost:8000 pour une installation pip. L'application de bureau choisit son propre port : voir celerp-data/api-port.
🔑 Authentification
JWT Bearer issu de /auth/login
📦 Format
JSON en entrée, JSON en sortie
📖 Spécification
GET /openapi.json (OpenAPI 3.1)
Quel port ? Avec pip install celerp, le serveur d'API écoute sur localhost:8000 (modifiable avec --api-port) et le port 8080 sert l'interface web destinée aux utilisateurs, pas l'API. L'application de bureau choisit des ports libres à chaque démarrage et écrit le port de l'API dans le fichier api-port de son dossier celerp-data. Pour fixer le port, définissez CELERP_API_PORT avant de la lancer.
Authentification
Celerp utilise des JSON Web Tokens de courte durée de vie. Connectez-vous avec votre adresse e-mail et votre mot de passe Celerp pour obtenir un token d'accès, puis transmettez-le dans un en-tête Bearer à chaque requête.
1. Se connecter
curl -X POST http://localhost:8000/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'
La réponse contient deux tokens :
{
"access_token": "eyJhbGciOiJI...",
"refresh_token": "eyJhbGciOiJI..."
}
2. Appeler l'API avec le token
curl http://localhost:8000/items \
-H "Authorization: Bearer eyJhbGciOiJI..."
- Le token identifie votre utilisateur, votre rôle et votre entreprise : les requêtes sont automatiquement limitées à cette entreprise, sans en-tête supplémentaire.
- Les tokens d'accès sont valables jusqu'à 24 heures. À expiration, obtenez une nouvelle paire en envoyant votre
refresh_tokenen POST sur/auth/token/refresh. - Vous appartenez à plusieurs entreprises ? Listez-les avec
GET /auth/my-companies, puis obtenez un token limité à une autre avecPOST /auth/switch-company/{company_id}.
Les tokens portent vos permissions. Un token viewer peut lire mais pas écrire ; les données de coût exigent le rôle manager ou supérieur. Traitez les tokens comme des mots de passe : quiconque en détient un peut agir en votre nom.
Effectuer des requêtes
Tous les endpoints se trouvent sous l'adresse de votre serveur d'API (http://localhost:8000 pour une installation pip, comme dans les exemples ci-dessous) et renvoient du JSON. Les endpoints de liste renvoient un tableau items et un décompte total :
curl "http://localhost:8000/items?limit=20&offset=0" \
-H "Authorization: Bearer $TOKEN"
{
"items": [
{ "id": "item:...", "sku": "WIDGET-001", "name": "Widget", "quantity": 42 }
],
"total": 142
}
Pagination : passez ?limit= (50 par défaut) et ?offset=. La plupart des endpoints de liste acceptent également un terme de recherche q= et des filtres de colonne (ex. ?status=available).
Créer des données
Envoyez du JSON en POST pour créer des enregistrements. Les écritures renvoient l'id de la nouvelle entité (et l'event_id sous-jacent : chaque modification dans Celerp est un événement).
curl -X POST http://localhost:8000/crm/contacts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"email": "[email protected]",
"contact_type": "customer",
"idempotency_key": "acme-2026-06-21"
}'
Idempotence : incluez une idempotency_key dans toute écriture. Une requête relancée avec la même clé ne créera pas de doublon : c'est sans risque sur les réseaux instables et dans les traitements par lots.
Conventions
- Erreurs les réponses non 2xx renvoient
{"detail": "..."}avec un code de statut HTTP standard. - Limites de débit 60 requêtes/minute par IP par défaut ; la connexion est plafonnée à 10/minute. Dépasser une limite renvoie
429. - Permissions l'accès aux endpoints dépend de votre rôle :
viewer → operator → manager → admin → owner. - Périmètre d'entreprise chaque requête agit sur l'entreprise de votre token ; changez d'entreprise pour agir sur une autre.
Endpoints courants
Un petit aperçu pour démarrer. Chaque module ajoute les siens : la liste complète se trouve dans le schéma OpenAPI ci-dessous.
| Méthode | Chemin | Description |
|---|---|---|
POST | /auth/login | Obtenir un token d'accès (aucune authentification requise) |
GET | /health | État du service (aucune authentification requise) |
GET | /items | Lister les articles en stock |
POST | /items | Créer un article |
GET | /docs | Lister les documents (factures clients, bons de commande, factures fournisseurs, …) |
POST | /docs | Créer un document |
GET | /crm/contacts | Lister les clients et fournisseurs |
POST | /crm/contacts | Créer un contact |
GET | /dashboard/kpis | KPI métier |
Référence complète par domaine
Tous les endpoints servis par l’API en cours d’exécution, regroupés par domaine. Chaque page indique la méthode, le chemin, les paramètres, les structures de requête et de réponse ainsi qu’un exemple d’appel.
Auth
Authentication API for Celerp users, login, logout, password recovery, company switching, and API access. (13 endpoints)
Companies
Company settings and administration API for users, roles, locations, taxes, payment terms, price lists, modules, and company preferences. (70 endpoints)
Items
Inventory API for products and stock items, quantities, pricing, locations, barcodes, valuation, imports, reservations, transfers, transformations, and stock status. (39 endpoints)
Docs
Business document API for invoices, bills, purchase orders, quotations, credit notes, shipping documents, payments, fulfillment, PDF output, and document lifecycle operations. (52 endpoints)
Lists
Inventory list API for stock audits, transfers, write-offs, manifests, scans, reservations, notes, exports, and list lifecycle operations. (38 endpoints)
Accounting
Celerp accounting REST API for the chart of accounts, journal entries, general ledger, bank reconciliation, financial statements, transfers, and fiscal period controls. (59 endpoints)
Ledger
Event ledger API for reading Celerp business events and rebuilding derived application data. (3 endpoints)
Reports
ERP reporting API for accounts receivable and payable aging, sales, purchases, and expiring inventory. (5 endpoints)
Manufacturing
Manufacturing API for production orders, recipes, work centers, workflows, material requirements, costing, scheduling, component issue, and finished-goods receipt. (32 endpoints)
Labels
Inventory label and barcode API for label templates, single-item labels, bulk label sheets, and printable PDFs. (7 endpoints)
Crm
CRM REST API for customers, suppliers, contacts, addresses, people, notes, tags, files, imports, exports, and contact management. (25 endpoints)
Subscriptions
Recurring document and subscription API for invoice and purchase-order templates, scheduling, activation, pausing, resuming, cancellation, and on-demand generation. (6 endpoints)
Connectors
Integration API for connecting Celerp ERP to external commerce and business platforms, managing connector credentials, and running data synchronization. (9 endpoints)
Payments
Payment integration API for connecting payment processing, checking payment availability, and reading connection status. (7 endpoints)
Backup
Backup and restore API for exporting, importing, listing, creating, and restoring Celerp ERP backups. (8 endpoints)
Notifications
User notification API for listing notifications and marking individual or all notifications as read. (3 endpoints)
Events
Real-time server-sent events API for Celerp notifications and live application events. (1 endpoint)
System
System health, readiness, restart, and factory reset endpoints for a Celerp ERP installation. (10 endpoints)
Admin
Administrative diagnostics and system status endpoints for maintaining a Celerp ERP installation. (2 endpoints)
Ai
Celerp AI API for ERP assistant conversations, document extraction, batch jobs, memory, usage, and user-confirmed business actions. (22 endpoints)
Attachments
Inventory attachment API for uploading, downloading, tagging, previewing, and deleting item files and product images. (12 endpoints)
Dashboard
Dashboard API for ERP KPIs, recent business activity, and searchable activity history. (3 endpoints)
Payments Public
Public payment endpoints for customer payment links and payment-provider return handling. (2 endpoints)
Received
Received documents API for documents other Celerp users shared with you: list and review them, book one as your own draft, and bring a booked draft up to date with the sender's latest revision. (5 endpoints)
Search
Global Celerp ERP search API for finding permitted records across modules from a single query. (1 endpoint)
Settings
System settings and Celerp Connect API for account setup, cloud connection state, billing, backups, connectors, and partner configuration. (17 endpoints)
Share
Document sharing API for creating, inspecting, updating, and revoking public share links for Celerp documents and lists. (4 endpoints)
Share Public
Public document sharing and import endpoints for viewing shared Celerp documents and downloading or importing portable document bundles. (4 endpoints)
Stars
Supporter badge and Celerp community recognition API for badge verification, display, opt-out, and prompts. (6 endpoints)
Verticals
Industry preset and category schema API for configuring Celerp ERP fields and defaults by business vertical. (5 endpoints)
Company Backups
16 endpoints
Migrations
22 endpoints
Explorer l'API complète
La référence complète et toujours à jour est le schéma OpenAPI 3.1 généré par votre propre instance :
GET http://localhost:8000/openapi.json
Chargez-le dans n'importe quel outil OpenAPI (Postman, Insomnia, Swagger UI ou un générateur de clients) pour parcourir tous les endpoints et modèles, tester des requêtes et générer un client typé dans votre langage. Celerp livre le schéma lui-même plutôt qu'une page de documentation hébergée : votre surface d'API reste interne à votre instance.
Vous préférez le langage naturel ? L'assistant IA (Connect) appelle cette même API pour vous : demandez-lui de sortir un rapport ou de créer un document en langage naturel. Et rappelez-vous que tout ce que l'API peut faire, elle le fait sans accès privilégié, exactement comme le ferait un utilisateur connecté.