> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Coinbase Prime FIX 4.2 → FIX 5.0 SP2 Order Entry Migration Guide

> Migrate order entry integrations from the Coinbase Prime FIX 4.2 API to FIX 5.0 SP2.

## Overview

This guide covers every breaking change and behavioral difference you need to address when migrating your Coinbase Prime FIX integration from version 4.2 to FIX 5.0 SP2. Changes are organized by area so you can work through your codebase systematically.

## Biggest Changes

* FIX 5.0 SP2 uses a transport-layer split (`FIXT.1.1`) that separates session-level and application-level protocol versioning. This is the most foundational change and affects your session config before anything else.
* We now have [published dictionaries](./dictionaries.mdx). See the [FIX 5.0 order entry docs](./order-entry.mdx) for the detailed specification.
* Multiple security type support is the other major structural addition. `SecurityType (167)` is now required on every outbound order related message:
  * Add `SecurityType (167)` to every `NewOrderSingle`, `OrderCancelRequest`, `OrderCancelReplaceRequest`, and `OrderStatusRequest`
  * For all existing spot orders, set `SecurityType = SPOT`.
* Fill reporting now follows the FIX standard. In FIX 4.2, all fills used `ExecType = 1` (Partial Fill) regardless of whether the order was fully complete, and multi-fill orders received `OrdStatus = 1` (Partial Fill) on their final fill. FIX 5.0 SP2 corrects both:
  * `ExecType (150)` is now `F` (Trade) on every fill
  * `OrdStatus (39)` now correctly reflects the true state of the order at the time of each fill — `1` (Partial Fill) while open quantity remains, `2` (Filled) on the final fill

## What Has Not Changed

* **Connection endpoint.** FIX 5.0 order entry is serviced at the same URL and port as FIX 4.2: `tcp+ssl://fix.prime.coinbase.com:4198`
* **Message types.** All message types from FIX 4.2 are present in FIX 5.0. Some have tag and value level changes which are noted in full detail below.

## 1. Session / Logon (35=A)

| Field                   | FIX 4.2 Value | FIX 5.0 SP2 Value | Notes                                                                                                                  |
| :---------------------- | :------------ | :---------------- | :--------------------------------------------------------------------------------------------------------------------- |
| BeginString (8)         | `FIX.4.2`     | `FIXT.1.1`        | Required change. FIX 5.0 SP2 uses the FIXT transport layer which separates session and application protocol versioning |
| DefaultApplVerID (1137) | (not set)     | `9`               | New — required. Must be set alongside `FIXT.1.1` to declare the application version                                    |
| AccessKey (9407)        | API key ID    | (remove)          | Removed. Tag 9407 is no longer read — remove it from your Logon message                                                |
| Username (553)          | (not set)     | API key ID        | New — required. Replaces tag 9407 as the field for your API key ID                                                     |

## 2. NewOrderSingle (35=D)

| Field                | FIX 4.2 Value           | FIX 5.0 SP2 Value             | Notes                                                                                                                                                                             |
| :------------------- | :---------------------- | :---------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SecurityType (167)   | (not set)               | `SPOT` / `FUT` / `PERP`       | New — required. Must be present on every order. Use `SPOT` for all existing spot orders                                                                                           |
| HandlInst (21)       | `1` (required)          | (remove)                      | Removed. No longer read by the server. Sending it will not cause a reject but it is not required                                                                                  |
| TargetStrategy (847) | Required on every order | Only needed for TWAP and VWAP | Omit TargetStrategy (847) for Market, Limit Orders, Stop-Limit and PEG Orders<br />Update TargetStrategy (847) values — update TWAP from `T` to `1001`, and VWAP from `V` to `1`. |
| Iceberg/display size | MaxShow (210)           | DisplayQty (1138)             | Replace MaxShow (210) with DisplayQty (1138) for iceberg orders                                                                                                                   |

## 3. OrderCancelRequest (35=F)

| Field              | FIX 4.2 Value | FIX 5.0 SP2 Value       | Notes                                                   |
| :----------------- | :------------ | :---------------------- | :------------------------------------------------------ |
| SecurityType (167) | (not set)     | `SPOT` / `FUT` / `PERP` | New — required. Must be present on every cancel request |

## 4. OrderCancelReplaceRequest (35=G)

| Field              | FIX 4.2 Value  | FIX 5.0 SP2 Value       | Notes                                                    |
| :----------------- | :------------- | :---------------------- | :------------------------------------------------------- |
| HandlInst (21)     | `1` (required) | (remove)                | Removed. No longer read by the server — remove it        |
| SecurityType (167) | (not set)      | `SPOT` / `FUT` / `PERP` | New — required. Must be present on every replace request |

## 5. OrderStatusRequest (35=H)

| Field              | FIX 4.2 Value | FIX 5.0 SP2 Value       | Notes                                                   |
| :----------------- | :------------ | :---------------------- | :------------------------------------------------------ |
| SecurityType (167) | (not set)     | `SPOT` / `FUT` / `PERP` | New — required. Must be present on every status request |

## 6. ExecutionReport (35=8)

Sent by Prime on fills and order status changes.

| Field              | FIX 4.2 Value                                                                                  | FIX 5.0 SP2 Value                                                                                                            | Notes                                                                                                      |
| :----------------- | :--------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------- |
| SecurityType (167) | (not present)                                                                                  | `SPOT` / `FUT` / `PERP`                                                                                                      | New. Now included on all execution reports — ensure your handler does not reject it as an unexpected field |
| ExecType (150)     | `1` (Partial Fill) on all fills                                                                | `F` (Trade) on all fills                                                                                                     | Breaking change. See fill status behavior below                                                            |
| OrdStatus (39)     | `2` (Filled) on single-fill completion; `1` (Partial Fill) on final fill of a multi-fill order | Reflects true order state at time of fill — `1` (Partial Fill) while open quantity remains; `2` (Filled) when fully complete | Breaking change. See fill status behavior below                                                            |

### Fill Status Behavior

This is one of the most significant changes in FIX 5.0 SP2 Execution Reports and affects any code that branches on ExecType or OrdStatus to determine fill state.

#### ExecType (150)

FIX 5.0 SP2 aligns with the FIX standard — `ExecType = F` (Trade) is sent on every fill regardless of whether it is the first, intermediate, or final fill of an order.

| Scenario                       | FIX 4.2 ExecType   | FIX 5.0 SP2 ExecType |
| :----------------------------- | :----------------- | :------------------- |
| Any fill (partial or complete) | `1` (Partial Fill) | `F` (Trade)          |

#### OrdStatus (39)

FIX 5.0 SP2 also changes the final-fill OrdStatus for multi-fill orders. In 4.2, the final fill of a multi-fill order carried `OrdStatus = 1` (Partial Fill). In 5.0, OrdStatus always reflects the true state of the order at the time of the fill.

| Scenario                                 | FIX 4.2 OrdStatus     | FIX 5.0 SP2 OrdStatus |
| :--------------------------------------- | :-------------------- | :-------------------- |
| Single fill, order fully complete        | `2` (Filled)          | `2` (Filled)          |
| Intermediate fill, open quantity remains | `1` (Partial Fill)    | `1` (Partial Fill)    |
| Final fill of a multi-fill order         | `1` (Partial Fill) ⚠️ | `2` (Filled) ✅        |

#### How to Detect Fills in FIX 5.0 SP2

```
# FIX 5.0 SP2 — detect a fill
ExecType (150) == F

# FIX 5.0 SP2 — detect order fully complete
ExecType (150) == F AND OrdStatus (39) == 2

# FIX 5.0 SP2 — detect a partial fill with open quantity remaining
ExecType (150) == F AND OrdStatus (39) == 1
```

## 7. Migration Checklist

**Session / Logon**

* [ ] Set BeginString = FIXT.1.1
* [ ] Set DefaultApplVerID = 9
* [ ] Move API key from AccessKey (9407) → Username (553)

**NewOrderSingle (35=D)**

* [ ] Add SecurityType (167) to every order (SPOT for existing spot orders)
* [ ] Remove HandlInst (21)
* [ ] Replace MaxShow (210) with DisplayQty (1138) on iceberg orders
* [ ] Market orders: Remove TargetStrategy (847) = M
* [ ] Limit orders: Remove TargetStrategy (847) = L
* [ ] TWAP orders: Change TargetStrategy (847) from T → 1001
* [ ] VWAP orders: Change TargetStrategy (847) from V → 1
* [ ] Stop-Limit orders: Remove TargetStrategy (847) = SL
* [ ] PEG orders: Remove TargetStrategy (847) = P

**OrderCancelRequest (35=F)**

* [ ] Add SecurityType (167)

**OrderCancelReplaceRequest (35=G)**

* [ ] Remove HandlInst (21)
* [ ] Add SecurityType (167)

**OrderStatusRequest (35=H)**

* [ ] Add SecurityType (167)

**ExecutionReport (35=8)**

* [ ] Handle new SecurityType (167) field — ensure your handler does not reject it as unexpected
* [ ] Handle new Fill detection and status changes
