Inscrire une entreprise et ses salariés par API
POST/enrollments/companies
Inscrire immédiatement une entreprise et ses apprenants. Une entreprise avec SIRET et 1 à 100 apprenants sont obligatoires. La demande est atomique : tout est enregistré ou rien. price_type=total place le montant uniquement au niveau entreprise ; price_type=par_apprenant le place uniquement sur chaque apprenant. Les apprenants reçoivent le statut Employé et l’entreprise résolue ; ne fournissez ni status ni company_id dans students. Un employeur différent ne sera jamais remplacé silencieusement. Un employeur absent peut être renseigné si les liens existants sont compatibles ; les autres données personnelles restent inchangées. student_enrollment peut être omis : les valeurs BPF/paiement salarié et les trois indicateurs à no sont alors appliqués. change_address=Oui nécessite une session intra et la permission supplémentaire sessions:location:update. Il ne modifie pas le lieu lorsque l’inscription entreprise existe déjà.
Permission : enrollments:companies:create. Les deux jetons restent obligatoires.
Champs de la requête
| Champ | Obligatoire | Null autorisé | Type, limites, valeurs et défaut |
|---|---|---|---|
course_id |
Oui | Non | string / id ; 19 caractères max. |
company |
Oui | Non | object |
company.name |
Oui | Non | string ; 255 caractères max. ; 1020 octets max. |
company.email |
Oui | Non | string / email ; 255 caractères max. ; 1020 octets max. |
company.phone |
Non | Non | string ; 255 caractères max. ; 1020 octets max. ; défaut "" |
company.address |
Oui | Non | string ; 255 caractères max. ; 1020 octets max. |
company.siret |
Oui | Non | string / siret ; 255 caractères max. ; 1020 octets max. |
company.tva |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.ape |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.description |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
company.represented_by |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.function_represented_by |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.title_represented_by |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.opco |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.adherent |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.effectif |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.idcc |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.nace |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.email2 |
Non | Oui | string / email ; 255 caractères max. ; 1020 octets max. |
company.contact2 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.email3 |
Non | Oui | string / email ; 255 caractères max. ; 1020 octets max. |
company.contact3 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.email4 |
Non | Oui | string / email ; 255 caractères max. ; 1020 octets max. |
company.contact4 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.email5 |
Non | Oui | string / email ; 255 caractères max. ; 1020 octets max. |
company.contact5 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.civilite2 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.civilite3 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.civilite4 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.civilite5 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.phone2 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.phone3 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.phone4 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.phone5 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.fonction2 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.fonction3 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.fonction4 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.fonction5 |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.code_postal |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.street |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.city |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company.country_code |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students |
Oui | Non | array ; 1–100 objets |
students[].name |
Oui | Non | string ; 255 caractères max. ; 1020 octets max. |
students[].email |
Oui | Non | string / email ; 255 caractères max. ; 1020 octets max. |
students[].phone |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].address |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].birth |
Non | Oui | string / date ; 10 caractères max. |
students[].city_of_birth |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].country_of_birth |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].department_of_birth |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].gender |
Non | Oui | string ; 255 caractères max. ; Male, Female, Other |
students[].description |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].function |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].profession |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].raison_sociale |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].vat_number |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].siret |
Non | Oui | string / siret ; 255 caractères max. ; 1020 octets max. |
students[].social_security |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].socio_prof |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].contract_nature |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].salary |
Non | Oui | string / decimal ; 11 caractères max. |
students[].handicap |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. ; Oui, Non |
students[].profession_single |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
students[].external_id |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].city |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].code_postal |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].street |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].country_code |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].nom_naissance |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].numero_rpps |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
students[].numero_ordinal |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
company_enrollment |
Oui | Non | object |
company_enrollment.price |
Oui | Non | string / decimal ; 11 caractères max. |
company_enrollment.bon_de_commande |
Non | Oui | string ; 16000 caractères max. ; 64000 octets max. |
company_enrollment.custom_duration_hours |
Non | Oui | string / decimal ; 11 caractères max. |
company_enrollment.custom_duration_days |
Non | Oui | string / decimal ; 11 caractères max. |
company_enrollment.price_type |
Oui | Non | string ; 13 caractères max. ; total, par_apprenant |
company_enrollment.change_address |
Non | Non | string ; 3 caractères max. ; Oui, Non ; défaut "Non" |
student_enrollment |
Non | Non | object ; défaut {} |
student_enrollment.type |
Non | Non | string ; 16000 caractères max. ; 64000 octets max. ; Salariés d’employeurs privés hors apprentis, Apprentis, Personnes en recherche d'emploi formées par votre organisme de formation, Particuliers à leurs propres frais formés par votre organisme de formation, Autres stagiaires ; défaut "Salariés d’employeurs privés hors apprentis" |
student_enrollment.subrogation |
Non | Non | string ; 16000 caractères max. ; 64000 octets max. ; yes, no ; défaut "no" |
student_enrollment.sous_traitance |
Non | Non | string ; 16000 caractères max. ; 64000 octets max. ; yes, no ; défaut "no" |
student_enrollment.sous_traite |
Non | Non | string ; 16000 caractères max. ; 64000 octets max. ; yes, no ; défaut "no" |
student_enrollment.payment_source |
Non | Non | string ; 16000 caractères max. ; 64000 octets max. ; des entreprises pour la formation de leurs salariés, des contrats d'apprentissage, des contrats de professionnalisation, de la promotion ou de la reconversion par alternance, des congés individuels de formation et des projets de transition professionnelle, du compte personnel de formation, des dispositifs spécifiques pour les personnes en recherche d'emploi, des dispositifs spécifiques pour les travailleurs non-salariés, du plan de développement des compétences ou d'autres dispositifs, de contrats conclus avec des personnes à titre individuel et à leurs frais, de contrats conclus avec d'autres organismes de formation (y compris CFA), Autres produits au titre de la formation professionnelle ; défaut "des entreprises pour la formation de leurs salariés" |
student_enrollment.code_cpf |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
student_enrollment.validity |
Non | Oui | string / date ; 10 caractères max. |
student_enrollment.diploma_number |
Non | Oui | string ; 255 caractères max. ; 1020 octets max. |
student_enrollment.custom_duration_hours |
Non | Oui | string / decimal ; 11 caractères max. |
student_enrollment.custom_duration_days |
Non | Oui | string / decimal ; 11 caractères max. |
Exemple de requête JSON
{
"course_id": "1",
"company": {
"name": "Entreprise Exemple",
"email": "office@example.com",
"address": "10 rue Exemple",
"siret": "12345678900010"
},
"students": [
{
"name": "Employee A",
"email": "shared@example.com"
},
{
"name": "Employee B",
"email": "shared@example.com"
}
],
"company_enrollment": {
"price": "900.00",
"price_type": "total"
}
}
Exemple de réponse
{
"success": true,
"request_id": "req_0123456789abcdef0123456789abcdef",
"data": {
"company_id": "301",
"company_junction_id": "501",
"course_id": "1",
"company_status": "existing",
"enrollment_status": "created",
"students": [
{
"student_id": "202",
"student_junction_id": "402",
"student_status": "created",
"enrollment_status": "created"
},
{
"student_id": "203",
"student_junction_id": "403",
"student_status": "created",
"enrollment_status": "created"
}
]
}
}
Tarification et identités des salariés
Deux salariés peuvent partager formation@example.com si leurs noms sont différents. L’exemple /enrollments/companies montre cette situation. En revanche, répéter le même email et le même nom normalisés dans students provoque 422.
Pour un total entreprise de 900 € :
{"price":"900.00","price_type":"total"}
Pour 300 € par apprenant :
{"price":"300.00","price_type":"par_apprenant"}
Ces objets sont la valeur de company_enrollment. Le montant est enregistré sur un seul niveau ; il n’est pas facturé deux fois. Des durées facultatives absentes restent non renseignées, sans être transformées en zéro.