Skip to main content

Backend only

The Blend SDK and API must be called from your backend server. Never call them from a browser, mobile app, or any client-side code. Your API key is sent with every request. Exposing it in frontend code leaks your credentials and compromises your integration.
Run the SDK from a Node.js server, a Next.js API route, or any server-side environment. Your frontend talks to your backend. Your backend talks to Blend.
User's browser → Your backend server → Blend SDK / API
This applies to both the SDK (@blend-money/sdk) and direct API calls to /extern/:neobankId/:accountTypeId/*.

Bootstrap accounts first

Every SDK method that reads or writes user data requires an accountId. You get it by calling client.safe.account(userEoa). This is the first call you make for any user.
const account = await client.safe.account(userEoa);
// account.accountId → required for everything else
Without an accountId, you cannot:
  • Fetch balances, positions, or returns
  • Request deposit quotes
  • Generate withdrawal calldata
  • Resolve or deploy Safes on specific chains
Call it once per user, store the result, and pass accountId to every subsequent call.

Persist the account mapping

Store the Blend accountId against your internal user ID. You need this mapping for every future request on behalf of that user.
Your user table
┌──────────────┬──────────────────────────┐
│ internal_id  │ blend_account_id         │
├──────────────┼──────────────────────────┤
│ user_123     │ abc-def-ghi-jkl          │
│ user_456     │ mno-pqr-stu-vwx          │
└──────────────┴──────────────────────────┘

Handle Safe deployment

A resolved account does not mean the Safe is deployed on-chain. Before the user’s first deposit on a chain, check deployment status and request deployment if needed.
const resolved = await client.safe.resolve(account.accountId, 8453);

if (resolved.status === "not-deployed") {
  await client.safe.request(account.accountId, 8453);
}
Your neobank pays a per-account deployment fee that covers gas and Safe setup. See Integration Fees for details.

Don’t retry 409 conflicts

A 409 response on withdrawal means a rebalance is in progress. Don’t silently retry. Surface it as a product-level message to the user. The rebalance will complete on its own. Retry the withdrawal once the account settles.

Next steps

SDK Accounts

Full reference for account bootstrapping and read APIs.

Deposit & Withdraw

End-to-end deposit and withdrawal flows.
Last modified on March 20, 2026