# Admin messages

## Logon\<A> <a href="#logon" id="logon"></a>

Logon request should be sent by the client to start a FIX session. It must be the first message after establishing the connection. Only one session can be established per connection.

In the event of successful authorization the client receives Logon auth confirmation.

In case of authorization error, Logout<5> message will be sent to the client, with Text<58> field of the following format: `Auth error: <FM_error_code>`, where `FM_error_code` is FineryMarkets error code, e.g. `Auth error: 6`.

<table><thead><tr><th width="150" align="center">Tag</th><th width="200" align="center">Name</th><th width="150" align="center">R</th><th align="center">Example</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">98</td><td align="center">EncryptMethod</td><td align="center">Y</td><td align="center">0</td><td align="center">Should be set to 0</td></tr><tr><td align="center">108</td><td align="center">HeartBtInt</td><td align="center">Y</td><td align="center">30</td><td align="center">Should be set to 30</td></tr><tr><td align="center">553</td><td align="center">Username</td><td align="center">Y</td><td align="center">fjQxw2IJGOeJ9dg1Raam5iudLQUz9mmew3CSVassPx2</td><td align="center">Should be set to the client’s API key</td></tr><tr><td align="center">554</td><td align="center">Password</td><td align="center">Y</td><td align="center">PA8Fh8Gu4OP7pvDPu42zqV29H2sZIPRnfQTnPq4J5mH</td><td align="center">Signature(see below)</td></tr><tr><td align="center">95</td><td align="center">RawDataLength</td><td align="center">N</td><td align="center">128</td><td align="center">Raw Data Length</td></tr><tr><td align="center">96</td><td align="center">RawData</td><td align="center">N</td><td align="center">See below</td><td align="center">Login Data(see below)</td></tr><tr><td align="center">141</td><td align="center">ResetSeqNumFlag</td><td align="center">Y</td><td align="center">Y</td><td align="center">Reset sequence num on establishing the new session. Should be set to Y.</td></tr><tr><td align="center">957</td><td align="center">CancelOnDisconnect</td><td align="center">N</td><td align="center">1</td><td align="center">If >0 then all orders in this session will be marked as CancelOnDisconnect. Enabled by default.</td></tr></tbody></table>

### Signature

For security, the Logon message must be signed by the client. To compute the signature, take **RawData<96>** field contents and compute SHA384 HMAC using the API secret. The resulting hash should be Base64-encoded.&#x20;

### LoginData

Login data is json of the following structure:

```
{
    "nonce": <Any monotonically increasing value>,
    "timestamp": <Unix-timestamp>
}
```

**timestamp** is a Unix timestamp with a milliseconds precision.

**nonce** should be monotonically increasing across all the requests issued with particular API key(i.e. if using the same key for FIX as WS connections, nonce should be monotonic across all requests for both connections)

Although **RawData<96>** and **RawDataLength<95>** are not marked as required, the client should provide both of them for successful authentication.

## **Logout<5>** <a href="#logout" id="logout"></a>

Logout request sent by either side to terminate the session. The other side should respond with another Logout message to acknowledge session termination. The connection will be closed afterwards.

<table><thead><tr><th width="150" align="center">Tag</th><th width="200" align="center">Name</th><th width="150" align="center">R</th><th align="center">Example</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">58</td><td align="center">Text</td><td align="center">N</td><td align="center">Shutdown</td><td align="center">Can hold a reason of session termination</td></tr></tbody></table>

## Test Request<1>

Test request can be used by either side to force sending Heartbeat<0> message.

<table><thead><tr><th width="150" align="center">Tag</th><th width="200" align="center">Name</th><th width="150" align="center">R</th><th align="center">Example</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">112</td><td align="center">TestReqID</td><td align="center">Y</td><td align="center">20220420T081324Z</td><td align="center">Should contain request date and time in ISO 8601 format</td></tr></tbody></table>

## Heartbeat<0>

Sent by either side if a message has not been received in the past **HeartBtInt<108>** seconds. Should also be sent in response to a **TestRequest<1>**.

<table><thead><tr><th width="150" align="center">Tag</th><th width="200" align="center">Name</th><th width="150" align="center">R</th><th align="center">Example</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">112</td><td align="center">TestReqID</td><td align="center">N</td><td align="center">20220420T081324Z</td><td align="center">Required when the heartbeat is the result of a Test Request &#x3C;1> message. If the case it should contain same value as TestReqID&#x3C;112> in the TestRequest&#x3C;1> message.</td></tr></tbody></table>

## Reject<3>

Sent by the server in response to an invalid message.

<table><thead><tr><th width="150" align="center">Tag</th><th width="200" align="center">Name</th><th width="150" align="center">R</th><th align="center">Example</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">45</td><td align="center">RefSeqNum</td><td align="center">Y</td><td align="center">2</td><td align="center">MsgSeqNum&#x3C;34> of the rejected message</td></tr><tr><td align="center">373</td><td align="center">SessionRejectReason</td><td align="center">N</td><td align="center">1</td><td align="center">Code identifying session reject reason(see below)</td></tr><tr><td align="center">58</td><td align="center">Text</td><td align="center">N</td><td align="center">Missing quantity</td><td align="center">Human-readable rejection reason description</td></tr><tr><td align="center">371</td><td align="center">RefTagID</td><td align="center">N</td><td align="center">38</td><td align="center">The tag number of the FIX field being referenced.</td></tr><tr><td align="center">372</td><td align="center">RefMsgType</td><td align="center">N</td><td align="center">D</td><td align="center">The MsgType&#x3C;35> of the FIX message being referenced.</td></tr></tbody></table>

### **Rejection codes:**

<table><thead><tr><th width="150" align="center">Code</th><th align="center">Reason</th></tr></thead><tbody><tr><td align="center">0</td><td align="center">Invalid tag number</td></tr><tr><td align="center">1</td><td align="center">Required tag missing</td></tr><tr><td align="center">2</td><td align="center">Tag not defined for this message type</td></tr><tr><td align="center">3</td><td align="center">Undefined Tag</td></tr><tr><td align="center">4</td><td align="center">Tag specified without a value</td></tr><tr><td align="center">5</td><td align="center">Value is incorrect (out of range) for this tag</td></tr><tr><td align="center">6</td><td align="center">Incorrect data format for value</td></tr><tr><td align="center">7</td><td align="center">Decryption problem</td></tr><tr><td align="center">8</td><td align="center">Signature&#x3C;89> problem</td></tr><tr><td align="center">9</td><td align="center">CompID problem</td></tr><tr><td align="center">10</td><td align="center">SendingTime&#x3C;52> accuracy problem</td></tr><tr><td align="center">11</td><td align="center">Invalid MsgType&#x3C;35></td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://faq.finerymarkets.com/api-reference/fix-api/admin-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
