curl --request DELETE \
--url https://api.lexio.rent/api/external/v1/rentals/{rentalId}/payments/{paymentId} \
--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}/payments/{paymentId}', 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}/payments/{paymentId}"
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}/payments/{paymentId}",
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-already-applied",
"title": "Écriture déjà appliquée",
"status": 409,
"code": "IDEMPOTENCY_ALREADY_APPLIED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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 un paiement saisi par erreur
Accès : payments.refund
Corrige une saisie erronée : la transaction est supprimée, rien n’est émis. Admis sur une location RESERVED, IN_PROGRESS ou COMPLETED, sinon 409 RENTAL_STATUS_NOT_ALLOWED.
Refus
- Paiement inconnu ou d’une autre location → 404 (
resource: PAYMENT). - Paiement validé encaissé par Stripe (
stripePaymentIntentId) → 409PAYMENT_PROVIDER_MANAGED: il se rembourse chez Stripe ; Lexio l’enregistre à réception de l’événement Stripe, sauf si l’équipe du loueur l’a déjà saisi à la main. - 409
INVOICE_FINALIZED: facture finalisée en comptabilité, paiement rattaché à une facture émise ou couvrant une facture émise historique (enregistrez alors unREFUND, qui émet un avoir), ou remboursement validé alors qu’un avoir de remboursement existe sur la location. - Prélèvement SEPA en cours de règlement → 409
SEPA_DEBIT_PENDING. - État comptable illisible → 503
SERVICE_UNAVAILABLE(dependency: ACCOUNTING), à rejouer.
Effets : statut de paiement recalculé, reçus régénérés (supprimés s’il ne reste rien), factures brouillon mises à jour.
curl --request DELETE \
--url https://api.lexio.rent/api/external/v1/rentals/{rentalId}/payments/{paymentId} \
--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}/payments/{paymentId}', 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}/payments/{paymentId}"
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}/payments/{paymentId}",
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-already-applied",
"title": "Écriture déjà appliquée",
"status": 409,
"code": "IDEMPOTENCY_ALREADY_APPLIED",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"resourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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"
Identifiant du paiement.
"e8a1b2c3-d4e5-4f60-9a7b-8c9d0e1f2a3b"
Réponse
Supprimé, sans corps.