Télécharger l'avis AADL
curl --request GET \
--url https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis', 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://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <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"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyPaiement de factures
Télécharger l'avis AADL
L’avis de paiement AADL d’une transaction, au format PDF
GET
/
v3
/
bills
/
transactions
/
{transactionId}
/
avis
Télécharger l'avis AADL
curl --request GET \
--url https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis', 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://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <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"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/transactions/{transactionId}/avis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyRenvoie l’avis de paiement émis par AADL pour le dossier de logement d’une transaction
AADL. Il est disponible dès que la découverte est READY, avant et après le paiement, ce qui vous permet de montrer l’avis officiel au client avant qu’il ne paie.
La réponse de succès est le fichier PDF ; les erreurs sont l’enveloppe JSON. Non disponible en sandbox.
Paramètres de chemin
string
requis
Une transaction
AADL dont le status est READY ou ultérieur.Réponse
| En-tête | Valeur |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename="avis_{transactionId}.pdf" |
Cache-Control | private, no-store |
Exemple
curl https://api.oneclickdz.com/v3/bills/transactions/68cdf0a2b7c1e4d5f6a7b8c9/avis \
-H "X-Access-Token: YOUR_API_KEY" \
--output avis.pdf
import { writeFile } from "node:fs/promises";
const response = await fetch(
"https://api.oneclickdz.com/v3/bills/transactions/68cdf0a2b7c1e4d5f6a7b8c9/avis",
{ headers: { "X-Access-Token": process.env.ONECLICKDZ_API_KEY } },
);
if (!response.ok) {
const body = await response.json();
throw new Error(body.error.code);
}
await writeFile("avis.pdf", Buffer.from(await response.arrayBuffer()));
import os, requests
response = requests.get(
"https://api.oneclickdz.com/v3/bills/transactions/68cdf0a2b7c1e4d5f6a7b8c9/avis",
headers={"X-Access-Token": os.environ["ONECLICKDZ_API_KEY"]},
)
if not response.ok:
raise RuntimeError(response.json()["error"]["code"])
with open("avis.pdf", "wb") as f:
f.write(response.content)
<?php
$ch = curl_init("https://api.oneclickdz.com/v3/bills/transactions/68cdf0a2b7c1e4d5f6a7b8c9/avis");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Access-Token: " . getenv("ONECLICKDZ_API_KEY")],
]);
$data = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) {
throw new Exception(json_decode($data, true)["error"]["code"]);
}
file_put_contents("avis.pdf", $data);
?>
Erreurs
| HTTP | Code | Signification |
|---|---|---|
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | Clé manquante ou rejetée |
| 404 | NOT_FOUND | Transaction inconnue, ne vous appartenant pas, pas une transaction AADL, ou avis pas encore disponible |
| 503 | AUTH_UNAVAILABLE | La clé n’a pas pu être vérifiée à temps ; réessayez après Retry-After |

