> For the complete documentation index, see [llms.txt](https://fundamental-interactions-inc.gitbook.io/websocket-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fundamental-interactions-inc.gitbook.io/websocket-api/trading-api.md).

# USERS

After login, the following trading APIs functions are available to the client.

* `“adduser`”&#x20;
* `“deposit”`
* `“withdraw”`&#x20;
* `“querydeposit”`
* `“querytrade”`
* `“logout”`
* `“getsymbols”`
* `“addorder”`&#x20;
* `“cancelorder”`

**MESSAGE UPDATES FROM FI TO CLIENTS**

FI will send current open orders and position info to the client upon login. If client places a new order, FI will send client an order update automatically. If there is trade, client will receive a trade update and corresponding position updates.

**ADD USERS**

Administrator account can use this command to add additional users. Ordinary user can use this command to update password.&#x20;

The `"userid"` is what a user uses to login, but alongside that id you can separately set a `"complianceid"` also known as a `"traderid"`. If the `"complianceid"` is not set it will default to be the `"userid"`.

Here is a request sample, again “pass” field needs to be encrypted using pubic key from challenge response.

**SAMPLE REQUEST ADD USERS**

```
{“type”:”adduser”,”userid”:”testuser@gmail.com”,”pass”:”SZ7DMkMnU5qBszWkABPHsUjkPKol
cmWXbSdaydjsMOJG/CnujgQhm4vRWWr6BQmH9SsU7fFeheGYatTIL+n0yC+C0TqaOipSpC7rDSa
pveEsqHJTPgXYXeOb34wj76IHdv44UwT2Vr9Db+t6Q0K1j
wITy7/CxOqpYRea5g7Zt7A=”}
```

**SAMPLE RESPONSES SUCCESS OR FAILURE**

```
{“result”:”password
issue”,”userid”:”testuser@gmail.com”,”type”:”adduser”,”pass”:”SZ7DMkMnU5qBszWkABPHsUjk
PKolcmWXbSdaydjsMOJG/CnujgQhm4vRWWr6BQmH9SsU7fFeheGYatTIL+n0yC+C0TqaOipSpC
7rDSapveEsqHJTPgXYXeOb34wj76IHdv44UwT2Vr9Db+t6Q0K1j
wITy7/CxOqpYRea5g7Zt7A=”}

{“result”:”OK”,”userid”:”testuser@gmail.com”,”type”:”adduser”,”pass”:”ay5bjq6rONPIjDoEwHd
y6TZQzyzdcivSJQ6ReNdmAEQofuTC5WYnl1i5Qf7SA5c7owpN6IaODZkyb+WAN/gFylHzcSrmSme
DX9ZsuR/1AOEOeqCjlkgfEuLoaLdItYGcxOQoCDJwOl9sN81SbYxlurqq10ZLk53B9W+gAcwamZY=”
}
```

This "attr" property is an object which can contain any number of keys within it. In this "attr" property you can store any user data that you need - such as address, name, email and etc.

Updating user data with the `"adduser"` message.&#x20;

* `“adduser”` command can be used for both adding user and updating user profile.
* `"updateprof”`, true:false, if you set it to true, this is to update existing user profile.&#x20;

Superuser can update fields such as “active”, password… any field. Ordinary user can update his own password and should be allowed to update `“attr”` field also. (This way, user’s own preference can be saved by user directly, that is why account management items should be outside “attr” field)&#x20;

Below is an example of updating "active", you need to set “active” besides setting “updateprof” to true.&#x20;

**REQUEST TO SET ACTIVE**

```
 {"type":"adduser","updateprof":true, active:"Y",userid":"what_is@gmail.com"} 
```

**RESPONSE TO SET ACTIVE**

```
{"result":"OK","updateprof":"true,"userid":"what_is@gmail.com","type":"adduser"}
```

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fundamental-interactions-inc.gitbook.io/websocket-api/trading-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
