Login as Sub-Account

Authenticate into a single sub-account context, choose when to use scoped tokens versus header-based scoping, and operate safely on one downstream customer at a time.

Login as Sub-Account

Authenticate into a specific sub-account context when you need a token that is limited to one downstream customer’s wallets, balances, transactions, and payout activity.


✅ Before you log in as a sub-account

Complete these steps first:

  1. Create the sub-account and store its ID.
  2. Authenticate successfully with your master credentials.
  3. Decide whether you need a scoped token or whether master auth + X-Sub-Account-Id is enough for your use case.
  4. Use scoped auth only when the session should be limited to a single customer context.

The Scoped Token Pattern

By passing a subAccountId during the login handshake, Verto returns a JWT that is limited strictly to that user's resources. This is the recommended pattern for building user-facing dashboards.

ParameterTypePurpose
clientIdStringYour master client identifier.
apiKeyStringYour master API key (encrypted if using Certificates).
subAccountIdStringThe ID of the specific customer (e.g., sub_acc_123).

When to use scoped auth vs header scoping

Use the approach that matches how your application is structured:

ApproachBest forHow it works
Scoped tokenUser-facing dashboards and customer-specific sessionsAuthenticate once with subAccountId and use the returned token for that customer's actions.
Master token + X-Sub-Account-IdServer-side orchestration across many sub-accountsKeep one master session and scope each request with the correct sub-account header.

🚀 Execution Workflow

Authenticate as the sub-account to receive a context-locked accessToken.

curl -X POST https://api.sandbox.vertofx.com/v2/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "apiKey": "YOUR_API_KEY",
    "mode": "apiKey",
    "subAccountId": "sub_acc_778899"
  }'

Store the returned scoped token separately from your master token. Use it only for operations that should be limited to that one downstream customer.


🏗️ Token Capabilities

Once you have the scoped token, you can perform the following actions without needing to pass the X-Sub-Account-Id header manually in every call, as the token already carries that identity.

CapabilityScope
Wallet ManagementCreate wallets and fetch balances for this user only.
Transaction LogsQuery history scoped to this specific sub-account.
FX ConversionSwap currencies using the sub-account's liquidity.
PayoutsDispatch funds from sub-account wallets to external rails.

Use this model when you want to reduce the risk of acting on the wrong downstream customer by mistake.

Troubleshooting

IssueWhat to check
Scoped login failsConfirm the subAccountId exists and belongs to the platform context tied to your master credentials.
Requests still affect the wrong customerVerify you are using the intended scoped token and not accidentally reusing the master token.
Customer cannot access balances or walletsConfirm the sub-account is active and has the wallets or resources you expect in that context.

🎯 Next Steps

Wallets Guide →
Manage the sub-account's ledgers.
Sub-Accounts Overview →
Review the full sub-account lifecycle.