Get Transaction
curl --request GET \
--url http://api.gu1.ai/transactions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/transactions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/transactions/{id}', 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 => "http://api.gu1.ai/transactions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://api.gu1.ai/transactions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.gu1.ai/transactions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/transactions/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"transaction": {},
"persisted": {},
"baseCurrency": "<string>"
}API Reference
Get Transaction
Retrieve a single transaction by internal ID or external ID β in the gu1 transaction monitoring API for fraud and AML, with examples for get use cases.
GET
/
transactions
/
{id}
Get Transaction
curl --request GET \
--url http://api.gu1.ai/transactions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/transactions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/transactions/{id}', 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 => "http://api.gu1.ai/transactions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://api.gu1.ai/transactions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.gu1.ai/transactions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/transactions/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"transaction": {},
"persisted": {},
"baseCurrency": "<string>"
}Overview
Returns one transaction for your organization. The response shape uses nestedorigin and destination objects (with resolved entity data when available). This differs from Create transaction, which uses flatter originDetails / destinationDetails on the request body.
The rules engine is not re-run on read. By default the response does not include rulesExecutionSummary. Pass includeRulesSummary=full to attach the latest persisted rules summary to the persisted object (same shape as Rules execution summary).
Endpoints
| Method | Endpoint | Use when |
|---|---|---|
| By ID | GET /transactions/{id} | You have gu1βs transaction UUID |
| By external ID | GET /transactions/external/{externalId} | You only have your own externalId from create |
{ "transaction": { ... }, "persisted": { ... }, "baseCurrency": "..." }.
Query Parameters
string
Optional. When omitted, behavior is unchanged (no rules summary on read).
fullβ Loads the latestrisk_analysis_auditsrow for this transaction and addspersisted.rulesExecutionSummary(rulesHit,rulesNoHit,actionsExecuted, scores, etc.). Does not execute rules again. Intended for single-transaction detail / debugging; omit on high-volume polling.
Get by ID
GET http://api.gu1.ai/transactions/{id}
string
required
Transaction UUID in gu1 (same as
transaction.id from create).Get by External ID
GET http://api.gu1.ai/transactions/external/{externalId}
string
required
The
externalId you sent when creating the transaction.Authentication
Requires a valid API key and permission to read transactions (transactions:read):
Authorization: Bearer YOUR_API_KEY
Response (200 OK)
object
Full transaction record.
- id (string) β gu1 transaction UUID
- externalId (string) β your external identifier
- type, status β enums (same semantics as create)
- amount (number), currency (string)
- amountInUsd (number | null) β converted amount when available
- currenciesExchange (array) β per-currency conversion entries
{ currency, exchangeRate, value } - paymentMethod (string | null)
- origin (object) β
entityId,externalId,name,country,type(person|company| null),taxId,riskScore,details(object; includes payment-related data you stored) - destination (object) β same structure as origin
- riskScore (number | null)
- lastRiskEvaluationAt (string | null) β ISO timestamp of the latest risk analysis audit for this transaction (present on GET by UUID; omitted when fetching by external ID)
- riskFactors (array) β structured reasons / matches from the last evaluation
- activeMatchesCount, shadowMatchesCount (number, optional) β when present on stored evaluation metadata
- hitRuleExternalIds (string[], optional) β external IDs of rules that matched
- flagged (boolean)
- locationDetails, deviceDetails (object)
- channel (string | null), timeZone (string | null) β IANA zone when set on create
- description, category, metadata (object)
- transactedAt, createdAt, updatedAt (ISO strings)
- exchangeRate, rateSource, rateTimestamp, convertedAt β conversion metadata when applicable
object
Flat camelCase snapshot of the row stored in
transactions (same field names as create / rules engine input): amounts, counterparties, metadata, riskFactors, etc.When includeRulesSummary=full, may also include:- rulesExecutionSummary (object) β latest persisted rules run for this transaction (not a live re-evaluation). Omitted when no audit exists or when the query param is not sent.
string
Organization base currency (ISO code, e.g.
USD), used as reference for multi-currency displays.Example (by ID, with rules summary)
curl -s 'http://api.gu1.ai/transactions/550e8400-e29b-41d4-a716-446655440000?includeRulesSummary=full' \
-H "Authorization: Bearer YOUR_API_KEY"
{
"transaction": { "...": "..." },
"persisted": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "txn_12345",
"amount": 150.5,
"currency": "USD",
"riskFactors": {},
"metadata": {},
"rulesExecutionSummary": {
"rulesHit": [],
"rulesNoHit": [],
"totalScore": 0,
"actionsExecuted": {}
}
},
"baseCurrency": "USD"
}
Example (by ID, default)
curl -s http://api.gu1.ai/transactions/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer YOUR_API_KEY"
{
"transaction": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"externalId": "txn_12345",
"type": "PAYMENT",
"status": "CREATED",
"amount": 150.5,
"currency": "USD",
"amountInUsd": 150.5,
"currenciesExchange": [],
"paymentMethod": "CARD",
"origin": {
"entityId": "β¦",
"externalId": "customer_001",
"name": "Jane Doe",
"country": "US",
"type": "person",
"taxId": null,
"riskScore": 12.5,
"details": {}
},
"destination": {
"entityId": "β¦",
"externalId": "merchant_456",
"name": "Acme Store",
"country": "US",
"type": "company",
"taxId": null,
"riskScore": 8,
"details": {}
},
"riskScore": 15,
"lastRiskEvaluationAt": "2025-01-15T10:00:00.000Z",
"riskFactors": [],
"flagged": false,
"locationDetails": {},
"deviceDetails": {},
"channel": "web_browser",
"description": "Online purchase",
"category": "retail",
"metadata": {},
"transactedAt": "2025-01-15T09:55:00.000Z",
"createdAt": "2025-01-15T09:55:01.000Z",
"updatedAt": "2025-01-15T09:55:01.000Z",
"exchangeRate": null,
"rateSource": null,
"rateTimestamp": null,
"convertedAt": null
},
"baseCurrency": "USD"
}
Error Responses
400 β Invalid query
{
"error": "Invalid query parameters",
"details": []
}
includeRulesSummary is not full.
404 β Not found
{
"error": "Transaction not found"
}
500 β Server error
{
"error": "Failed to fetch transaction",
"details": "β¦"
}
Related
Was this page helpful?