开发者
一个 API,服务所有产品。
先完成身份核验,再创建受赞助账户,然后绑定并解锁。你的 API 密钥始终留在自己的服务器上——浏览器或移动应用与你的后端通信,你的后端再与我们通信。支持 WharfKit 钱包会话与通行密钥。
const baseUrl = process.env.BOUND_IDENTITY_URL!;
const apiKey = process.env.BOUND_IDENTITY_API_KEY!; // server-side only
async function identityFetch(path, init) {
const res = await fetch(baseUrl + path, {
...init,
headers: {
Authorization: "Bearer " + apiKey,
Accept: "application/json",
"Content-Type": "application/json",
...init?.headers,
},
});
const body = await res.json();
if (!res.ok) throw new Error(body.message || "HTTP " + res.status);
return body;
}
// 1. Verify the person first — no chain account yet (default organization policy).
const { personDid, verificationUrl } = await identityFetch("/v1/kyc/start", {
method: "POST",
body: JSON.stringify({}),
});
// … open verificationUrl from your KYC provider …
// 2. When approved, take the one-time create token.
const { kycCreateToken } = await identityFetch(
"/v1/kyc/status?personDid=" + encodeURIComponent(personDid),
);
// 3. Sponsor the provisional account. Token replay is rejected.
const { accountDid } = await identityFetch("/v1/accounts/free", {
method: "POST",
body: JSON.stringify({
ownerPublicKey,
personDid,
kycCreateToken,
// Production also requires emailProofToken + phoneProofToken
}),
});
// 4. Bind the approved person to this account: the user signs once.
const { payloadToSign, message } = await identityFetch("/v1/bind/challenge", {
method: "POST",
body: JSON.stringify({ accountDid, personDid }),
});
await identityFetch("/v1/bind/confirm", {
method: "POST",
body: JSON.stringify({
accountDid,
personDid,
nonce: message.nonce,
signature, // WharfKit / passkey over payloadToSign
}),
});
// 5. Lift faucet limits. Done.
await identityFetch("/v1/accounts/unlock", {
method: "POST",
body: JSON.stringify({ accountDid }),
});任何身份证件都不会经过你的代码,任何密钥都不会到达浏览器。默认组织在 KYC 通过之前拒绝免费创建账户。先对接 sandbox.identityinc.io 沙箱——免费测试核验、模拟链——再把生产流量切到 Builder 或 Growth。
指南与参考
快速入门、身份验证、Webhook 以及 API 返回的所有错误代码。以英文发布。
API
OpenAPI 规范:https://identityinc.io/openapi.yaml。生产:https://api.identityinc.io。沙箱:https://sandbox.identityinc.io(bi_test_ 密钥、免费测试核验、模拟链)。本地开发默认使用 http://127.0.0.1:4100。
每个产品一把密钥
为你运营的每个产品单独签发 API 密钥——你的钱包、你的交易平台、你的核心银行集成。每把密钥只能看到自己的数据;隔离由 API 强制执行,而不是靠约定。沙箱密钥是 sandbox.identityinc.io 结账得到的 bi_test_…;生产密钥是 identityinc.io 注册得到的 bi_…——切勿混用主机。