sumsub-create-transaction
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSumsub — Create Transaction (KYT)
Sumsub — 创建交易(KYT)
Builds a JSON payload from a compact spec, POSTs it to the Sumsub KYT endpoint, and reports the resulting / / .
KytTxnDatatxnIdscorereviewAnswer根据简洁规范构建 JSON负载,将其POST到Sumsub KYT端点,并返回生成的 / / 。
KytTxnDatatxnIdscorereviewAnswerEndpoint
端点
Two variants, picked automatically by the post script:
| Case | Method + Path |
|---|---|
| Applicant exists | |
Applicant does not exist (Sumsub creates one from | |
Body: . Returns the persisted with monitoring scores attached.
KytTxnDataKytTxnBoth endpoints are marked deprecated, but they remain the canonical "submit transaction" entry points in the official docs. No v2/v3 replacement exists.
POST脚本会自动选择以下两种变体:
| 场景 | 方法 + 路径 |
|---|---|
| 申请人已存在 | |
申请人不存在(Sumsub会通过 | |
请求体:。返回带监控评分的已持久化。
KytTxnDataKytTxn这两个端点均标记为已弃用,但它们仍是官方文档中标准的“提交交易”入口,目前尚无v2/v3替代方案。
Auth — App Token + secret (sandbox only)
认证 — App Token + 密钥(仅沙箱环境)
This skill talks to the public Sumsub API and signs each request per
the authentication reference.
The full how-it-works writeup lives in the
skill — read it if you hit .
sumsub-api-auth401 Invalid signature⚠️ Sandbox tokens only. Do not accept or use a production App Token here — transaction monitoring acts on real applicant data and can fire real KYT alerts. If the user offers a prod token, refuse and ask them to generate a sandbox pair at https://cockpit.sumsub.com/checkus/devSpace/appTokens (toggle the workspace to Sandbox first, then Create). Token + secret are shown once — copy both before closing the dialog. The helper script enforces this — it rejects tokens that don't start with.sbx:
| Var | Example |
|---|---|
| |
| The paired secret shown once at token creation. |
| Optional. Defaults to |
该Skill对接公开的Sumsub API,并按照认证参考文档对每个请求进行签名。完整的工作原理说明在 Skill中——如果遇到错误,请阅读该文档。
sumsub-api-auth401 Invalid signature⚠️ 仅支持沙箱令牌。 请勿接受或使用生产环境的App Token——交易监控会作用于真实申请人数据,并可能触发真实的KYT警报。如果用户提供生产令牌,请拒绝并要求他们在https://cockpit.sumsub.com/checkus/devSpace/appTokens生成沙箱令牌对(先将工作区切换为Sandbox,再点击Create)。令牌和密钥仅会显示一次——关闭对话框前请复制两者。辅助脚本会强制验证这一点——它会拒绝不以开头的令牌。sbx:
| 变量 | 示例 |
|---|---|
| |
| 创建令牌时一次性显示的配对密钥。 |
| 可选,默认值为 |
Signing the resolved path
对解析后的路径签名
This is the one routing wrinkle — the path with query string must be
signed. The post script handles it: it reads the sidecar route file the
builder emits, picks the URI ( or
), URL-encodes the dynamic segments,
and signs the same bytes it sends. If you bypass the script, remember:
/resources/applicants/{id}/…/resources/applicants/-/…?levelName=…- Sign the path you put on the wire — encoded form, query string included.
- Body bytes signed must equal the bytes sent (no whitespace re-flow).
If the user has already supplied credentials in conversation, reuse them;
otherwise ask once before running. Never echo the secret back.
这是一个路由细节——必须对包含查询字符串的路径进行签名。POST脚本会处理这一点:它读取构建器生成的辅助路由文件,选择URI(或),对动态段进行URL编码,并对发送的相同字节进行签名。如果绕过脚本,请记住:
/resources/applicants/{id}/…/resources/applicants/-/…?levelName=…- 对传输中的路径进行签名——使用编码格式,包含查询字符串。
- 签名的请求体字节必须与发送的字节完全一致(不能重新排版空白字符)。
如果用户已在对话中提供凭据,请复用;否则在运行前询问一次。切勿返回密钥内容。
Procedure
流程
-
Map the user's intent to the compact spec below. The vast majority of transactions are(a payment) — for those, the user is really telling you amount + currency + direction + applicant + counterparty.
type: finance -
Validate:non-empty,
txnIdnon-empty, and perapplicant.externalUserId:type- /
finance→travelRule,info.amount,info.currencyCoderequired (the OpenAPI marks all three required oninfo.direction).KytTxnInfo - →
userPlatformEventrequired.userPlatformEvent.type - Enums (,
direction,currencyType,applicant.type, etc.) checked upfront with full allowed-values list on failure.nameType
-
Generate the full payload with(compact spec on stdin → full
${CLAUDE_SKILL_DIR}/scripts/build_transaction.pypayload on stdout).KytTxnData -
POST via— auto-routes to existing-applicant vs non-existing-applicant URL based on whether
${CLAUDE_SKILL_DIR}/scripts/post_transaction.shwas set in the spec (NOT in the payload — see below)._applicantId -
Build the dashboard link. Read(the server-assigned identifier, not the
idyou supplied) andtxnIdfrom the response body and format:clientIdhttps://cockpit.sumsub.com/checkus/kyt/txns/<id>?clientId=<clientId>&xSNSEnv=sbxThe user-suppliedin the spec (e.g.txnId) is not what goes in the URL — Sumsub assigns a separate identifier on persistence. Thefinance-2026-05-21-0001query param targets the Sandbox workspace — it is the canonical sandbox link param shared across all skills.xSNSEnv=sbx -
Report:(yours), the server
txnId, applicantid, direction + amount + currency, counterparty (if any), the response'sexternalUserId/score/reviewAnswerif present, and the dashboard link as a clickable markdown link.riskLabels
-
映射用户意图到下方的简洁规范。绝大多数交易为(支付)——对于这类交易,用户实际需要提供金额 + 货币 + 方向 + 申请人 + 交易对手。
type: finance -
验证:非空,
txnId非空,并根据applicant.externalUserId进行验证:type- /
finance→ 必填travelRule、info.amount、info.currencyCode(OpenAPI标记这三个字段为info.direction的必填项)。KytTxnInfo - → 必填
userPlatformEvent。userPlatformEvent.type - 枚举值(、
direction、currencyType、applicant.type等)会提前验证,验证失败时会返回完整的允许值列表。nameType
-
生成完整负载:使用(标准输入为简洁规范 → 标准输出为完整的
${CLAUDE_SKILL_DIR}/scripts/build_transaction.py负载)。KytTxnData -
POST请求:通过发送——根据规范中是否设置
${CLAUDE_SKILL_DIR}/scripts/post_transaction.sh自动路由到已存在申请人或不存在申请人的URL(注意:是规范中的设置,而非负载中的设置)。_applicantId -
构建控制台链接:从响应体中读取(服务器分配的标识符,而非你提供的
id)和txnId,并格式化为:clientIdhttps://cockpit.sumsub.com/checkus/kyt/txns/<id>?clientId=<clientId>&xSNSEnv=sbx规范中用户提供的(例如txnId)不能用于URL——Sumsub在持久化时会分配单独的标识符。finance-2026-05-21-0001查询参数指向沙箱工作区——这是所有Skill通用的标准沙箱链接参数。xSNSEnv=sbx -
返回结果:返回(你提供的)、服务器分配的
txnId、申请人id、交易方向+金额+货币、交易对手(如有)、响应中的externalUserId/score/reviewAnswer(如有),以及可点击的Markdown格式控制台链接。riskLabels
Compact spec format (JSON or YAML on stdin)
简洁规范格式(标准输入为JSON或YAML)
yaml
undefinedyaml
undefinedTop-level
顶层字段
txnId: "finance-2026-05-21-0001" # REQUIRED, unique alphanumeric in your system
txnDate: "2026-05-21 14:30:00+0000" # optional; format: yyyy-MM-dd HH:mm:ss+XXXX
zoneId: "UTC+01:00" # optional, time zone string
type: finance # finance | travelRule | kyc | userPlatformEvent | iGamingSession (default: finance)
txnId: "finance-2026-05-21-0001" # 必填,在你的系统中唯一的字母数字标识符
txnDate: "2026-05-21 14:30:00+0000" # 可选;格式:yyyy-MM-dd HH:mm:ss+XXXX
zoneId: "UTC+01:00" # 可选,时区字符串
type: finance # finance | travelRule | kyc | userPlatformEvent | iGamingSession(默认值:finance)
Routing — pick ONE
路由选择 — 二选一
_applicantId: "67abc..." # post to existing applicant (path id, NOT a payload field)
_applicantId: "67abc..." # 提交到已存在申请人的路径(路径中的id,非负载字段)
- OR -
或 -
_levelName: "Default" # post to non-existing-applicant URL with ?levelName=...
# (Sumsub creates the applicant from applicant.externalUserId)
_levelName: "Default" # 提交到不存在申请人的URL,附带?levelName=...参数
# (Sumsub会通过applicant.externalUserId创建申请人)
Finance / Travel Rule info (required for those types)
金融/旅行规则信息(对应类型必填)
amount: 1500.50
currency: USD # ISO-4217 fiat or crypto ticker (BTC, ETH, …)
currencyType: fiat # fiat | crypto (default: fiat)
direction: out # in | out
amountInDefaultCurrency: 1500.50 # optional, converted to client default
defaultCurrencyCode: USD
paymentDetails: "Invoice #INV-2026-001"
mcc: 5411 # optional, 4-digit Merchant Category Code
amount: 1500.50
currency: USD # ISO-4217法定货币或加密货币代码(BTC、ETH等)
currencyType: fiat # fiat | crypto (默认值:fiat)
direction: out # in | out
amountInDefaultCurrency: 1500.50 # 可选,转换为客户默认货币的金额
defaultCurrencyCode: USD
paymentDetails: "Invoice #INV-2026-001"
mcc: 5411 # 可选,4位商户类别代码
Crypto-only block (used when currencyType=crypto)
仅加密货币区块(当currencyType=crypto时使用)
crypto:
chain: ETH # ETH | BTC | TRX | … (mandatory for tokens; empty for native)
contract: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
paymentTxnId: "0x1234abcd..." # on-chain hash
fingerprint: "0x1234abcd..." # alternative blockchain identifier
attemptId: "attempt-01" # optional, when retrying
outputIndex: 0 # for UTXO chains
crypto:
chain: ETH # ETH | BTC | TRX | …(代币必填;原生货币留空)
contract: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
paymentTxnId: "0x1234abcd..." # 链上哈希
fingerprint: "0x1234abcd..." # 可选的区块链标识符
attemptId: "attempt-01" # 可选,重试时使用
outputIndex: 0 # 适用于UTXO链
Applicant (REQUIRED) — the person/entity acting on your platform
申请人(必填)—— 在你的平台上操作的个人/实体
applicant:
externalUserId: "user-001" # REQUIRED — your stable user id
type: individual # individual | company (default: individual)
fullName: "John Smith" # required for company; recommended for non-existing-applicant flow
dob: "1990-05-01"
email: "john@example.com"
phone: "+1234567890"
placeOfBirth: "London"
address:
country: USA
town: "New York"
street: "5th Avenue"
formatted: "5th Avenue, New York, USA"
paymentMethod:
type: bankCard # bankCard | bankAccount | crypto | cryptoWallet |
# eWallet | unhostedWallet | card | other
accountId: "4111********1111" # IBAN, last4-hash, wallet address, etc.
issuingCountry: USA
"3dsUsed": true
"2faUsed": false
memo: "optional memo"
idDoc:
number: "A12345678"
country: USA
idDocType: PASSPORT
device:
fingerprint: "abc123"
userAgent: "Mozilla/5.0 ..."
ipInfo: { ip: "1.2.3.4" }
applicant:
externalUserId: "user-001" # 必填 — 你的稳定用户ID
type: individual # individual | company(默认值:individual)
fullName: "John Smith" # 公司类型必填;非申请人流程推荐填写
dob: "1990-05-01"
email: "john@example.com"
phone: "+1234567890"
placeOfBirth: "London"
address:
country: USA
town: "New York"
street: "5th Avenue"
formatted: "5th Avenue, New York, USA"
paymentMethod:
type: bankCard # bankCard | bankAccount | crypto | cryptoWallet |
# eWallet | unhostedWallet | card | other
accountId: "4111********1111" # IBAN、后四位哈希、钱包地址等
issuingCountry: USA
"3dsUsed": true
"2faUsed": false
memo: "optional memo"
idDoc:
number: "A12345678"
country: USA
idDocType: PASSPORT
device:
fingerprint: "abc123"
userAgent: "Mozilla/5.0 ..."
ipInfo: { ip: "1.2.3.4" }
Counterparty (typical for finance + travelRule; same shape as applicant + a few extras)
交易对手(金融/旅行规则类型常见;结构与申请人类似,新增部分字段)
counterparty:
externalUserId: "merchant-XYZ"
type: company
fullName: "Acme Inc."
registrationNumber: "12345678"
leiCode: "529900XXXX0000XXXX00"
residenceCountry: QAT
address: { country: QAT }
institution: # → institutionInfo
code: "ACME-CODE"
name: "Acme Bank"
internalId: "<VASP id from directory>"
ceo: # only for company counterparties (Travel Rule)
firstName: "Jane"
lastName: "Roe"
counterparty:
externalUserId: "merchant-XYZ"
type: company
fullName: "Acme Inc."
registrationNumber: "12345678"
leiCode: "529900XXXX0000XXXX00"
residenceCountry: QAT
address: { country: QAT }
institution: # → institutionInfo
code: "ACME-CODE"
name: "Acme Bank"
internalId: "<VASP id from directory>"
ceo: # 仅适用于公司类型交易对手(旅行规则)
firstName: "Jane"
lastName: "Roe"
user-platform-event only (when type=userPlatformEvent)
仅用户平台事件(当type=userPlatformEvent时使用)
userPlatformEvent:
type: login # login | failedLogin | signup | passwordReset | twoFaReset | general
twoFaUsed: true
passwordHash: "..."
userPlatformEvent:
type: login # login | failedLogin | signup | passwordReset | twoFaReset | general
twoFaUsed: true
passwordHash: "..."
Optional escape hatches
可选扩展字段
sourceKey: "<segregation key>"
props: # custom string-string map
customField: "value"
dailyOutLimit: "10000"
undefinedsourceKey: "<segregation key>"
props: # 自定义字符串键值对
customField: "value"
dailyOutLimit: "10000"
undefinedEnums (validated upfront)
枚举值(提前验证)
| Field | Allowed values |
|---|---|
| |
| |
| |
| |
| |
| |
paymentMethod.typeKytTxnPaymentMethodTypesmartContractbankCardbankAccountcryptoeWalletunhostedWallet| 字段 | 允许值 |
|---|---|
| |
| |
| |
| |
| |
| |
paymentMethod.typeKytTxnPaymentMethodTypesmartContractbankCardbankAccountcryptoeWalletunhostedWalletOutputs
输出
On success, report all of:
- (yours) and
txnId(server-assigned, used in the dashboard link).id - Applicant .
externalUserId - , counterparty (if any).
direction amount currency - The response's /
score/reviewAnswerif returned.riskLabels - Dashboard link: . Render as a clickable markdown link.
https://cockpit.sumsub.com/checkus/kyt/txns/<id>?clientId=<clientId>&xSNSEnv=sbxis the server-assigned identifier (not the<id>you sent); both it andtxnIdare in the POST response body;clientIdtargets the Sandbox workspace.xSNSEnv=sbx
On failure: HTTP status + Sumsub's /. Most likely 4xx cases:
descriptionerrorName- —
409 Entity already existscollision (use a fresh id or the bulk-import method to update).txnId - — required field missing (typical:
400,info.amount,info.currencyCode, orinfo.direction).applicant.externalUserId - —
400unknown (when using non-existing-applicant flow).levelName
成功时返回以下所有内容:
- (你提供的)和
txnId(服务器分配的,用于控制台链接)。id - 申请人。
externalUserId - 、交易对手(如有)。
direction amount currency - 响应中的/
score/reviewAnswer(如有返回)。riskLabels - 控制台链接:。以可点击的Markdown链接形式呈现。
https://cockpit.sumsub.com/checkus/kyt/txns/<id>?clientId=<clientId>&xSNSEnv=sbx是服务器分配的标识符(而非你发送的<id>);它和txnId都在POST响应体中;clientId指向沙箱工作区。xSNSEnv=sbx
失败时返回:HTTP状态码 + Sumsub的/。最常见的4xx情况:
descriptionerrorName- —
409 Entity already exists冲突(使用新ID或批量导入方法进行更新)。txnId - — 必填字段缺失(典型情况:
400、info.amount、info.currencyCode或info.direction)。applicant.externalUserId - —
400不存在(使用非申请人流程时)。levelName
Worked examples
示例
- — outbound EUR card payment to a foreign counterparty (the docs' canonical example).
examples/fiat-out.json - — inbound ETH deposit with
examples/crypto-in.json, contract address, on-chaincryptoParams.cryptoChain=ETH.paymentTxnId - —
examples/travel-rule.jsonoutbound crypto withtype: travelRule(VASP id) on the counterparty.institution.internalId - —
examples/login-event.jsonfor a successful login with 2FA.type: userPlatformEvent - — non-existing-applicant flow:
examples/new-applicant.jsonis set so the POST goes to_levelNamewith/-/kyt/txns/-/data.?levelName=...
- — 向境外交易对手支付欧元的出境卡支付(文档中的标准示例)。
examples/fiat-out.json - — 入境ETH存款,包含
examples/crypto-in.json、合约地址、链上cryptoParams.cryptoChain=ETH。paymentTxnId - —
examples/travel-rule.json的出境加密货币交易,交易对手包含type: travelRule(VASP ID)。institution.internalId - —
examples/login-event.json的成功登录事件,使用了2FA。type: userPlatformEvent - — 非申请人流程:设置
examples/new-applicant.json,POST请求会发送到_levelName并附带/-/kyt/txns/-/data参数。?levelName=...
See also
参考链接
- references/transaction-schema.md — full schema, all sub-objects, all enums, the existing-vs-new-applicant routing, scoring response fields, common gotchas.
KytTxnData - Sumsub docs — Submit transaction
- Sumsub docs — Submit transaction for non-existing applicant
- Sumsub docs — Submit transactions and review results
- references/transaction-schema.md — 完整的schema、所有子对象、所有枚举值、已存在/新申请人路由规则、评分响应字段、常见问题。
KytTxnData - Sumsub文档 — 提交交易
- Sumsub文档 — 为非申请人提交交易
- Sumsub文档 — 提交交易并查看结果