開發者

一個 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_…——切勿混用主機。

開發者 · Identity Inc.