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

# Fills

> Subscribe to fills information for your account

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">futures.kraken.com/ws/v1</span>
  <span className="api-tag">fills</span>
</div>

This subscription feed publishes fills information.

***

## Request

<ResponseField name="event" type="string" required>
  `subscribe` or `unsubscribe`
</ResponseField>

<ResponseField name="feed" type="string" required>
  The requested subscription feed. Value: `fills`
</ResponseField>

<ResponseField name="product_ids" type="list">
  Optionally, the `product_ids` field can be used to subscribe only to specific products.
</ResponseField>

<ResponseField name="api_key" type="string" required>
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string" required>
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string" required>
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribe",
    "feed": "fills",
    "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
    "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
    "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
  }
  ```
</CodeGroup>

***

## Response Success

<ResponseField name="event" type="string">
  <span className="field-attr">One of:</span> `subscribed`, `subscribed_failed`, `unsubscribed`, `unsubscribed_failed`

  The result.
</ResponseField>

<ResponseField name="feed" type="string">
  The requested subscription feed. Value: `fills`
</ResponseField>

<ResponseField name="product_ids" type="list">
  List of product identifiers to subscribe for. Other products are ignored.
</ResponseField>

<ResponseField name="api_key" type="string">
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string">
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string">
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribed",
    "feed": "fills",
    "product_ids": ["PF_XBTUSD"],
    "api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
    "original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
    "signed_challenge": "RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
  }
  ```
</CodeGroup>

***

## Response Snapshot & Delta

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="account" type="string">
  The user account.
</ResponseField>

<ResponseField name="fills" type="list of structures">
  A list containing fill elements of the user account.

  <Expandable title="properties">
    <ResponseField name="instrument" type="string">The fill instrument (referred also as symbol or product\_id).</ResponseField>
    <ResponseField name="time" type="positive integer">The server UTC date and time in milliseconds.</ResponseField>
    <ResponseField name="price" type="positive float">The price at which the order was filled.</ResponseField>
    <ResponseField name="seq" type="positive integer">The subscription message sequence number.</ResponseField>
    <ResponseField name="buy" type="boolean">A flag that shows if filled order was a buy.</ResponseField>
    <ResponseField name="qty" type="positive float">The quantity that was filled.</ResponseField>
    <ResponseField name="remaining_order_qty" type="positive float">The remaining unfilled quantity in the order.</ResponseField>
    <ResponseField name="order_id" type="UUID">The order id that was filled.</ResponseField>
    <ResponseField name="cli_ord_id" type="UUID">The unique client order identifier. This field is returned only if the order has a client order id.</ResponseField>
    <ResponseField name="fill_id" type="UUID">The fill id.</ResponseField>

    <ResponseField name="fill_type" type="string">
      The classification of the fill: `maker` if the user has a limit order that gets filled, `taker` if the user makes an execution that crosses the spread, `liquidation` if an execution is the result of a liquidation, `assignee` if an execution is a result of a counterparty receiving an Assignment in PAS, `assignor` if an execution is a result of the user assigning their position due to a failed liquidation, `unwindBankrupt` any portion of a liquidated position cannot be filled or assigned the remaining contracts are unwound, `unwindCounterparty` any portion of your counterparty's position is liquidated and cannot be filled or assigned the remaining contracts are unwound, `takerAfterEdit` if the user edits the order and it is instantly executed.
    </ResponseField>

    <ResponseField name="fee_paid" type="positive float">Fee paid on fill.</ResponseField>
    <ResponseField name="fee_currency" type="string">Currency in which the fee was charged.</ResponseField>
    <ResponseField name="taker_order_type" type="string">The order type of the taker execution: `lmt`, `ioc`, `post`, `liquidation`, `assignment`, `stp`, `unwind`, `market`, `block`, `coveredLiquidation`, `hedgeImmediateOrCancel`, `hedgeAssignment`, `fillOrKill`.</ResponseField>
    <ResponseField name="order_type" type="string">The order type associated with the fill: `lmt`, `ioc`, `post`, `liquidation`, `assignment`, `stp`, `unwind`, `market`, `block`, `coveredLiquidation`, `hedgeImmediateOrCancel`, `hedgeAssignment`, `fillOrKill`.</ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```json Example: Snapshot theme={null}
  {
    "feed": "fills_snapshot",
    "account": "DemoUser",
    "fills": [
      {
        "instrument": "PF_XBTUSD",
        "time": 1600256910739,
        "price": 10937.5,
        "seq": 36,
        "buy": true,
        "qty": 5000.0,
        "remaining_order_qty": 0.0,
        "order_id": "9e30258b-5a98-4002-968a-5b0e149bcfbf",
        "fill_id": "cad76f07-814e-4dc6-8478-7867407b6bff",
        "fill_type": "maker",
        "fee_paid": -0.00009142857,
        "fee_currency": "BTC",
        "taker_order_type": "ioc",
        "order_type": "limit"
      },
      {
        "instrument": "PI_ETHUSD",
        "time": 1600256945531,
        "price": 364.65,
        "seq": 39,
        "buy": true,
        "qty": 5000.0,
        "remaining_order_qty": 0.0,
        "order_id": "7e60b6e8-e4c2-4ce8-bbd0-ef81e18b65bb",
        "fill_id": "b1aa44b2-4f2a-4031-999c-ae1175c91580",
        "fill_type": "taker",
        "fee_paid": 0.00685588921,
        "fee_currency": "ETH",
        "taker_order_type": "market",
        "order_type": "limit"
      }
    ]
  }
  ```
</CodeGroup>

***

## Response Error

<ResponseField name="event" type="string">
  Value: `error`
</ResponseField>

<ResponseField name="message" type="string">
  <span className="field-attr">One of:</span> `Invalid feed`, `Json Error`

  An error message.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "error",
    "message": "Invalid feed"
  }
  ```
</CodeGroup>
