Obtenir une Transaction par Référence
curl --request GET \
--url https://api.oneclickdz.com/v3/bills/transactions/by-ref \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/transactions/by-ref"
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/by-ref', 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/by-ref",
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/by-ref"
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/by-ref")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/transactions/by-ref")
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
Obtenir une Transaction par Référence
Retrouvez une transaction à partir de votre ref de découverte
GET
/
v3
/
bills
/
transactions
/
by-ref
Obtenir une Transaction par Référence
curl --request GET \
--url https://api.oneclickdz.com/v3/bills/transactions/by-ref \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/transactions/by-ref"
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/by-ref', 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/by-ref",
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/by-ref"
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/by-ref")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/transactions/by-ref")
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 la transaction dont la
ref de découverte correspond. Utilisez-le lorsqu’un appel discover a expiré et que vous ne savez pas s’il a été créé : une 404 signifie que non, tout autre résultat vous donne la transaction à partir de laquelle reprendre.
Le corps de la réponse est identique à celui de Obtenir une Transaction par ID.
Seule la
ref de découverte est recherchable. La ref envoyée à pay n’est pas enregistrée sur la transaction.Paramètres de requête
string
requis
La
ref que vous avez envoyée à discover.string
Restreint la recherche à un partenaire. Utile si vous réutilisez des valeurs de
ref entre partenaires.Exemple
curl "https://api.oneclickdz.com/v3/bills/transactions/by-ref?ref=disc-20260920-0003" \
-H "X-Access-Token: YOUR_API_KEY"
const url = new URL("https://api.oneclickdz.com/v3/bills/transactions/by-ref");
url.searchParams.set("ref", "disc-20260920-0003");
const response = await fetch(url, {
headers: { "X-Access-Token": process.env.ONECLICKDZ_API_KEY },
});
const body = await response.json();
if (response.status === 404) {
// the discovery was never created — safe to send it again with the same ref
} else if (!body.success) {
throw new Error(body.error.code);
} else {
const txn = body.data; // continue from txn.status
}
import os, requests
response = requests.get(
"https://api.oneclickdz.com/v3/bills/transactions/by-ref",
params={"ref": "disc-20260920-0003"},
headers={"X-Access-Token": os.environ["ONECLICKDZ_API_KEY"]},
)
body = response.json()
if response.status_code == 404:
pass # the discovery was never created — safe to send it again with the same ref
elif not body["success"]:
raise RuntimeError(body["error"]["code"])
else:
txn = body["data"] # continue from txn["status"]
<?php
$url = "https://api.oneclickdz.com/v3/bills/transactions/by-ref?" . http_build_query(["ref" => "disc-20260920-0003"]);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Access-Token: " . getenv("ONECLICKDZ_API_KEY")],
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$body = json_decode($raw, true);
if ($status === 404) {
// the discovery was never created — safe to send it again with the same ref
} elseif (!$body["success"]) {
throw new Exception($body["error"]["code"]);
} else {
$txn = $body["data"]; // continue from $txn["status"]
}
?>
Erreurs
| HTTP | Code | Signification |
|---|---|---|
| 400 | ERR_VALIDATION | ref manquante ou de plus de 100 caractères ; partner inconnu |
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | Clé manquante ou rejetée |
| 404 | NOT_FOUND | Aucune transaction avec cette ref pour votre clé dans cet environnement |
| 503 | AUTH_UNAVAILABLE | La clé n’a pas pu être vérifiée à temps ; réessayez après Retry-After |

