Get payment credential
curl --request GET \
--url https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential")
.header("Authorization", "Bearer <token>")
.asString();import requests
url = "https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "Success",
"data": {
"credential": "<sd-jwt>",
"jti": "inst_...",
"vct": "https://clinkbill.com/vct/agent-mandate/1",
"expires_at": "2026-12-31T00:00:00Z"
}
}{
"code": 123,
"msg": "<string>"
}{
"code": 123,
"msg": "<string>"
}Authorizations
获取支付凭证
Issues the signed SD-JWT VC payment approval credential for this authorization. Only available once the instruction is ACTIVE, unexpired, has a bound card and was created with agent_public_key; otherwise the request fails closed and no credential is produced. jti is the instruction id and exp is the instruction’s effective_until_time.
GET
/
agent
/
platform
/
authorizations
/
{instructionId}
/
payment-credential
Get payment credential
curl --request GET \
--url https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential")
.header("Authorization", "Bearer <token>")
.asString();import requests
url = "https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://uat-api.clinkbill.com/agent/platform/authorizations/{instructionId}/payment-credential', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "Success",
"data": {
"credential": "<sd-jwt>",
"jti": "inst_...",
"vct": "https://clinkbill.com/vct/agent-mandate/1",
"expires_at": "2026-12-31T00:00:00Z"
}
}{
"code": 123,
"msg": "<string>"
}{
"code": 123,
"msg": "<string>"
}返回该客户某个授权的签名支付授权凭证:一个 SD-JWT VC(
创建授权不等于批准。用户需要在 Clink 页面上用 passkey 完成批准,之后该接口才会返回凭证。
typ: dc+sd-jwt),内含 AP2 open
payment mandate,说明用户批准了什么。签名使用 Clink 的 ES256 私钥,agent 无法访问该私钥。
调用前提
授权必须是ACTIVE、未过期、已绑定卡,并且在创建时带上了
agent_public_key。其他情况一律失败且不产生凭证:
| 状态 | 含义 |
|---|---|
409 | 未 ACTIVE、已过期、没有绑卡、授权包含多个 mandate(请按 mandate 拆分授权),或金额无法用最小货币单位精确表示 |
422 | 授权没有存 agent_public_key,无法把凭证绑定到该 agent |
凭证结构
线格式:<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 与批准条款不变。
验证方式
- 取
GET <issuer>/.well-known/jwt-vc-issuer,用凭证 header 里的kid选中对应公钥。 - 验证 issuer JWT 签名。
- 对每个被揭示的 disclosure 计算哈希,与上一层摘要比对:instrument 对
allowed,mandate 对delegate_payload。 cnf、iat、exp在签名区与 mandate 里两份不一致时拒绝。