Get Transaction by Reference
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_bodyBill Payment
Get Transaction by Reference
Find a transaction from your own discovery ref
GET
/
v3
/
bills
/
transactions
/
by-ref
Get Transaction by Reference
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_bodyReturns the transaction whose discovery
ref matches. Use it when a discover call timed out and you do not know whether it was created: a 404 means it was not, anything else gives you the transaction to continue from.
The response body is identical to Get Transaction by ID.
Only the discovery
ref is searchable. The ref sent to pay is not stored on the transaction.Query parameters
string
required
The
ref you sent to discover.string
Narrows the lookup to one partner. Useful if you reuse
ref values across partners.Example
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"]
}
?>
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | ERR_VALIDATION | ref missing or longer than 100 characters; unknown partner |
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | Missing or rejected key |
| 404 | NOT_FOUND | No transaction with this ref for your key in this environment |
| 503 | AUTH_UNAVAILABLE | The key could not be verified in time; retry after Retry-After |

