Transaction monitoring (KYT/AML) and Travel Rule: submit a transaction for an applicant and read back Sumsub's scoring and review, approve or reject it, rescore it, or delete it.
A submitted transaction is scored synchronously against your rules
(scoringResult), and its review.reviewStatus moves to
completed (with reviewAnswer GREEN/RED), onHold or
awaitingUser. Later changes arrive on the applicantKytTxn*
webhooks, or poll get-transaction from a schedule.
Travel Rule transfers use the same submit call with type: "travelRule" and the counterparty's VASP and wallet details in
counterparty and info.
Transaction payloads carry counterparty names, account numbers and wallet addresses. This package keeps them out of error messages; Hot's run trace still records them as arguments.
Values
TRAVEL_RULE_STATUSES
TRAVEL_RULE_STATUSES: Vec [
"awaitingCounterparty",
"cancelled",
"completed",
"counterpartyMismatchedData",
"counterpartyVaspNotFound",
"counterpartyVaspNotReachable",
"expired",
"finished",
"onHold",
"unconfirmedOwnership",
"counterpartyVaspGeneralDecline",
"notEnoughCounterpartyData"
]
TXN_TYPES
TXN_TYPES: Vec [
"finance",
"kyc",
"travelRule",
"userPlatformEvent"
]
Functions
confirm-wallet-ownership
fn (txn-id: Str, confirmed: Bool): Map
fn (txn-id: Str, confirmed: Bool, opts: Map): Map
Record whether the applicant confirmed owning the wallet for a Travel
Rule transfer (confirmed true or false).
Example
::sumsub::kyt/confirm-wallet-ownership("65f0c1e2a3b4c5d6e7f81234", true)
delete-transaction
fn (txn-id: Str): Map
fn (txn-id: Str, opts: Map): Map
Delete a transaction. Returns {deleted: 1}.
Example
::sumsub::kyt/delete-transaction("65f0c1e2a3b4c5d6e7f81234").deleted
get-transaction
fn (txn-id: Str): Map
fn (txn-id: Str, opts: Map): Map
Fetch a transaction by Sumsub's id: scoring, review and Travel Rule status.
Example
txn ::sumsub::kyt/get-transaction("65f0c1e2a3b4c5d6e7f81234")
txn.scoringResult.action
::sumsub::decisions/review-outcome(txn).outcome
get-transaction-by-txn-id
fn (txn-id: Str): Map
fn (txn-id: Str, opts: Map): Map
Fetch a transaction by the txnId you submitted.
Example
::sumsub::kyt/get-transaction-by-txn-id("wd-1001").review
rescore-transaction
fn (txn-id: Str): Map
fn (txn-id: Str, opts: Map): Map
Re-run your rules on a transaction (at most 200 times). Returns the transaction.
Example
::sumsub::kyt/rescore-transaction("65f0c1e2a3b4c5d6e7f81234").score
review-transaction
fn (txn-id: Str, review-answer: Str): Map
fn (txn-id: Str, review-answer: Str, opts: Map): Map
Approve ("GREEN") or reject ("RED") a transaction that is on hold.
Returns the transaction.
Example
::sumsub::kyt/review-transaction("65f0c1e2a3b4c5d6e7f81234", "GREEN")
set-payment-txn-id
fn (txn-id: Str, payment-txn-id: Str): Map
fn (txn-id: Str, payment-txn-id: Str, opts: Map): Map
Attach the on-chain hash (or payment-system id) to a transaction after it settles.
Example
::sumsub::kyt/set-payment-txn-id("65f0c1e2a3b4c5d6e7f81234", "0xabc123")
submit-new-applicant-request
fn (level-name: Str?, txn: Map): Map
The spec for submitting a transaction when the applicant may not exist
yet (POST /resources/applicants/-/kyt/txns/-/data?levelName=).
txn.applicant.externalUserId and txn.applicant.fullName are
required; the transaction attaches to an existing applicant with that id
or creates one. Exposed for testing.
Example
txn {txnId: "wd-1001", type: "kyc", applicant: {externalUserId: "user-42", fullName: "Ada Lovelace"}}
::sumsub::kyt/submit-new-applicant-request("basic-kyc-level", txn).path
// "/resources/applicants/-/kyt/txns/-/data?levelName=basic-kyc-level"
submit-request
fn (applicant-id: Str, txn: Map): Map
The spec for submitting a transaction for an existing applicant
(POST /resources/applicants/{id}/kyt/txns/-/data). txn is
Sumsub's payload: txnId (your id, unique), type, txnDate
("yyyy-MM-dd HH:mm:ss+0000"), info ({direction: "in" | "out", amount, currencyCode, currencyType: "fiat" | "crypto", paymentTxnId?, cryptoParams?}), applicant and counterparty ({type, externalUserId?, fullName, paymentMethod: {type, accountId}, institutionInfo?, ...}), props. Exposed for testing.
Example
txn {txnId: "wd-1001", type: "kyc", applicant: {}}
::sumsub::kyt/submit-request("abc", txn).path // "/resources/applicants/abc/kyt/txns/-/data"
submit-transaction
fn (applicant-id: Str, txn: Map): Map
fn (applicant-id: Str, txn: Map, opts: Map): Map
Submit a transaction for an existing applicant. Returns the
transaction: id (Sumsub's), data, score, scoringResult
(matchedRules, action) and review. Map it with
::sumsub::decisions/review-outcome. A repeated txnId is a 409.
Example
txn ::sumsub::kyt/submit-transaction("65f0c1e2a3b4c5d6e7f80912", {
txnId: "wd-1001",
type: "finance",
txnDate: "2026-11-01 12:00:00+0000",
info: {direction: "out", amount: 2500, currencyCode: "USD", currencyType: "fiat"},
applicant: {},
counterparty: {type: "individual", fullName: "Grace Hopper", paymentMethod: {type: "bankAccount", accountId: "acct-ref-77"}}
})
submit-transaction-for-user
fn (level-name: Str?, txn: Map): Map
fn (level-name: Str?, txn: Map, opts: Map): Map
Submit a transaction keyed by applicant.externalUserId, creating the
applicant on level-name when it does not exist (null to let Sumsub
pick the default).
Example
txn ::sumsub::kyt/submit-transaction-for-user("basic-kyc-level", {
txnId: "wd-1001",
type: "finance",
txnDate: "2026-11-01 12:00:00+0000",
info: {direction: "out", amount: 2500, currencyCode: "USD", currencyType: "fiat"},
applicant: {externalUserId: "user-42", fullName: "Ada Lovelace"}
})
txn.id
travel-rule-status
fn (txn: Any): Str?
A transaction's Travel Rule status (travelRuleInfo.status), or null
when it is not a Travel Rule transfer. Pure.
Example
::sumsub::kyt/travel-rule-status({travelRuleInfo: {status: "completed"}}) // "completed"
::sumsub::kyt/travel-rule-status({}) // null
txn-id-path
fn (txn-id: Str): Str
The path for a transaction addressed by your own txnId. Exposed for
testing.
Example
::sumsub::kyt/txn-id-path("wd-1001") // "/resources/kyt/txns/-;data.txnId=wd-1001/one"
validate-txn
fn (txn: Map): Map
Check the fields Sumsub requires before sending: txnId, type, and
applicant (a Map; {} is fine for an existing applicant); info for
finance and travelRule. Returns the compacted payload or an Err that
names the missing field (never its value). Exposed for testing.
Example
::sumsub::kyt/validate-txn({txnId: "t1", type: "kyc", applicant: {}, props: null})
// {txnId: "t1", type: "kyc", applicant: {}}
is-err(::sumsub::kyt/validate-txn({type: "kyc", applicant: {}})) // true