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

# On-Fill

> Register one-shot actions for an embedded order's first fill

> [!NOTE]
>
> Submit this action through the signed WebSocket `post` envelope. See the
> [request format](https://docs.bulk.trade/api-reference/ws-trading.md#post-request-format) and
> [Transaction Signing](https://docs.bulk.trade/api-reference/signing.md) for nonce, signature, and
> canonical encoding requirements. These examples contain illustrative nonces
> and placeholder signatures; sign the exact payload with a fresh nonce before use.

```json Request (Limit + On-Fill Stop) theme={null}
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"of": {
          "trigger": {
            "l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.25, "tif": "GTC", "r": false, "i": false}
          },
          "actions": [
            {"st": {"c": "BTC-USD", "d": false, "sz": 0.25, "tr": 98000.0, "lim": null, "i": false}}
          ]
        }}
      ],
      "nonce": "1704067200000000016",
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 16
}
```

```json Response (Resting Parent) theme={null}
{
  "type": "post",
  "id": 16,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [
            {"resting": {"oid": "CqX7rUkKTmLJB1zRuEWlBsp4lusg30JlZhFE0Jr9VVm2"}}
          ]
        }
      }
    }
  }
}
```

**On-fill (`of`) fields:** `trigger` (an embedded `m` or `l` action), `actions` (one-shot consequents executed on the trigger's first fill). An embedded trigger or consequent `m` / `l` may carry `builderCode` under the normal order rules.

The registration itself does not add a second status row. Pending registration
is exposed through `pendingOnFill` on account state; consequent orders appear
when they execute.

Nested actions support: `m`, `l`, `mod`, `cx`, `cxa`, `st`, `tp`, `rng`, `trig`, `trl`.

> [!NOTE]
>
> **Cancelling conditional orders**: Use `cx` with the conditional order ID or `cxa` to cancel all orders including conditionals.

## Responses and errors

See the shared [response format](https://docs.bulk.trade/api-reference/ws-trading.md#response-format),
[status types](https://docs.bulk.trade/api-reference/ws-trading.md#status-types), and
[error handling](https://docs.bulk.trade/api-reference/ws-trading.md#error-handling). Follow subsequent
order and fill events through the [account stream](https://docs.bulk.trade/api-reference/ws-account.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.