Getting Started
Welcome to the Chorus Pro API documentation. This complete guide will help you configure your access, understand authentication, and make your first request.
Table of Contents
Base URLs
The Chorus Pro API is available on the following environments:
Production
https://api.piste.gouv.fr/cprohttps://oauth.piste.gouv.frProduction environment for live requests with real data.
Sandbox
https://sandbox-api.piste.gouv.fr/cprohttps://sandbox-oauth.piste.gouv.frSandbox environment for development and testing.
1Create a PISTE Account
PISTE is the platform for accessing government APIs. This is where you'll get your OAuth credentials.
- Go to the PISTE account creation form
- Click the confirmation link received by email
- Log in to your PISTE dashboard
π‘ Tip: Create a document to note all your credentials (Client ID, Secret Key, technical account, etc.). You'll need them throughout the setup.
2API Terms of Service Consent
- Go to the "API" tab, sub-tab "CGU API Consent"
- Display 100 rows at a time for better readability
- Check the boxes for the following APIs:
β οΈ Warning: Each API appears twice (Sandbox and Production). Check both!
3Activate Applications
For Sandbox:
- Go to the "My Applications" tab
- An APP_SANDBOX_your@email.com application already exists, click on it
- Click "Edit application"
- In "Select APIs", check the 4 APIs (Factures, Structures, Utilisateurs, Transverses)
- Click "Apply changes"
For Production:
- Click "Create an application"
- Fill in the information and save
- Edit the application and select the same 4 APIs
π Get your OAuth credentials
In the "Authentication" tab of your application, you'll find:
Client ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxSecret Key: Click "View client secret"
4Create a Chorus Pro Technical Account
The technical account is different from the PISTE account. It's used to authenticate API requests with the cpro-account header.
Creation steps:
- Log in to the Chorus Pro portal (or the qualification portal for Sandbox)
- Go to "My account" > "Manage technical accounts"
- Click "Create a technical account"
- Note the generated identifier (format: TECH_1_xxxxxx@cpro.fr)
- Set a secure password
cpro-account header format:
# Encoder en base64 : identifiant:motdepasse
echo -n "TECH_1_xxxxxx@cpro.fr:votre_mot_de_passe" | base64
# RΓ©sultat (exemple)
VEVDSF8xX3h4eHh4eHhAY3Byby5mcjp2b3RyZV9tb3RfZGVfcGFzc2U=π Detailed tutorial: Create a technical account (official documentation)
5Authentication
β οΈ Dual authentication required: Every API request requires TWO simultaneous authentications.
1. OAuth 2.0 (Bearer Token)
Token obtained via the client_credentials grant with your PISTE credentials. Expires after 1 hour.
Authorization: Bearer YOUR_OAUTH_TOKEN2. cpro-account Header
Chorus Pro technical account credentials encoded in base64 as 'identifier:password'.
cpro-account: base64(TECH_1_xxxxx@cpro.fr:password)Get an OAuth 2.0 Token
curl -X POST "https://oauth.piste.gouv.fr/api/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=openid resource.READ"Response:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI...",
"token_type": "Bearer",
"expires_in": 3600
}6Your First Request
Test your configuration with the health-check or by retrieving your linked structures:
curl -X POST "https://api.piste.gouv.fr/cpro/utilisateurs/v1/monCompte/recuperer/rattachements" \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "cpro-account: YOUR_BASE64_CREDENTIALS" \
-H "Content-Type: application/json" \
-d '{
"parametresRecherche": {
"nbResultatsParPage": 100,
"pageResultatDemandee": 1
}
}'Expected response:
{
"codeRetour": 0,
"libelle": "TRA_MSG_00.000",
"listeStructureRattachement": [
{
"idStructure": 12345678,
"identifiantStructure": "88200000000000",
"typeIdentifiantStructure": "SIRET",
"designationStructure": "Ma Structure",
"statutUtilisateur": "ACTIF"
}
]
}β Success: If you get "codeRetour": 0, your configuration is correct!
π‘ Note: If you just created the technical account, you may need to wait up to 1 hour before requests work.
7Invoice Submission Flow
Here are the typical steps to submit an invoice on Chorus Pro via the API:
Important Notes
π POST Method for Everything
The Chorus Pro API uses POST for almost all operations, even data retrieval. Green badges indicate read operations, blue ones indicate creations.
π Expiring Tokens
The OAuth token expires after 1 hour. Plan for an automatic refresh system in your integration.
β‘ Response Format
Responses include a 'codeRetour' field (0 = success) and 'libelle' with the message. Always check these fields even with HTTP 200.
Resources & Support
- πOfficial documentation: portail.chorus-pro.gouv.fr/aife_documentation/
- πGet API access: data.gouv.fr/dataservices/api-chorus-pro/
- πComplete guide with video tutorial: blog.choruspay.fr
- β Create a technical account: Official tutorial
- πOfficial PDF documentation (AIFE): Download PDF
Getting Started
Welcome to the Chorus Pro API documentation. This complete guide will help you configure your access, understand authentication, and make your first request.
Table of Contents
Base URLs
The Chorus Pro API is available on the following environments:
Production
https://api.piste.gouv.fr/cprohttps://oauth.piste.gouv.frProduction environment for live requests with real data.
Sandbox
https://sandbox-api.piste.gouv.fr/cprohttps://sandbox-oauth.piste.gouv.frSandbox environment for development and testing.
1Create a PISTE Account
PISTE is the platform for accessing government APIs. This is where you'll get your OAuth credentials.
- Go to the PISTE account creation form
- Click the confirmation link received by email
- Log in to your PISTE dashboard
π‘ Tip: Create a document to note all your credentials (Client ID, Secret Key, technical account, etc.). You'll need them throughout the setup.
2API Terms of Service Consent
- Go to the "API" tab, sub-tab "CGU API Consent"
- Display 100 rows at a time for better readability
- Check the boxes for the following APIs:
β οΈ Warning: Each API appears twice (Sandbox and Production). Check both!
3Activate Applications
For Sandbox:
- Go to the "My Applications" tab
- An APP_SANDBOX_your@email.com application already exists, click on it
- Click "Edit application"
- In "Select APIs", check the 4 APIs (Factures, Structures, Utilisateurs, Transverses)
- Click "Apply changes"
For Production:
- Click "Create an application"
- Fill in the information and save
- Edit the application and select the same 4 APIs
π Get your OAuth credentials
In the "Authentication" tab of your application, you'll find:
Client ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxSecret Key: Click "View client secret"
4Create a Chorus Pro Technical Account
The technical account is different from the PISTE account. It's used to authenticate API requests with the cpro-account header.
Creation steps:
- Log in to the Chorus Pro portal (or the qualification portal for Sandbox)
- Go to "My account" > "Manage technical accounts"
- Click "Create a technical account"
- Note the generated identifier (format: TECH_1_xxxxxx@cpro.fr)
- Set a secure password
cpro-account header format:
# Encoder en base64 : identifiant:motdepasse
echo -n "TECH_1_xxxxxx@cpro.fr:votre_mot_de_passe" | base64
# RΓ©sultat (exemple)
VEVDSF8xX3h4eHh4eHhAY3Byby5mcjp2b3RyZV9tb3RfZGVfcGFzc2U=π Detailed tutorial: Create a technical account (official documentation)
5Authentication
β οΈ Dual authentication required: Every API request requires TWO simultaneous authentications.
1. OAuth 2.0 (Bearer Token)
Token obtained via the client_credentials grant with your PISTE credentials. Expires after 1 hour.
Authorization: Bearer YOUR_OAUTH_TOKEN2. cpro-account Header
Chorus Pro technical account credentials encoded in base64 as 'identifier:password'.
cpro-account: base64(TECH_1_xxxxx@cpro.fr:password)Get an OAuth 2.0 Token
curl -X POST "https://oauth.piste.gouv.fr/api/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=openid resource.READ"Response:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI...",
"token_type": "Bearer",
"expires_in": 3600
}6Your First Request
Test your configuration with the health-check or by retrieving your linked structures:
curl -X POST "https://api.piste.gouv.fr/cpro/utilisateurs/v1/monCompte/recuperer/rattachements" \
-H "Authorization: Bearer YOUR_OAUTH_TOKEN" \
-H "cpro-account: YOUR_BASE64_CREDENTIALS" \
-H "Content-Type: application/json" \
-d '{
"parametresRecherche": {
"nbResultatsParPage": 100,
"pageResultatDemandee": 1
}
}'Expected response:
{
"codeRetour": 0,
"libelle": "TRA_MSG_00.000",
"listeStructureRattachement": [
{
"idStructure": 12345678,
"identifiantStructure": "88200000000000",
"typeIdentifiantStructure": "SIRET",
"designationStructure": "Ma Structure",
"statutUtilisateur": "ACTIF"
}
]
}β Success: If you get "codeRetour": 0, your configuration is correct!
π‘ Note: If you just created the technical account, you may need to wait up to 1 hour before requests work.
7Invoice Submission Flow
Here are the typical steps to submit an invoice on Chorus Pro via the API:
Important Notes
π POST Method for Everything
The Chorus Pro API uses POST for almost all operations, even data retrieval. Green badges indicate read operations, blue ones indicate creations.
π Expiring Tokens
The OAuth token expires after 1 hour. Plan for an automatic refresh system in your integration.
β‘ Response Format
Responses include a 'codeRetour' field (0 = success) and 'libelle' with the message. Always check these fields even with HTTP 200.
Resources & Support
- πOfficial documentation: portail.chorus-pro.gouv.fr/aife_documentation/
- πGet API access: data.gouv.fr/dataservices/api-chorus-pro/
- πComplete guide with video tutorial: blog.choruspay.fr
- β Create a technical account: Official tutorial
- πOfficial PDF documentation (AIFE): Download PDF