Create Transaction
API Reference
Create Transaction
Create a new financial transaction for monitoring and analysis β in the gu1 transaction monitoring API for fraud and AML, with examples for create use cases.
POST
Create 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
Creates a new transaction. WithexecuteRules: true (default), the rules engine runs and the response includes rulesExecutionSummary at the root when rules execute.
Endpoint
Authentication
Requires a valid API key in the Authorization header:Request Body
Required Fields
Your unique identifier for this transaction in your system
Type of transaction. Options:
PAYMENT- Payment transactionTRANSFER- Money transferWITHDRAWAL- Cash withdrawalDEPOSIT- Cash or check depositREFUND- Refund transactionCHARGEBACK- ChargebackREVERSAL- Transaction reversalFEE- Service feeADJUSTMENT- Balance adjustmentOTHER- Other transaction type
Transaction amount (must be zero or positive)
Currency code (3-4 characters, e.g., βUSDβ, βEURβ, βBRLβ)
Optional Fields
Transaction status. Options:
CREATED- Transaction created (default)PROCESSING- Being processedSUSPENDED- Suspended for reviewSENT- Successfully sentEXPIRED- Transaction expiredDECLINED- Declined/rejectedREFUNDED- RefundedSUCCESSFUL- Completed successfully
Payment method used. Options:
CARD- Credit/debit cardACH- ACH transferPIX- Brazilian PIXTED- Brazilian TEDBOLETO- Brazilian BoletoWALLET- Digital walletSWIFT- SWIFT transferIBAN- IBAN transferCBU- Argentine CBUCVU- Argentine CVUDEBIN- Argentine DEBINGENERIC_BANK_ACCOUNT- Generic bank accountMPESA- M-PesaUPI- UPI (India)CHECK- Check paymentECHECK- Electronic checkQR_CODE- QR code paymentONLINE_PAYMENT- Online paymentWITHDRAWAL_ORDER- Withdrawal order
Transaction description or notes
Transaction category for classification
ISO 8601 datetime when the transaction occurred (defaults to creation time)
Whether to execute rules engine for this transaction
With
false (default): if you send originExternalId / destinationExternalId (or root-level tax ids) and no entity matches, the transaction is still created (unlinked), same as before.With true: each side (origin / destination) is validated only when you send at least one identifier for that side (originEntityId, originExternalId, or originTaxId; same for destination). Every identifier you send must resolve to an existing person/company in your organization; otherwise the API returns 400 with INVALID_ENTITY_REFERENCES and does not create the transaction. If you send no origin (or destination) identifiers, that side is not validated.Risk matrices (optional)
Legacy-compatible: one UUID or an array of UUIDs of risk matrices owned by your organization. When non-empty, only rules assigned to those matrices run for this transaction (no mixing with βlooseβ trigger-only rules). Omit both
riskMatrixId and riskMatrixIds to keep the historical trigger-based behavior.Preferred for multiple matrices: ordered UUID list. Takes precedence over
riskMatrixId when provided and non-empty.Origin Entity Fields
How the origin is linked in gu1 (tried in order; stop at first success):
(For graph visualization only, you can also send a tax in
- Direct ID β if you send
originEntityId, the transaction is tied to that entity (must exist in your org). - External ID β if you did not send
originEntityIdbut you sendoriginExternalIdand a person/company exists with the sameexternalId, the row is auto-linked to that entity. - Tax / document ID (third fallback) β if the transaction is still not linked, but you send
rootoriginTaxId, the API looks up a person/company whosetaxIdin gu1 matches after normalization (only letters and digits, ignoring punctuation, spaces, and case for comparison).
originEntityId and, when you did not provide them, enriches originName and originCountry from the matched entity.If the tax/external value does not match any entity, the transaction is still created; the fields you sent are stored, but there is no entity link.(For graph visualization only, you can also send a tax in
originDetails β that path does not auto-link; use originTaxId at the root when you want a real link by document.)UUID of the origin entity (sender) in gu1 system
Your external ID for the origin entity
Tax or national document ID of the origin counterparty (e.g. CPF, CNPJ, CUIT), at the root of the transaction. Used only as the third way to find and link a person/company, after
originEntityId and originExternalId. The value is compared to each entityβs taxId using a normalized form (alphanumeric only). If a match is found, originEntityId is set and name/country can be filled. Max length: 50 characters. Optional.Name of the origin entity
ISO 2-letter country code of origin (e.g., βUSβ, βBRβ, βARβ)
Detailed information about the origin (sender/device). These fields match the API schema; you can also send additional custom fields and they will be stored.Schema fields (all optional):Device/Technical:
deviceId(string) - Unique device identifierdeviceFingerprint(string) - Device fingerprint hashdeviceType(enum) - βmobileβ, βdesktopβ, βtabletβ, βposβ, βatmβuserAgent(string) - Browser user agentipAddress(string) - IP address (validated format)
country(string) - ISO 2-letter country codecity(string),region(string),latitude(number),longitude(number),timezone(string)
accountNumber(string),accountType(enum: βcheckingβ, βsavingsβ, βbusinessβ, βpersonalβ),bankCode(string),bankName(string)
isVpn(boolean),isTor(boolean),isProxy(boolean),governmentAccount(boolean)
originEntityId or originExternalId), you can still improve network graph visualization by sending identifying data in originDetails or originDetails.paymentDetails: taxId (e.g. CPF/CNPJ, digits only) and/or accountNumber (and optionally bankCode). These are optional and for internal use only: we group βpseudoβ nodes in the graph by the same taxId or account so the same unknown party appears as one node. Not required β only use when you want better graph flow when one side of the transaction is unknown.Destination Entity Fields
UUID of the destination entity (recipient) in gu1 system
Your external ID for the destination entity
Tax or document ID of the destination counterparty at the root of the request. Third linking fallback: used only if
destinationEntityId and destinationExternalId did not resolve. Same matching rules as originTaxId. When a match is found, destinationEntityId is set and name/country can be enriched. Max: 50 characters. Optional.Name of the destination entity
ISO 2-letter country code of destination (e.g., βUSβ, βBRβ, βARβ)
Detailed information about the destination (merchant/receiver). These fields match the API schema; you can also send additional custom fields and they will be stored.Schema fields (all optional):Merchant:
mcc(string) - Merchant Category Code (4 digits)mccDescription(string),merchantId(string),merchantName(string),merchantType(string)
deviceId(string),deviceType(enum: βposβ, βonlineβ, βmobileβ, βatmβ),ipAddress(string)
country(string, ISO 2),city(string),region(string)
accountNumber(string),accountType(enum: βcheckingβ, βsavingsβ, βbusinessβ, βmerchantβ),bankCode(string),bankName(string)
cryptoExchange(boolean),highRisk(boolean),privateSector(boolean)
destinationEntityId or destinationExternalId), you can still improve network graph visualization by sending taxId and/or accountNumber (and optionally bankCode) in destinationDetails or destinationDetails.paymentDetails. Optional; used internally to show βpseudoβ nodes in the graph grouped by the same identifier. Not required β only when you want better graph flow when one side is unknown.Location Details
Physical location information for the transaction. Useful for fraud detection and geographic analysis.Address Information:
country(string) - ISO 2-letter country codecountryName(string) - Full country namecity(string) - City nameregion(string) - State/Provinceaddress(string) - Full addressstreet(string) - Street namestreetNumber(string) - Street numberpostalCode(string) - Postal/ZIP codeneighborhood(string) - Neighborhood/district
latitude(number) - GPS latitude (-90 to 90)longitude(number) - GPS longitude (-180 to 180)
timezone(string) - Timezone identifierplaceId(string) - Google Places ID or similar
Device Details
Detailed device information for fraud detection and device fingerprinting.Device Identification:
deviceId(string) - Unique device identifierexternalId(string) - Your external device ID
platform(enum) - Platform: βandroidβ, βiosβ, βwebβ, βdesktopβ, βmobileβ, βtabletβ, βposβ, βatmβosName(string) - OS name (e.g., βAndroidβ, βiOSβ, βWindowsβ, βmacOSβ)osVersion(string) - OS version
manufacturer(string) - Device manufacturermodel(string) - Device modelbrand(string) - Device branddeviceName(string) - Device name/nickname
browser(string) - Browser namebrowserVersion(string) - Browser versionuserAgent(string) - Full user agent string
isEmulator(boolean) - Device is an emulatorisRooted(boolean) - Android device is rootedisJailbroken(boolean) - iOS device is jailbroken
ipAddress(string) - IP address (validated format)isVpn(boolean) - Connection via VPNisTor(boolean) - Connection via Tor networkisProxy(boolean) - Connection via proxy
deviceFingerprint(string) - Unique device fingerprint hash
screenResolution(string) - Screen resolution (e.g., β1920x1080β)language(string) - Device languagetimezone(string) - Device timezone
Channel
Channel through which the transaction originated (max 50 characters).Common values:
mobile_app- Mobile applicationweb_browser- Web browserpos_terminal- Point of sale terminalapi- Direct API integrationatm- ATM machinephone_banking- Phone bankingbranch- Physical branchchatbot- Chatbot interfacethird_party- Third-party integration
Reason
Optional reason for the transaction outcome (e.g. decline, failure, limit exceeded). Send any value from the transaction_reason_type enum. If omitted, the system uses
WITHOUT_REASON. Not required β existing integrations remain valid.Full list: See Transaction Reason Enum for all 60+ allowed values.Time zone
Optional IANA time zone for transaction-local time context (e.g. alongside
transactedAt). Send a value from transaction_time_zone. If omitted, stored as null (default for existing rows).Full list: See Transaction Time Zone Enum.Metadata
Additional metadata for the transaction. Optional fields:Tags:
tags(object) - Key-value pairs for categorization (values can be string, number, or boolean)
purpose(string) - Purpose of the transactionfrequency(string) - Transaction frequencycontract_number(string) - Associated contract number
enhanced_due_diligence(boolean) - EDD flagblock_reason(string) - Reason for blockingcompliance_alert(boolean) - Compliance alert flag
passthrough behavior.Response
The created transaction object. Includes:
id- gu1βs internal transaction IDexternalId- Your external IDorganizationId- Your organization IDtype- Transaction typeamount- Transaction amount (string)currency- Currency codestatus- Transaction statusriskScore- Calculated risk score 0-100 (string)flagged- Whether transaction is flaggedchannel- Channel informationreason- Outcome reason (e.g. WITHOUT_REASON, INSUFFICIENT_FUNDS)timeZone- IANA time zone (string | null)originDetails/destinationDetails- Origin/destination detailslocationDetails- Location datadeviceDetails- Device informationprocessingTimeMs,processedAt,transactedAt,createdAt,updatedAt- Timestamps
Only present when executeRules is true and the rules engine ran. Omitted when
executeRules is false.- rulesHit (array) - Rules whose conditions were met. Each item: name, description, score, priority, category, status, conditions, actions.
- rulesNoHit (array) - Rules evaluated but conditions not met. Same structure as rulesHit.
- actionsExecuted (object, optional) - Aggregated executed actions: alerts (with ruleId, ruleExternalId, investigationId), suggestion, status, assignedUser, customKeys. Omitted when empty.
- totalScore (number) - Sum of score of all rules that hit (excluding shadow).
- scoreResult (object) - rawScore, normalizedScore (0β100), label (name, range, minScore, maxScore).
- riskMatrixName (string) - Name of the risk matrix executed.
- executionTimeMs (number) - Rules engine execution time in milliseconds.
- trigger (string) - Event that triggered the evaluation (e.g.
manual_evaluation,entity_created,created). - matchedRulesCount (number) - Number of rules that matched. See Rules Execution Summary for the full structure and a complete example.
Examples
Basic Transaction
Response Example
Error Responses
400 Bad Request - Invalid Data
400 Bad Request - Invalid IP Address
409 Conflict - Duplicate Transaction
429 Too Many Requests
Next Steps
- Get transaction - Fetch by ID or external ID
- Create Batch Transactions - Bulk transaction creation
- Change transaction status - Change status
- Transaction Monitoring - Learn about fraud detection