Skip to main content
GET
/
transactions
/
{id}
Get Transaction
curl --request GET \
  --url http://api.gu1.ai/transactions/{id} \
  --header 'Authorization: Bearer <token>'
{
  "transaction": {},
  "persisted": {},
  "baseCurrency": "<string>"
}

Overview

Returns one transaction for your organization. The response shape uses nested origin 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

MethodEndpointUse when
By IDGET /transactions/{id}You have gu1’s transaction UUID
By external IDGET /transactions/external/{externalId}You only have your own externalId from create
Both return the same JSON shape: { "transaction": { ... }, "persisted": { ... }, "baseCurrency": "..." }.

Query Parameters

includeRulesSummary
string
Optional. When omitted, behavior is unchanged (no rules summary on read).
  • full β€” Loads the latest risk_analysis_audits row for this transaction and adds persisted.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}
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}
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
The transaction must belong to the organization tied to your key. Otherwise the API responds with 404.

Response (200 OK)

transaction
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
persisted
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.
baseCurrency
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": []
}
Returned when includeRulesSummary is not full.

404 β€” Not found

{
  "error": "Transaction not found"
}
Returned when the ID does not exist or belongs to another organization.

500 β€” Server error

{
  "error": "Failed to fetch transaction",
  "details": "…"
}