curl --request DELETE \
--url https://api.lexio.rent/api/external/v1/rentals/{rentalId} \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'DELETE',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.lexio.rent/api/external/v1/rentals/{rentalId}', 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/rentals/{rentalId}"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lexio.rent/api/external/v1/rentals/{rentalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"type": "https://api.lexio.rent/errors/validation-failed",
"title": "Requête invalide",
"status": 400,
"code": "VALIDATION_FAILED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "required",
"detail": "<string>"
}
]
}{
"type": "https://api.lexio.rent/errors/api-key-disabled",
"title": "Clé API désactivée",
"status": 401,
"code": "API_KEY_DISABLED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/feature-not-available",
"title": "Fonctionnalité non incluse",
"status": 403,
"code": "FEATURE_NOT_AVAILABLE",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"feature": "<string>"
}{
"type": "https://api.lexio.rent/errors/not-found",
"title": "Ressource introuvable",
"status": 404,
"code": "NOT_FOUND",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"resource": "RENTAL"
}{
"type": "https://api.lexio.rent/errors/idempotency-in-flight",
"title": "Requête identique en cours",
"status": 409,
"code": "IDEMPOTENCY_IN_FLIGHT",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/idempotency-key-reused",
"title": "Clé d’idempotence réutilisée",
"status": 422,
"code": "IDEMPOTENCY_KEY_REUSED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/rate-limited",
"title": "Trop de requêtes",
"status": 429,
"code": "RATE_LIMITED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"limit": "PRE_AUTH",
"windowSeconds": 2,
"retryAfter": 1
}{
"type": "https://api.lexio.rent/errors/internal-error",
"title": "Erreur interne",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/service-unavailable",
"title": "Service momentanément indisponible",
"status": 503,
"code": "SERVICE_UNAVAILABLE",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"dependency": "PAYMENT_PROVIDER"
}Supprimer une location
Accès : rentals.delete
Supprime définitivement une location RESERVED ou CANCELLED (204). Clé interne seulement (sinon INSUFFICIENT_SCOPE). Préférez cancel, qui garde l’historique.
Refus
RENTAL_STATUS_NOT_ALLOWED(action: DELETE) : autre statut, revérifié à l’écriture. Une demandePENDING_APPROVALse refuse par annulation.RESOURCE_IN_USE: rien n’est supprimé ;blockersliste toutes les causes :INVOICES(facture émise, même remboursée),PAYMENTS_HELD(net encaissé hors caution ;count= paiements et remboursements validés),DEPOSITS_HELD(caution encaissée, hors empreinte),INCIDENTS,FINALIZED_ACCOUNTING_INVOICES(facture finalisée en comptabilité).SERVICE_UNAVAILABLE(dependency: ACCOUNTING) : vérification comptable indisponible, à rejouer.
Rejeu, même Idempotency-Key : 204 ; autre clé : 404.
Effets : numéro jamais réattribué, code promo rendu, événement rental.deleted ; fichiers et brouillons comptables purgés ensuite.
curl --request DELETE \
--url https://api.lexio.rent/api/external/v1/rentals/{rentalId} \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'DELETE',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.lexio.rent/api/external/v1/rentals/{rentalId}', 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/rentals/{rentalId}"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lexio.rent/api/external/v1/rentals/{rentalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"type": "https://api.lexio.rent/errors/validation-failed",
"title": "Requête invalide",
"status": 400,
"code": "VALIDATION_FAILED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"pointer": "<string>",
"code": "required",
"detail": "<string>"
}
]
}{
"type": "https://api.lexio.rent/errors/api-key-disabled",
"title": "Clé API désactivée",
"status": 401,
"code": "API_KEY_DISABLED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/feature-not-available",
"title": "Fonctionnalité non incluse",
"status": 403,
"code": "FEATURE_NOT_AVAILABLE",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"feature": "<string>"
}{
"type": "https://api.lexio.rent/errors/not-found",
"title": "Ressource introuvable",
"status": 404,
"code": "NOT_FOUND",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"resource": "RENTAL"
}{
"type": "https://api.lexio.rent/errors/idempotency-in-flight",
"title": "Requête identique en cours",
"status": 409,
"code": "IDEMPOTENCY_IN_FLIGHT",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/idempotency-key-reused",
"title": "Clé d’idempotence réutilisée",
"status": 422,
"code": "IDEMPOTENCY_KEY_REUSED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/rate-limited",
"title": "Trop de requêtes",
"status": 429,
"code": "RATE_LIMITED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"limit": "PRE_AUTH",
"windowSeconds": 2,
"retryAfter": 1
}{
"type": "https://api.lexio.rent/errors/internal-error",
"title": "Erreur interne",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>"
}{
"type": "https://api.lexio.rent/errors/service-unavailable",
"title": "Service momentanément indisponible",
"status": 503,
"code": "SERVICE_UNAVAILABLE",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"dependency": "PAYMENT_PROVIDER"
}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 rejeu avec la même clé et le même corps renvoie la réponse initiale sans rien réécrire. Voir Idempotence. Facultative avec ?dryRun=true sur les opérations qui l’acceptent.
1 - 255^[\x20-\x7E]+$"8b3e1d2c-4a5f-4c6b-9e7d-1f2a3b4c5d6e"
Paramètres de chemin
Identifiant de la location.
"9c2d7e4a-5b1f-4d3c-8a6e-0f1b2c3d4e5f"
Réponse
Supprimé, sans corps.