跳转到主要内容
GET
Get payment credential
返回该客户某个授权的签名支付授权凭证:一个 SD-JWT VC(typ: dc+sd-jwt),内含 AP2 open payment mandate,说明用户批准了什么。签名使用 Clink 的 ES256 私钥,agent 无法访问该私钥。

调用前提

授权必须是 ACTIVE、未过期、已绑定卡,并且在创建时带上了 agent_public_key。其他情况一律失败且不产生凭证: 创建授权不等于批准。用户需要在 Clink 页面上用 passkey 完成批准,之后该接口才会返回凭证。

凭证结构

线格式:<issuer-signed JWT>~<mandate>~<instrument 1>~...~。
  • jti 就是 instruction id,exp 就是 instruction 的 effective_until_time,也就是响应里的 expires_at。
  • cnf 是 agent 公钥;需要 key binding 的验证方要求 agent 用对应私钥另签一个 JWT(Clink 不签发 这个 JWT)。
  • constraints 里有 payment.amount_range(单笔支付上限,最小货币单位)和 payment.allowed_payment_instruments(每张被批准的卡一个摘要)。
  • 每张卡都是独立 disclosure,agent 可以只揭示商户接受的那一张。
同一授权每次调用都会重新序列化一份凭证,jti 与批准条款不变。

验证方式

  1. 取 GET <issuer>/.well-known/jwt-vc-issuer,用凭证 header 里的 kid 选中对应公钥。
  2. 验证 issuer JWT 签名。
  3. 对每个被揭示的 disclosure 计算哈希,与上一层摘要比对:instrument 对 allowed,mandate 对 delegate_payload。
  4. cnf、iat、exp 在签名区与 mandate 里两份不一致时拒绝。

它不做什么

凭证只记录用户同意,不授予新能力。能否支付仍由 Clink 在支付时按 instruction、mandate 和 usages 判断。撤销授权由用户在 Clink 页面上完成,不通过本接口。

授权

Authorization
string
header
必填

Portal user token from POST /agent/cwallet/platform/portal/tokens. Reads require portal:read; writes require portal:write.

路径参数

instructionId
string
必填

Instruction ID.

示例:

"inst_..."

响应

Success

code
integer<int32>
示例:

200

msg
string
示例:

"Success"

data
object

Signed SD-JWT VC recording what the user approved for this authorization.