Returns 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 discoveryref 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.
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, requestsresponse = 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 refelif 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