Body
Required
-
Identifiant unique du trajet envoyé par l'opérateur.
Minimum length is
1
, maximum length is256
. Format should match the following pattern:^[a-z0-9]{1,256}$
. -
Identifiant généré par l'opérateur pour regrouper des trajets (plusieurs passagers avec un même conducteur)
-
Tableau reprenant la liste complète des incitations appliquées (ordre d'application, montant, identifiant de l'incitateur). Si aucune incitation, envoyer un tableau vide.
Ordre par défaut
Par défaut, l'ordre d'application des politiques incitatives est le suivant :
- Territoire (AOM, Région, ...)
- Sponsors (incitations employeur, CE, etc.)
- Opérateur (opération promotionnelle, offres, etc.)
-
Plaque d'immatriculation du véhicule
-
Additional properties are NOT allowed.
-
Additional properties are NOT allowed.
-
Distance en mètres
Minimum value is
0
, maximum value is1000000
. -
Informations d'identité du conducteur
Additional properties are NOT allowed.
-
Informations d'identité du passager
Additional properties are NOT allowed.
Responses
-
OK. Le trajet a bien été enregistré.
-
Requête invalide
-
Non authentifié. Le token applicatif est manquant ou invalide.
-
Non autorisé
-
Le trajet est déjà enregistré.
-
Le payload envoyé ne respecte pas le contrat d'interface / les Conditions Générales d'Utilisation. Le trajet n'a pas été enregistré par le Registre de Preuve de Covoiturage.
curl \
--request POST 'https://api.demo.covoiturage.beta.gouv.fr/v3.2/journeys' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"operator_journey_id":"string","operator_trip_id":"string","incentives":[{"index":0,"amount":100,"siret":"11000101300017"}],"licence_plate":"string","start":{"datetime":"2021-01-01T11:00:00Z","lat":47.682821,"lon":-0.557483},"end":{"datetime":"2021-01-01T11:00:00Z","lat":47.682821,"lon":-0.557483},"distance":42.0,"driver":{"identity":{"identity_key":"string","travel_pass":{"name":"navigo","user_id":"00-MFR-6782929"},"phone":"+33601020304, +590690101010","phone_trunc":"+336010203","application_timestamp":"string","":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e"},"revenue":42.0},"passenger":{"identity":{"identity_key":"string","travel_pass":{"name":"navigo","user_id":"00-MFR-6782929"},"phone":"+33601020304, +590690101010","phone_trunc":"+336010203","application_timestamp":"string","":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e"},"payments":[{"index":0,"amount":100,"siret":"11000101300017","type":"string"}],"contribution":42.0,"seats":1}}'
{
"operator_journey_id": "string",
"operator_trip_id": "string",
"incentives": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017"
}
],
"licence_plate": "string",
"start": {
"datetime": "2021-01-01T11:00:00Z",
"lat": 47.682821,
"lon": -0.557483
},
"end": {
"datetime": "2021-01-01T11:00:00Z",
"lat": 47.682821,
"lon": -0.557483
},
"distance": 42.0,
"driver": {
"identity": {
"identity_key": "string",
"travel_pass": {
"name": "navigo",
"user_id": "00-MFR-6782929"
},
"phone": "+33601020304, +590690101010",
"phone_trunc": "+336010203",
"application_timestamp": "string",
"": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e"
},
"revenue": 42.0
},
"passenger": {
"identity": {
"identity_key": "string",
"travel_pass": {
"name": "navigo",
"user_id": "00-MFR-6782929"
},
"phone": "+33601020304, +590690101010",
"phone_trunc": "+336010203",
"application_timestamp": "string",
"": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e"
},
"payments": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017",
"type": "string"
}
],
"contribution": 42.0,
"seats": 1
}
}
{
"id": 1,
"result": {
"data": {
"created_at": "2021-01-01T00:00:00+0100",
"operator_journey_id": "cb82956e-3833-4925-9891-47d9b2ba0186"
},
"meta": null
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32602,
"data": "data/driver/identity/phone_trunc must match format \"phonetrunc\", data/driver/identity/phone_trunc must pass \"macro\" keyword validation",
"message": "Invalid params"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32501,
"data": "Unauthorized application",
"message": "Unauthorized Error"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"error": {
"code": -32503,
"data": "Invalid permissions",
"message": "Forbidden Error"
},
"jsonrpc": "2.0"
}
{
"id": 1,
"jsonrpc": "2.0",
"error": {
"data": {
"terms_violation_labels": [
"expired"
]
},
"code": -32422,
"message": "Unprocessable Request"
}
}