Update Transaction
API Reference
Update Transaction
Partially update a transaction — merge metadata or deviceDetails, change channel or reason — without replacing the full record.
PATCH
Update Transaction
Documentation Index
Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Use this endpoint when you need to enrich or correct an existing transaction after creation: custom metadata, deviceDetails, channel, or reason. It does not change amount, status, parties, or other core fields (use Change status for status).Shallow merge for
metadata and deviceDetails: only keys you send are overwritten; omitted keys are preserved. Nested objects (e.g. metadata.tags) are replaced as a whole when you send that key. To clear channel, send "channel": null.Endpoints
| Method | Endpoint | Use when |
|---|---|---|
| By ID | PATCH /transactions/{id} | You have gu1’s transaction UUID |
| By external ID | PATCH /transactions/external/{externalId} | You only have your externalId from create |
Authentication
Requirestransactions:edit (API key or session with equivalent permission):
Query parameters
When
true, re-runs KYT rules with trigger transaction_updated after the patch (same mode as status change). Default: false.Request body
At least one field is required.Shallow merge into existing
metadata. Example: existing { "purpose": "payroll", "tags": { "a": 1 } } + body { "tags": { "b": 2 } } → { "purpose": "payroll", "tags": { "b": 2 } } (top-level tags is replaced as a whole).Shallow merge into existing
deviceDetails (stored in device_details). Use this to add or correct device context after create — e.g. ipAddress, deviceId, osName, manufacturer, model, fraud flags (isVpn, isEmulator, …). Same field schema as Create transaction (deviceDetails). Rules evaluate paths like deviceDetails.ipAddress.Transaction channel (max 50 chars), e.g.
web, mobile, api. Send null to clear.Outcome / decline reason enum. See Reason enum.
Example
Response (200 OK)
executeRules=true, rulesExecutionSummary is included (same shape as create / change status).
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid body or no effective change |
| 400 | NO_CHANGES | Values match what is already stored |
| 404 | NOT_FOUND | Transaction not in your organization |
| 403 | — | Missing transactions:edit |
Side effects
- Audit:
transaction_updatedevent on the transaction timeline with changed fields (metadata,deviceDetails,channel, and/orreasoninchanges). - Webhook:
transaction.updated(includeschangesand currentdeviceDetailswhen applicable). - Rules: only when
executeRules=true.
Examples
Related
Get transaction
Read full transaction after update
Change status
Update lifecycle status and re-run rules
Create transaction
Initial metadata on create
Reason enum
Allowed
reason values