Skip to content

Onboard an end customer

When your own platform owns the customer relationship — sign-up, risk, order entry — you onboard each end customer through the API. Every customer becomes a trader of their own in your tenant, with their own account and their own trader credential, so the admin console, reports and risk views show them individually.

  1. Get an operator credential with prop management

    Section titled “Get an operator credential with prop management”

    In the admin console, Developers → Create API client, tick Prop management. Mint its token as usual (see Mint a token). This credential provisions and supervises; it never places orders. See Trader vs operator.

  2. Pick the template the account is created from

    Section titled “Pick the template the account is created from”

    Every account is created from a template, which carries the starting balance, currency, trading group and risk profile.

    Terminal window
    curl -s https://api.troncharts.xyz/api/v1/prop-templates \
    -H "authorization: Bearer $OPERATOR_TOKEN"
    # → { "templates": [ { "id": "…", "accountSizeUsd": "50000.00", "active": true, … } ] }
  3. Create the customer, the account and the trader credential

    Section titled “Create the customer, the account and the trader credential”

    One call does all three. owner creates the customer the first time you send their externalId (your own id for them) and reuses it afterwards; the account and the credential are created in the same transaction, so you never end up with an account you cannot trade.

    Terminal window
    curl -s https://api.troncharts.xyz/api/v1/accounts/create-prop \
    -H "authorization: Bearer $OPERATOR_TOKEN" \
    -H 'content-type: application/json' \
    -d '{
    "templateId": "'"$TEMPLATE_ID"'",
    "mode": "paper",
    "owner": { "externalId": "customer-42", "email": "ana@example.com", "displayName": "Ana" },
    "issueTraderCredential": true
    }'
    {
    "mode": "paper",
    "accountId": "…",
    "accountNumber": "150400",
    "propAccount": { "id": "…", "templateId": "…", "startEquityUsd": "50000.00", … },
    "owner": { "id": "…", "created": true },
    "traderCredential": {
    "id": "…", "apiKey": "pk_…", "apiSecret": "sk_…", "tier": "fullTrading"
    }
    }

    The apiSecret is returned once. Store it with the customer record on your side.

    Field Notes
    owner externalId, email, walletAddress, displayName; at least one of the first three. Use ownerUserId instead for a customer created earlier with POST /api/v1/users.
    issueTraderCredential true to receive the trader credential. Only an operator credential may ask: a trader credential gets 403 wrong_credential_audience. A value that is not a boolean is 400 invalid_body.
    baselineUsd Optional. Overrides the template’s starting balance for this account.
    displayName Optional account label shown in the admin console.
  4. Trade the account with the trader credential

    Section titled “Trade the account with the trader credential”

    Mint a token from the trader credential and use it for everything on that account: orders, reads and the /ws/risk socket.

    Terminal window
    curl -s https://api.troncharts.xyz/api/v1/oms/intents \
    -H "authorization: Bearer $TRADER_TOKEN" \
    -H 'content-type: application/json' \
    -H "idempotency-key: $(uuidgen)" \
    -d '{"venue":"paper","symbol":"BTC.HL","side":"buy","type":"market","qty":"0.001"}'

    See Place your first order and Stream account updates.

  5. The operator credential cannot read into the account, but it can act on it. When your own risk rules decide to stop a customer, block the account; the block reaches the open socket as Account-Suspension-Update.

    Terminal window
    curl -s -X POST https://api.troncharts.xyz/api/v1/accounts/$ACCOUNT_ID/block \
    -H "authorization: Bearer $OPERATOR_TOKEN" \
    -H 'content-type: application/json' \
    -d '{"reason":"daily loss limit"}'
    # and later: POST /api/v1/accounts/$ACCOUNT_ID/unblock

Next: Trader vs operator · Orders & OMS · Order lifecycle