curl --request POST \
--url https://sandbox.myexpressdriver.com/v1/transports/{id}/options \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"option_key": "<string>",
"leg": "aller",
"params": {
"renter": "<string>",
"link": "<string>",
"pin": "<string>",
"comment": "<string>",
"accessories": [
{
"id": "<string>",
"name": "<string>"
}
],
"pending_documents": [
"<string>"
]
}
}
'import requests
url = "https://sandbox.myexpressdriver.com/v1/transports/{id}/options"
payload = {
"option_key": "<string>",
"leg": "aller",
"params": {
"renter": "<string>",
"link": "<string>",
"pin": "<string>",
"comment": "<string>",
"accessories": [
{
"id": "<string>",
"name": "<string>"
}
],
"pending_documents": ["<string>"]
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
option_key: '<string>',
leg: 'aller',
params: {
renter: '<string>',
link: '<string>',
pin: '<string>',
comment: '<string>',
accessories: [{id: '<string>', name: '<string>'}],
pending_documents: ['<string>']
}
})
};
fetch('https://sandbox.myexpressdriver.com/v1/transports/{id}/options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.myexpressdriver.com/v1/transports/{id}/options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'option_key' => '<string>',
'leg' => 'aller',
'params' => [
'renter' => '<string>',
'link' => '<string>',
'pin' => '<string>',
'comment' => '<string>',
'accessories' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'pending_documents' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.myexpressdriver.com/v1/transports/{id}/options"
payload := strings.NewReader("{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.myexpressdriver.com/v1/transports/{id}/options")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.myexpressdriver.com/v1/transports/{id}/options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"option": "<string>",
"new_price": 123,
"delta": 123,
"leg": "aller",
"removed": [
"<string>"
],
"derived": [
"<string>"
],
"warnings": [
"<string>"
],
"driver_validation": {
"mode": "ask",
"requested": true,
"client_update_id": "<string>"
}
}Ajouter une option
Ajoute une option à la mission et recalcule le prix. Émet transport.price_adjusted.
curl --request POST \
--url https://sandbox.myexpressdriver.com/v1/transports/{id}/options \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"option_key": "<string>",
"leg": "aller",
"params": {
"renter": "<string>",
"link": "<string>",
"pin": "<string>",
"comment": "<string>",
"accessories": [
{
"id": "<string>",
"name": "<string>"
}
],
"pending_documents": [
"<string>"
]
}
}
'import requests
url = "https://sandbox.myexpressdriver.com/v1/transports/{id}/options"
payload = {
"option_key": "<string>",
"leg": "aller",
"params": {
"renter": "<string>",
"link": "<string>",
"pin": "<string>",
"comment": "<string>",
"accessories": [
{
"id": "<string>",
"name": "<string>"
}
],
"pending_documents": ["<string>"]
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
option_key: '<string>',
leg: 'aller',
params: {
renter: '<string>',
link: '<string>',
pin: '<string>',
comment: '<string>',
accessories: [{id: '<string>', name: '<string>'}],
pending_documents: ['<string>']
}
})
};
fetch('https://sandbox.myexpressdriver.com/v1/transports/{id}/options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.myexpressdriver.com/v1/transports/{id}/options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'option_key' => '<string>',
'leg' => 'aller',
'params' => [
'renter' => '<string>',
'link' => '<string>',
'pin' => '<string>',
'comment' => '<string>',
'accessories' => [
[
'id' => '<string>',
'name' => '<string>'
]
],
'pending_documents' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.myexpressdriver.com/v1/transports/{id}/options"
payload := strings.NewReader("{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.myexpressdriver.com/v1/transports/{id}/options")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.myexpressdriver.com/v1/transports/{id}/options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"option_key\": \"<string>\",\n \"leg\": \"aller\",\n \"params\": {\n \"renter\": \"<string>\",\n \"link\": \"<string>\",\n \"pin\": \"<string>\",\n \"comment\": \"<string>\",\n \"accessories\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"pending_documents\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"option": "<string>",
"new_price": 123,
"delta": 123,
"leg": "aller",
"removed": [
"<string>"
],
"derived": [
"<string>"
],
"warnings": [
"<string>"
],
"driver_validation": {
"mode": "ask",
"requested": true,
"client_update_id": "<string>"
}
}Autorisations
Clé API liée à un groupe (med_live_… en production, med_test_… en test).
Fournie en clair une seule fois à la création depuis le profil client.
En-têtes
Clé d'idempotence fournie par le client (un UUID v4 par opération), conservée
24 h. Recommandée sur toutes les créations. Rejouer la même clé avec un
corps identique sur la même route renvoie la réponse en cache
(Idempotent-Replayed: true). L'empreinte couvre la méthode, le chemin
(donc la mission visée) et le corps : la même clé pour une autre requête
renvoie 409 idempotency_key_reused. Requête identique encore en
traitement : 409 request_in_progress avec Retry-After.
Les réponses 5xx, 404 et 422 documents_failed ne sont pas mémorisées :
un nouvel essai avec la même clé et le même corps est retraité.
Après un 502 (code: relay_timeout), une erreur réseau ou un 5xx,
réessayez avec la même clé et le même corps : la requête est
relancée, et une mission créée malgré l'erreur vous est renvoyée (201,
Idempotent-Replayed: true) au lieu d'être créée une seconde fois.
Exception : si la réponse porte outcome_unknown: true, ne réessayez pas,
vérifiez d'abord (GET /transports). Seuls la création de mission et le
dépôt de documents sont dédoublonnés ainsi ; sans clé, un nouvel essai peut
créer un doublon.
"1f3c2b7a-9d4e-4a1b-8c2f-0e6d5a4b3c2d"
Paramètres de chemin
Identifiant de la mission (offer_id).
Corps
Clé de l'option (key de GET /options, ex. PV_DEMATERIALISE, Booster).
Le prix est celui de votre grille, jamais fourni par l'appelant.
Jambe visée.
aller, retour Obligations de l'option (cf. requirements de GET /options). Ignoré pour
une option sans obligation.
Show child attributes
Show child attributes
Réponse
Option ajoutée, prix recalculé.
Clé posée sur la mission ({nom} - {prix}), au prix de votre grille.
aller, retour Options retirées par exclusion (variante de même nom, autre type de PV).
Champs de la mission mis à jour par l'option (ex. metadata/type_doc, renter, lien_pv_demat, wgarage).
Sort du convoyeur attribué après la modification (#1725).
Dès qu'un convoyeur est attribué et que la mission n'est pas encore
partie, toute modification faite avec une clé partenaire lui demande de
valider les nouvelles modalités (mode: ask). Il reçoit une
notification et doit accepter ou refuser depuis l'application MED.
En cas de refus, le convoyeur est retiré de la mission, qui repart
en ligne : prévoyez ce cas dans votre intégration, en écoutant
l'événement transport.driver_validation_requested puis le statut de la
mission. Sans réponse après trois relances, le convoyeur est également
retiré.
mode: none signifie qu'il n'y avait personne à solliciter (mission non
attribuée, ou déjà enlevée).
Show child attributes
Show child attributes
