Body Required
-
operator_class Required
classe de preuve correspondant aux spécifications définies dans Classes de preuve de covoiturage.
Values are
A
,B
, orC
. -
Position lat/lon + date du passager
Additional properties are NOT allowed.
-
Position lat/lon + date du passager
Additional properties are NOT allowed.
-
Distance exprimée en mètre
Minimum value is
0
, maximum value is1000000
. -
Additional properties are NOT allowed.
-
Additional properties are NOT allowed.
Responses
-
200 application/json
L'API retourne un objet avec les incitations sur le trajet soumis. Attention, ce calcul n'est pas définitif en raison des seuils qui peuvent s'appliquer sur une campagne. Par exemple, une campagne limitant le nombre de trajets par jour à X. C'est donc un résultat provisoire - sans valeur contractuelle - qui est retourné.
POST
/policies/simulate
curl \
-X POST http://api.example.com/policies/simulate \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"operator_class":"A","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, +5906901010","driving_license":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e","over_18":true},"revenue":42.0},"passenger":{"identity":{"identity_key":"string","travel_pass":{"name":"navigo","user_id":"00-MFR-6782929"},"phone":"+33601020304, +590690101010","phone_trunc":"+336010203, +5906901010","driving_license":"051227308989","operator_user_id":"d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e","over_18":true},"payments":[{"index":0,"amount":100,"siret":"11000101300017","type":"string"}],"contribution":42.0,"seats":1}}'
Request examples
{
"operator_class": "A",
"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, +5906901010",
"driving_license": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e",
"over_18": true
},
"revenue": 42.0
},
"passenger": {
"identity": {
"identity_key": "string",
"travel_pass": {
"name": "navigo",
"user_id": "00-MFR-6782929"
},
"phone": "+33601020304, +590690101010",
"phone_trunc": "+336010203, +5906901010",
"driving_license": "051227308989",
"operator_user_id": "d2e8a6c4-9e3a-4b6f-8e8d-9f7a6b5c4d3e",
"over_18": true
},
"payments": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017",
"type": "string"
}
],
"contribution": 42.0,
"seats": 1
}
}
Response examples (200)
{
"incentives": [
{
"index": 0,
"amount": 100,
"siret": "11000101300017"
}
]
}