Download AADL Avis
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_body{
"Content-Type": {},
"Content-Disposition": {},
"Content-Length": {},
"Cache-Control": {}
}Bill Payment
Download AADL Avis
Download AADL’s official avis de paiement for one of your own transactions
GET
/
v3
/
bills
/
transactions
/
{transactionId}
/
avis
Download AADL Avis
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_body{
"Content-Type": {},
"Content-Disposition": {},
"Content-Length": {},
"Cache-Control": {}
}Overview
Streams the avis de paiementAADL publishes for a housing file — the same PDF the tenant would download from the biller — for a transaction you own. Like Download Receipt, it does not return the JSON envelope on success: the bytes are the body, so you can stream them straight to your own customer.
It is not the receipt. The receipt is proof that your payment went through; the avis is AADL’s own statement of what the housing file owes. Only AADL publishes one.
The avis is addressed by transaction, never by housing file. There is no
codeloc in this request and none is accepted. We load the transaction, confirm it is yours in this environment, refuse it if its partner is not AADL, and read the housing file from the bill already stored on it.That is deliberate. AADL’s own export page needs no session and answers with a PDF for any code, whether or not it exists — proxying a caller-supplied one would turn this endpoint into a way to enumerate other people’s housing files. Resolving it from your own transaction makes that impossible.Path Parameters
string
required
The transaction identifier. A 24-character lowercase hexadecimal string, from Get Transaction by ID or from any list, belonging to an
AADL transaction of yours.Unlike the receipt, the transaction does not have to be SUCCESS: any of your AADL transactions that has resolved a bill can produce an avis.Response
On success the body is the PDF itself. Read the headers to know what you received.header
required
application/pdf.header
required
attachment; filename="avis_<transactionId>.pdf". The name is built from the transaction identifier alone, so it carries no tenant identity.header
required
The size of the file in bytes.
header
required
private, no-store. AADL regenerates the avis on demand and replaces it every period, so there is nothing stable to cache — and it is one customer’s document, never a shared one.Examples
# -J -O writes the file under the name the server suggests
curl https://api.oneclickdz.com/v3/bills/transactions/68b2f4c1a7d3e9f204c81a55/avis \
-H "X-Access-Token: YOUR_API_KEY" \
--fail \
--remote-header-name --remote-name
import { writeFile } from "node:fs/promises";
const transactionId = "68b2f4c1a7d3e9f204c81a55";
const response = await fetch(
`https://api.oneclickdz.com/v3/bills/transactions/${transactionId}/avis`,
{ headers: { "X-Access-Token": process.env.ONECLICKDZ_API_KEY } },
);
if (!response.ok) {
const error = await response.json();
throw new Error(`${error.error.code}: ${error.error.message}`);
}
const bytes = Buffer.from(await response.arrayBuffer());
await writeFile(`avis-${transactionId}.pdf`, bytes);
console.log(bytes.length);
import os
import requests
transaction_id = '68b2f4c1a7d3e9f204c81a55'
response = requests.get(
f'https://api.oneclickdz.com/v3/bills/transactions/{transaction_id}/avis',
headers={'X-Access-Token': os.getenv('ONECLICKDZ_API_KEY')}
)
if response.status_code != 200:
error = response.json()
raise RuntimeError(f"{error['error']['code']}: {error['error']['message']}")
with open(f'avis-{transaction_id}.pdf', 'wb') as handle:
handle.write(response.content)
print(len(response.content))
<?php
$transactionId = '68b2f4c1a7d3e9f204c81a55';
$ch = curl_init("https://api.oneclickdz.com/v3/bills/transactions/$transactionId/avis");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Access-Token: ' . getenv('ONECLICKDZ_API_KEY')
]);
$bytes = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) {
$error = json_decode($bytes, true);
throw new Exception($error['error']['code'] . ': ' . $error['error']['message']);
}
file_put_contents("avis-$transactionId.pdf", $bytes);
echo strlen($bytes);
?>
Success Response
The body is binary. The headers look like this:HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 71204
Content-Disposition: attachment; filename="avis_68b2f4c1a7d3e9f204c81a55.pdf"
Cache-Control: private, no-store
Error Responses
Errors are returned as JSON, in the same envelope as every other endpoint.401 — Missing or invalid access token
401 — Missing or invalid access token
The key was absent or rejected.What to do: verify the key against the Authentication guide.
{
"success": false,
"error": {
"code": "INVALID_ACCESS_TOKEN",
"message": "The provided access token is invalid."
},
"requestId": "req_9f3a1c72e0b84d51aB3xZq07"
}
404 — Transaction not found
404 — Transaction not found
The identifier is unknown, or the transaction is not yours in this environment.A sandbox key never sees a production transaction, and neither sees another key’s. The answer is the same in every case, so the endpoint never confirms that somebody else’s transaction exists.What to do: check the identifier, and check you are using the key the transaction was created with.
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Transaction not found."
},
"requestId": "req_9f3a1c72e0b84d51aB3xZq07"
}
404 — Not an AADL transaction
404 — Not an AADL transaction
The transaction is yours, but its partner does not publish an avis.What to do: read
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "This partner does not publish a downloadable avis."
},
"requestId": "req_9f3a1c72e0b84d51aB3xZq07"
}
partner on the transaction first and only offer the download when it is AADL. For every other biller, the receipt is the document you want.404 — No avis available yet
404 — No avis available yet
No housing file has been resolved on this transaction, or AADL declined to produce the document.A discovery that has not reached
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "No avis is available for this transaction yet."
},
"requestId": "req_9f3a1c72e0b84d51aB3xZq07"
}
READY has no bill on it yet, so there is nothing to resolve a housing file from.What to do: wait for the transaction to carry a bill, then try again. A refusal from the biller is worth one retry, not a loop.What the avis is for
Showing the customer what they owe
The avis carries AADL’s own breakdown of the housing file. It is the document a tenant recognises.
Not a substitute for the receipt
Only the receipt proves a payment went through. Store that one against your order.
Remember that an AADL housing file has exactly one open avis, with any arrears folded into its total — so this PDF is the whole of what the file owes, never one period out of several. See Partners and Accounts.
Best Practices
Check the partner first
Offer the download only for
AADL transactions. Every other partner answers 404 NOT_FOUND.Never expose the URL
This URL needs your API key. Serve the bytes from your own system, behind your own authentication.
Fetch it fresh
no-store is not decoration — AADL replaces the avis every period. Download it when you need it.Never send a codeloc
There is no identifier parameter to guess. If your code builds one, it is calling the wrong thing.
Related Endpoints
Download Receipt
Proof of a successful payment
Get Transaction by ID
Where
partner and the bills appearDiscover Bills
How an AADL housing file is looked up
Partners and Accounts
The AADL identifier rules

