llms.txt API v1 · 2026-11-02
Wallet API钱包回调接口

Rollback冲正

Reverse exactly one debit, in full.全额冲正恰好一笔扣款。

POST{callbackUrl}/rollback

Implemented by the merchant · called by the platform商户实现 · 平台调用 · timeout超时 10 s

Reverse exactly one debit. Common and transaction fields (amount = amount of the referenced debit), plus:

冲正恰好一笔扣款。公共字段与交易字段(amount = 被冲正扣款的金额),另加:

refTxnIdstring
The txnId of the debit to reverse.被冲正的那笔扣款的 txnId。
rollbackReasonstring
debit_uncertain (the debit's result was unknown) · decision_failed (a mid-round decision did not go through) · round_cancelled (the platform cancelled the round)debit_uncertain 扣款结果未知 · decision_failed 局中决策没生效 · round_cancelled 平台取消了这局
roundClosedbool
true: no further transactions for this round after this one.true = 这笔之后该局不再有任何交易。

Response data: merchantTxnId (required on OK), balance.

响应 data:merchantTxnId(OK 时必填)、balance。

Situation on your side商户侧的情况Answer返回Money资金
Referenced debit succeeded and is not yet reversed被冲正的扣款成功过、还没冲正过OKReturn amount to the player退回 amount
Same rollback txnId repeated同一笔冲正重发Original result第一次的结果No change不动
Referenced debit never received被冲正的扣款从没收到过TXN_NOT_FOUND — and remember that refTxnId is rolled back, so the debit is refused with TXN_ROLLED_BACK if it arrives laterTXN_NOT_FOUND,并记下这个 refTxnId 已被冲正;那笔扣款之后到达时返回 TXN_ROLLED_BACKNo change不动
Referenced debit failed (e.g. insufficient balance)被冲正的扣款是失败的(如余额不足)TXN_NOT_FOUNDNo change不动
Amount differs from the debit, or the debit belongs to another player / round金额与扣款不同,或扣款属于别的玩家 / 局TXN_CONFLICTNo change不动
Round already closed钱包局已关ROUND_CLOSEDNo change不动

We treat both OK and TXN_NOT_FOUND as "rollback complete". TXN_CONFLICT / ROUND_CLOSED are flagged for manual attention and alerted, and retries continue. Anything uncertain is retried (Retries).

OK 和 TXN_NOT_FOUND 平台都视为「冲正完成」。TXN_CONFLICT / ROUND_CLOSED 标「需人工关注」并告警,重试照常继续。结果不确定的一律重试(重试)。

Result codes结果码

In addition to the common codes listed in另可能返回通用结果码,见 Result codes结果码.

Test cases测试用例

The conformance test sends the following 5 requests to /rollback. Each response must match the expected result exactly.接口对接测试会向 /rollback 发送以下 5 个请求,每个响应都必须与期望结果完全一致。 All test cases全部测试用例

ROL-03 blocking阻断级 Rollback of a debit never received未收到扣款的冲正 Expected期望 TXN_NOT_FOUND
/rollback R10 ref Tx (never sent) A debit_uncertain
ROL-06 blocking阻断级 Rollback with the correct amount金额正确的冲正 Expected期望 OK
/rollback R11 new T ref Tb 2A roundClosed
ROL-08 blocking阻断级 Rollback after round closure关局后的冲正 Expected期望 ROUND_CLOSED
/rollback R4 ref MUL-01's debit
ROL-09 blocking阻断级 Rollback of a failed debit失败扣款的冲正 Expected期望 TXN_NOT_FOUND
/rollback R2 ref T3 (DEB-05)
ROL-10 warning警告级 Rollback referencing another round's debit跨钱包局的冲正 Expected期望 TXN_CONFLICT or或 ROUND_CLOSED
/rollback R13 ref ROL-07's main debit