Skip to main content
Every trading action in Plurex happens on an account, and every account belongs to a tenant. This page explains both, how accounts are created on real and paper hosts, and which account operations are safe to retry.

Tenants

The tenant is the owner of your trading resources. Every account belongs to exactly one tenant, and your API keys are created under it.
  • Find your tenant ID next to your API keys on the DevTools page of the Plurex app.
  • API keys act as the tenant. A request signed with your X-API-KEY and X-API-SECRET has full access to the tenant’s accounts.
  • Tenant-wide operations take a tenantId: Connect, List accounts and Create a paper account.
See Authentication for creating keys and sending them.

Accounts

An account is your account on one host. It lives on exactly one host for its whole life, and every operation on it takes only its accountId: Plurex resolves the host and checks your access from the account itself. You never pass a hostId or tenantId to trade.
credential.publicValue is the non-secret part of the credential, such as the API key, so you can tell which key an account uses. The secret is never returned. For a paper account publicValue is null and credentialType is Paper.

Real and paper accounts

Creation is the only part that differs: connecting an account links an existing exchange account, while creating a paper account starts a new simulation. After that, both kinds are traded and managed through the same operations, so code written against a paper account runs against a real one by switching the accountId. Read each host’s capabilities before you switch, because paper and real hosts publish their own. See Going live.

Connecting an exchange account

Connect adds an exchange account using its API credentials. The host must list ApiKey in supportedCredentialTypes.
Before connecting, Plurex checks the key with the host:
  • The key must allow reading and trading. Plurex needs to read your orders, balances and positions, and to place and cancel orders.
  • Bybit keys must belong to a Unified Trading Account.
  • A refused key creates no account. Connect verifies the key with the exchange and refuses it if the exchange rejects it or the key cannot read and trade. Retrying with the same key will not help: fix the key’s permissions at the exchange, or create a new key, then connect again.
To connect through the web app instead, see Add an exchange.

Creating a paper account

Create a paper account takes your tenantId, a name and the hostId of a paper host. Find paper hosts with List hosts: they have isPaper: true, and modelHostId names the real host each one simulates.
A new paper account starts with no balances; fund it with Deposit. The number of paper accounts may be limited by your plan; at the limit, the call returns 422 AccountLimit. See Paper trading.

Account lifecycle

For example, to list only your paper accounts:

Retry safety

A timeout or 5xx does not prove that a command had no effect. Each account operation tells you how to recover: Identify the new account by what it is, not by its name: after an unclear Connect, look for an account on the hostId you sent whose credential.publicValue is the exchange key you sent; after an unclear Create, compare the list for that paper hostId with the accounts you already knew about. Names are labels for you; don’t rely on them to tell accounts apart.

Errors to expect

See Errors for the full list.