Découvrir les Factures
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/discover \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"partner": "<string>",
"account": {},
"ref": "<string>"
}
'import requests
url = "https://api.oneclickdz.com/v3/bills/discover"
payload = {
"partner": "<string>",
"account": {},
"ref": "<string>"
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({partner: '<string>', account: {}, ref: '<string>'})
};
fetch('https://api.oneclickdz.com/v3/bills/discover', 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/discover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner' => '<string>',
'account' => [
],
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/discover"
payload := strings.NewReader("{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.oneclickdz.com/v3/bills/discover")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/discover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactionId": "<string>",
"ref": "<string>",
"status": "<string>"
}
}Paiement de factures
Découvrir les Factures
Trouvez les factures impayées d’un compte client
POST
/
v3
/
bills
/
discover
Découvrir les Factures
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/discover \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"partner": "<string>",
"account": {},
"ref": "<string>"
}
'import requests
url = "https://api.oneclickdz.com/v3/bills/discover"
payload = {
"partner": "<string>",
"account": {},
"ref": "<string>"
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({partner: '<string>', account: {}, ref: '<string>'})
};
fetch('https://api.oneclickdz.com/v3/bills/discover', 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/discover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner' => '<string>',
'account' => [
],
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/discover"
payload := strings.NewReader("{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.oneclickdz.com/v3/bills/discover")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/discover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner\": \"<string>\",\n \"account\": {},\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactionId": "<string>",
"ref": "<string>",
"status": "<string>"
}
}Lance une découverte et renvoie immédiatement un
transactionId. Les factures arrivent sur la transaction quelques secondes plus tard : interrogez Obtenir une Transaction par ID jusqu’à ce que status soit READY.
Corps de la requête
string
requis
L’un de
ADE, SONELGAZ, SEAAL, AADL, SEOR, Algérie Télécom (orthographe exacte, avec accents).object
requis
Exactement un identifiant, au format attendu par le partenaire :
Règles complètes et exemples : Partenaires et comptes.
| Partenaire | account |
|---|---|
ADE | { "electronic_payment_key": string } — 25 caractères |
SONELGAZ | { "sonelgaz": { "invoice_number": string, "amount_without_stamp": string, "ebb_key": string } } |
SEAAL | { "seaal": { "code_client": string, "code_contrat": string } } — 2–6 caractères alphanumériques, 2–10 chiffres |
AADL | { "aadl": { "codeloc": string } } — 6–20 chiffres |
SEOR | { "seor": { "contrat": string, "facture": string } } — 1–6 chiffres (espaces ignorés), 18 lettres ou chiffres |
Algérie Télécom | { "phone_number": string } — ligne fixe, 0[2-4] puis 7 chiffres |
string
requis
Votre référence pour cette découverte, jusqu’à 100 caractères. Doit être unique parmi vos transactions pour ce partenaire ; une valeur réutilisée est refusée avec
403 DUPLICATED_REF. La transaction conserve cette ref et Obtenir une Transaction par Référence permet de la retrouver.Réponse
object
requis
Exemple
curl -X POST https://api.oneclickdz.com/v3/bills/discover \
-H "X-Access-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"partner": "SEAAL",
"account": { "seaal": { "code_client": "100001", "code_contrat": "446563" } },
"ref": "disc-20260920-0003"
}'
const response = await fetch("https://api.oneclickdz.com/v3/bills/discover", {
method: "POST",
headers: {
"X-Access-Token": process.env.ONECLICKDZ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
partner: "SEAAL",
account: { seaal: { code_client: "100001", code_contrat: "446563" } },
ref: "disc-20260920-0003",
}),
});
const body = await response.json();
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`);
const { transactionId } = body.data;
import os, requests
response = requests.post(
"https://api.oneclickdz.com/v3/bills/discover",
headers={"X-Access-Token": os.environ["ONECLICKDZ_API_KEY"]},
json={
"partner": "SEAAL",
"account": {"seaal": {"code_client": "100001", "code_contrat": "446563"}},
"ref": "disc-20260920-0003",
},
)
body = response.json()
if not body["success"]:
raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]}')
transaction_id = body["data"]["transactionId"]
<?php
$ch = curl_init("https://api.oneclickdz.com/v3/bills/discover");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: " . getenv("ONECLICKDZ_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"partner" => "SEAAL",
"account" => ["seaal" => ["code_client" => "100001", "code_contrat" => "446563"]],
"ref" => "disc-20260920-0003",
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body["success"]) {
throw new Exception($body["error"]["code"] . ": " . $body["error"]["message"]);
}
$transactionId = $body["data"]["transactionId"];
?>
Réponse
{
"success": true,
"data": {
"transactionId": "68cdf0a2b7c1e4d5f6a7b8c9",
"ref": "disc-20260920-0003",
"status": "PENDING"
},
"meta": { "timestamp": "2026-09-20T10:15:32.194Z" },
"requestId": "req_9f3a1c72e0b84d51aB3xZq07"
}
Erreurs
Renvoyées immédiatement ; aucune transaction n’est créée.| HTTP | Code | Signification |
|---|---|---|
| 400 | ERR_VALIDATION | partner, account ou ref invalide ; details liste chaque problème |
| 400 | INVALID_ACCOUNT | Sandbox uniquement : les comptes de test invalides répondent immédiatement. En production, un identifiant rejeté apparaît sur la transaction |
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | Clé manquante ou rejetée |
| 403 | DUPLICATED_REF | ref déjà utilisée pour ce partenaire |
| 409 | BILL_ALREADY_PAID | Un paiement pour ce compte ou cette facture a déjà réussi via cette API |
| 409 | PAYMENT_IN_PROGRESS | Un paiement pour ce compte est en cours |
| 503 | PARTNER_UNAVAILABLE | Le facturier est indisponible ou désactivé |
| 503 | AUTH_UNAVAILABLE | La clé n’a pas pu être vérifiée à temps ; réessayez après Retry-After |
Résultat de la découverte
Lisez-le sur la transaction :status | Signification |
|---|---|
READY | bills[] liste les factures impayées ; un tableau vide signifie que rien n’est dû |
FAILED | error.code vaut INVALID_ACCOUNT, BILL_ALREADY_PAID, PARTNER_UNAVAILABLE ou, pour tout autre rejet par le portail du facturier, PAYMENT_DECLINED |

