# Sell a paper prop account from a template

`create-prop` provisions the account, the prop account and the paper trading
state in one transaction. When this is done a trader has an `active` evaluation
they can place orders against immediately — no agreement step, no deposit.

1. ### Pick the template

   You need two ids from the same row: the template `id` and the firm that owns
   it, `propTenantId`. Only `active` templates can be sold.

   ```bash
   curl -s "https://api.troncharts.xyz/api/v1/prop-templates?activeOnly=true" \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG"
   # → { "templates": [ { "id": "acme-25k-two-step", "propTenantId": "…", … } ] }
   ```
   ```ts
   const { templates } = await sdk.propTemplates.list({ activeOnly: true })
   ```
2. ### Identify the owner user

   A bearer credential has no user session, so it must name the user the new
   account belongs to. `ownerUserId` must be a user in your tenant — omit it and
   you get 400 `owner_user_required`; pass a stranger's id and you get 404
   `owner_user_not_found`.

   :::note[There is no public endpoint that creates a user]
   Users arrive through your tenant's own sign-up flow or through an operator in
   the admin console. Read the id from the user record you already hold — this
   recipe assumes one exists.
   :::

3. ### Create the account

   `propTenantId` must be a UUID (the firm id from step 1). `baselineUsd` seeds
   the simulated cash balance and defaults to `10000` — it is separate from the
   template's `accountSizeUsd`, which is what the rules judge. Pass it
   explicitly if you want the two to match.

   ```bash
   curl -s https://api.troncharts.xyz/api/v1/accounts/create-prop \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG" \
     -H 'content-type: application/json' \
     -d '{
       "templateId": "acme-25k-two-step",
       "propTenantId": "'"$FIRM_ID"'",
       "mode": "paper",
       "ownerUserId": "'"$USER_ID"'",
       "displayName": "Acme 25K — run 1"
     }'
   # → 201 { "mode": "paper", "accountId": "…", "accountNumber": "100042",
   #         "propAccount": { "status": "active", "startedAt": "…", … } }
   ```
   ```ts
   const res = await sdk.accounts.createProp({
     templateId: 'acme-25k-two-step',
     propTenantId: firmId,
     mode: 'paper',
     ownerUserId,
   }) as { accountId: string; accountNumber: string }
   ```
   The prop account lands `status: 'active'` with `startedAt` set. Rejections
   to expect: 404 `template_not_found`, 400 `template_inactive`, and 400
   `template_mode_unsupported` when the template is marked live-only.

4. ### Reset the run when you need a clean slate

   Paper accounts are resettable: balance and positions go back to the account
   size, breach state clears, and the evaluation window restarts at its original
   length. Live and funded accounts reject with 400 `not_paper`.

   ```bash
   curl -s -X POST https://api.troncharts.xyz/api/v1/prop-accounts/$PROP_ACCOUNT_ID/reset \
     -H "authorization: Bearer $TOKEN" \
     -H "x-tenant-slug: $TC_TENANT_SLUG"
   ```
   ```ts
   await sdk.propAccounts.reset(propAccountId)
   ```
   :::caution[`mode: "live"` is not an API-only flow]
A live sale binds a wallet and lands `pending_payment`; a bearer credential has
no wallet, so it returns `wallet_required_for_live`. The account only reaches
`active` when the trader's on-chain USDC deposit emits `ChallengeDeposited` —
a signed transaction, not a call you can make here.
:::

:::note[Want a throwaway account with no firm or template?]
`POST /api/v1/sandbox/paper-account` provisions the whole chain in one call, but
it ships disabled (`SANDBOX_PROVISIONING_ENABLED` defaults `false`) and 404s
until an operator enables it on your deploy.
:::

**Next:** [Create a challenge template](https://docs.troncharts.xyz/docs/recipes/create-a-challenge-template/) ·
[Prop account model](https://docs.troncharts.xyz/docs/launch/prop-accounts/) ·
[Launch a prop firm](https://docs.troncharts.xyz/docs/launch/prop-firm/)