curl --request POST \
--url https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"new_price": 123,
"motif": "<string>",
"leg": "aller"
}
'import requests
url = "https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments"
payload = {
"new_price": 123,
"motif": "<string>",
"leg": "aller"
}
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({new_price: 123, motif: '<string>', leg: 'aller'})
};
fetch('https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments', 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}/price-adjustments",
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([
'new_price' => 123,
'motif' => '<string>',
'leg' => 'aller'
]),
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}/price-adjustments"
payload := strings.NewReader("{\n \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\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}/price-adjustments")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments")
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 \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"leg": "aller",
"old_price_ht": 123,
"new_price_ht": 123,
"currency": "<string>"
}Refacturation (changement de prix)
Modifie le prix HT facturé au client pour une jambe (leg : aller par
défaut, ou retour). Trace l’historique (GET /transports/{id}/price-history).
Émet transport.price_adjusted.
Refusé si la jambe visée est déjà payée ou facturée (409,
code: leg_invoiced). Pour un aller-retour facturé en une seule fois,
la facture couvre les deux jambes : le retour est alors considéré comme
facturé lui aussi. Sur une mission sans retour, leg: retour est refusé
(422, code: no_return_leg).
curl --request POST \
--url https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"new_price": 123,
"motif": "<string>",
"leg": "aller"
}
'import requests
url = "https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments"
payload = {
"new_price": 123,
"motif": "<string>",
"leg": "aller"
}
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({new_price: 123, motif: '<string>', leg: 'aller'})
};
fetch('https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments', 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}/price-adjustments",
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([
'new_price' => 123,
'motif' => '<string>',
'leg' => 'aller'
]),
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}/price-adjustments"
payload := strings.NewReader("{\n \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\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}/price-adjustments")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.myexpressdriver.com/v1/transports/{id}/price-adjustments")
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 \"new_price\": 123,\n \"motif\": \"<string>\",\n \"leg\": \"aller\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"leg": "aller",
"old_price_ht": 123,
"new_price_ht": 123,
"currency": "<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
Nouveau prix HT facturé au client. Requis.
Motif obligatoire de la refacturation.
Jambe refacturée. Toute autre valeur renvoie 422 ; retour sur une mission sans trajet retour renvoie 422 (code: no_return_leg).
aller, retour 