Modifier un palier de majoration courte durée
curl --request PATCH \
--url https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({surchargeFactors: [{seasonSlug: 'basse', surchargePercent: 0}]})
};
fetch('https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}"
payload = { "surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'surchargeFactors' => [
[
'seasonSlug' => 'basse',
'surchargePercent' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3e5a7c9d-1b2f-4d4e-8a6c-0f2b4d6e8a1c",
"maxRentalDays": 3,
"surchargePercent": 25,
"isActive": true,
"surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
]
}
}{
"type": "https://api.lexio.rent/errors/malformed-request",
"title": "Corps de requête illisible",
"status": 400,
"code": "MALFORMED_REQUEST",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/api-key-disabled",
"title": "Clé API désactivée",
"status": 401,
"code": "API_KEY_DISABLED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/feature-not-available",
"title": "Fonctionnalité non incluse",
"status": 403,
"code": "FEATURE_NOT_AVAILABLE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"feature": "<string>"
}{
"type": "https://api.lexio.rent/errors/not-found",
"title": "Ressource introuvable",
"status": 404,
"code": "NOT_FOUND",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"resource": "RENTAL"
}{
"type": "https://api.lexio.rent/errors/idempotency-in-flight",
"title": "Requête identique en cours",
"status": 409,
"code": "IDEMPOTENCY_IN_FLIGHT",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/payload-too-large",
"title": "Corps trop volumineux",
"status": 413,
"code": "PAYLOAD_TOO_LARGE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"maxBytes": 2
}{
"type": "https://api.lexio.rent/errors/unsupported-media-type",
"title": "Type de contenu non pris en charge",
"status": 415,
"code": "UNSUPPORTED_MEDIA_TYPE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"accepted": [
"<string>"
]
}{
"type": "https://api.lexio.rent/errors/idempotency-key-reused",
"title": "Clé d’idempotence réutilisée",
"status": 422,
"code": "IDEMPOTENCY_KEY_REUSED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/rate-limited",
"title": "Trop de requêtes",
"status": 429,
"code": "RATE_LIMITED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"limit": "PRE_AUTH",
"windowSeconds": 2,
"retryAfter": 1
}{
"type": "https://api.lexio.rent/errors/internal-error",
"title": "Erreur interne",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}Tarification
Modifier un palier de majoration courte durée
Accès : pricing.write · Fonctionnalité d’abonnement : pricing.discounts (plans) · Clé partenaire : non
Modifie un palier : seuls les champs envoyés changent. La durée maxRentalDays, la création et la suppression de paliers se font dans Lexio.
surchargeFactorsliste les exceptions par saison et est remplacé en entier :[]les retire toutes, une saison absente prendsurchargePercent,0supprime la majoration pour cette saison. Saison en double → 400, saison inconnue → 422REFERENCE_NOT_FOUND.- Chaque majoration va de 0 à 100 %, 2 décimales au plus.
- Les devis futurs suivent le changement. Une location existante garde les taux figés à sa création ; si sa durée change, elle prend les taux en vigueur.
PATCH
/
short-duration-surcharges
/
{shortDurationSurchargeId}
Modifier un palier de majoration courte durée
curl --request PATCH \
--url https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({surchargeFactors: [{seasonSlug: 'basse', surchargePercent: 0}]})
};
fetch('https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}"
payload = { "surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lexio.rent/api/external/v1/short-duration-surcharges/{shortDurationSurchargeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'surchargeFactors' => [
[
'seasonSlug' => 'basse',
'surchargePercent' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3e5a7c9d-1b2f-4d4e-8a6c-0f2b4d6e8a1c",
"maxRentalDays": 3,
"surchargePercent": 25,
"isActive": true,
"surchargeFactors": [
{
"seasonSlug": "basse",
"surchargePercent": 0
}
]
}
}{
"type": "https://api.lexio.rent/errors/malformed-request",
"title": "Corps de requête illisible",
"status": 400,
"code": "MALFORMED_REQUEST",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/api-key-disabled",
"title": "Clé API désactivée",
"status": 401,
"code": "API_KEY_DISABLED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/feature-not-available",
"title": "Fonctionnalité non incluse",
"status": 403,
"code": "FEATURE_NOT_AVAILABLE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"feature": "<string>"
}{
"type": "https://api.lexio.rent/errors/not-found",
"title": "Ressource introuvable",
"status": 404,
"code": "NOT_FOUND",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"resource": "RENTAL"
}{
"type": "https://api.lexio.rent/errors/idempotency-in-flight",
"title": "Requête identique en cours",
"status": 409,
"code": "IDEMPOTENCY_IN_FLIGHT",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/payload-too-large",
"title": "Corps trop volumineux",
"status": 413,
"code": "PAYLOAD_TOO_LARGE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"maxBytes": 2
}{
"type": "https://api.lexio.rent/errors/unsupported-media-type",
"title": "Type de contenu non pris en charge",
"status": 415,
"code": "UNSUPPORTED_MEDIA_TYPE",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"accepted": [
"<string>"
]
}{
"type": "https://api.lexio.rent/errors/idempotency-key-reused",
"title": "Clé d’idempotence réutilisée",
"status": 422,
"code": "IDEMPOTENCY_KEY_REUSED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}{
"type": "https://api.lexio.rent/errors/rate-limited",
"title": "Trop de requêtes",
"status": 429,
"code": "RATE_LIMITED",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c",
"limit": "PRE_AUTH",
"windowSeconds": 2,
"retryAfter": 1
}{
"type": "https://api.lexio.rent/errors/internal-error",
"title": "Erreur interne",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "Explication lisible, propre à cette requête.",
"instance": "/api/external/v1/rentals",
"requestId": "5b0e2a1c-8f3d-4c7e-9a6b-1d2e3f4a5b6c"
}Autorisations
Clé API lck_… créée dans Lexio (Paramètres → Développeur), envoyée en Authorization: Bearer. Voir Authentification.
En-têtes
Clé unique de l’opération, réutilisée à chaque nouvel essai : un renvoi avec la même clé et le même corps renvoie la réponse initiale sans rien réécrire. Voir Idempotence.
Required string length:
1 - 255Pattern:
^[\x20-\x7E]+$Exemple:
"8b3e1d2c-4a5f-4c6b-9e7d-1f2a3b4c5d6e"
Paramètres de chemin
Corps
application/jsonapplication/merge-patch+json