Logon (35=A)
Authenticates and opens a FIX session. Must be the first message sent by the application requesting to initiate a FIX session.
Structure
Requires:
Message body
| Tag | Name | Type | Required | Description |
|---|---|---|---|---|
98 | EncryptMethod | Int | Y | Must be: 0 None / Other. |
108 | HeartBtInt | Int | Y | Heartbeat interval in seconds. Recommended value: 30. |
141 | ResetSeqNumFlag | Boolean | N | Indicates that both sides of the FIX session should reset sequence numbers. Can be:
|
553 | Username | String | Y | Your API key. |
554 | Password | String | Y | HMAC-SHA256 hex-encoded signature created from your API secret. |
5001 | EnableCOD | Boolean | N | Custom Bitvavo tag Indicates whether to enable Cancel on Disconnect feature for this session. Can be:
|
Cancel on disconnect
You can use Cancel on disconnect to automatically cancel your open orders if there is no heartbeat received within the specified interval.
This prevents orders remaining open and being filled at unfavorable prices while you are disconnected. To enable this, set the EnableCOD (5001) tag to Y.
Create a signature
Before testing, request your UAT credentials from your Bitvavo contact. For the live environment, use your your production API credentials.
- Prepare the input values:
-
api_key: YOUR_API_KEY -
SenderCompID: YOUR_UNIQUE_ACCOUNT_IDENTIFIER -
seqNum: 1 -
sendingTime: the Unix timestamp in milliseconds, converted from the value of the FIX header tag52generated by your FIX engine, for example: 1700000000123importantFIX engines automatically populate this field when you create the Logon message. Your app must read the value from the message header for every Logon message and convert it to milliseconds since Unix epoch to generate the signature.
SendingTime to Unix timestamp in millisecondsSendingTime (tag 52) = 2023-11-14T12:13:20.123ZsendingTime (ms) = 1700000000123
- Concatenate the values without a delimiter:
Concatenated stringYOUR_API_KEYYOUR_UNIQUE_ACCOUNT_IDENTIFIER11700000000123
- Prepare the API
secretfor associated with your API key. For example:API secretbitvavo - To get the
Password, encode the concatenated string to HMAC-SHA256 using the APIsecretfor your APIkey.Generation logicpassword = hmac.new(secret, message_input_str, hashlib.sha256).hexdigest() - You get the following signature to use as the
Password:Signature50b24049b5764748e7d1096449959fb01254fb326d86aaf04dff6c2993fe41a6