# Webhooks and transaction fee details

For all orders we identify the applied transaction fee model and the details of the specific transaction fees via the [Cash transactions event webhook](/api/transactions/cash_transaction_event).

However, the specific fee details provided may vary between [pre-funding clients](#pre-funding-clients) and those with [post-trade settlement](#post-trade-settlement-clients) as explained below.

## Pre-funding clients

After an order with a transaction fee is executed, fees are reflected in the `CASH_TRANSACTION.EXECUTED` webhook events. The `fees` array is populated with the fee details, and the `delta` reflects the net cash movement inclusive of the fee.

### Buy order execution for pre-funding clients

In the following buy order example, the order value equals €100 and the fee amount was €10. For pre-funding clients, the delta equals the combined value. In this example, the delta value equals -€110.

Order value: €100 | Fee: €10 | Net deduction: €110

**`POST`  Cash transactions events**

```json
{
  "id": "398278e2-8835-11ed-97e3-2eabd0c03f8a",
  "created_at": "2023-01-01",
  "type": "CASH_TRANSACTION.EXECUTED",
  "object": {
    "account_group_id": "6409e3f2-8835-11ed-96a4-2eabd0c03f8a",
    "booking_date": "2023-01-01",
    "created_at": "2023-01-01",
    "delta": {
      "amount": "-110",
      "currency": "EUR"
    },
    "id": "6dc9fbca-8835-11ed-a217-2eabd0c03f8a",
    "references": [
      {
        "id": "7579a672-8835-11ed-9455-2eabd0c03f8a",
        "type": "ORDER_EXECUTION"
      },
      {
        "id": "1f5758d3-1ef7-4b4c-96ec-6b3da2bf1a8a",
        "type": "ORDER"
      }
    ],
    "taxes": [],
    "fees": [
      {
        "amount": "10",
        "currency": "EUR",
        "type": "TOTAL",
        "charge_method": "COLLECTED_BY_UPVEST"
      }
    ],
    "type": "ORDER_EXECUTION",
    "updated_at": "2023-01-01",
    "value_date": "2023-01-01"
  },
  "webhook_id": "35701970-effb-11ed-a05b-0242ac120003"
}
```

### Sell order execution for pre-funding clients

In the following sell order example, the order value equals €100, no taxes are paid and the fee amount was €10. For pre-funding clients, the delta equals the combined value, the fee is taken from proceeds from the sell order. In this example, the delta value equals €90.

Order value: €100 | Fee: €10 | Net proceeds credited: €90

**`POST` Cash transactions events**

```json
{
  "id": "398278e2-8835-11ed-97e3-2eabd0c03f8a",
  "created_at": "2023-01-01",
  "type": "CASH_TRANSACTION.EXECUTED",
  "object": {
    "account_group_id": "6409e3f2-8835-11ed-96a4-2eabd0c03f8a",
    "booking_date": "2023-01-01",
    "created_at": "2023-01-01",
    "delta": {
      "amount": "90",
      "currency": "EUR"
    },
    "id": "6dc9fbca-8835-11ed-a217-2eabd0c03f8a",
    "references": [
      { "id": "7579a672-8835-11ed-9455-2eabd0c03f8a", "type": "ORDER_EXECUTION" },
      { "id": "1f5758d3-1ef7-4b4c-96ec-6b3da2bf1a8a", "type": "ORDER" }
    ],
    "taxes": [],
    "fees": [
      {
        "amount": "10",
        "currency": "EUR",
        "type": "TOTAL",
        "charge_method": "COLLECTED_BY_UPVEST"
      }
    ],
    "type": "ORDER_EXECUTION",
    "updated_at": "2023-01-01",
    "value_date": "2023-01-01"
  },
  "webhook_id": "35701970-effb-11ed-a05b-0242ac120003"
}
```

## Post-trade settlement clients

After an order with a transaction fee is executed, fees are reflected in the `CASH_TRANSACTION.EXECUTED` webhook events. The `fees` array is populated with the fee details, and the `delta` reflects the net cash movement for the order but does not include the impact of the fee as the fee intake is performed by the client.

### Buy order execution for post-trade settlement clients

In this buy order example, the order value equals €100 and the fee amount was €10. For post-trade settlement clients, the delta equals just the order value. In this example, the delta value equals €100.

Order value: €100 | Fee: €10 | Net deduction: €100

```json
{
  "id": "398278e2-8835-11ed-97e3-2eabd0c03f8a",
  "created_at": "2023-01-01",
  "type": "CASH_TRANSACTION.EXECUTED",
  "object": {
    "account_group_id": "6409e3f2-8835-11ed-96a4-2eabd0c03f8a",
    "booking_date": "2023-01-01",
    "created_at": "2023-01-01",
    "delta": {
      "amount": "-100",
      "currency": "EUR"
    },
    "id": "6dc9fbca-8835-11ed-a217-2eabd0c03f8a",
    "references": [
      { "id": "7579a672-8835-11ed-9455-2eabd0c03f8a", "type": "ORDER_EXECUTION" },
      { "id": "1f5758d3-1ef7-4b4c-96ec-6b3da2bf1a8a", "type": "ORDER" }
    ],
    "taxes": [],
    "fees": [
      {
        "amount": "10",
        "currency": "EUR",
        "type": "TOTAL",
        "charge_method": "CHARGED_BY_CLIENT"
      }
    ],
    "type": "ORDER_EXECUTION",
    "updated_at": "2023-01-01",
    "value_date": "2023-01-01"
  },
  "webhook_id": "35701970-effb-11ed-a05b-0242ac120003"
}
```

For buy orders, the `delta` reflects the order cash amount only. The fee (€10 in the example above) is reported separately in the `fees` array. Because the cash movement for the fee occurs outside the Upvest cash system, `CHARGED_BY_CLIENT` fees are not reflected in the Virtual Cash Balance.

### **Sell order execution for post-trade settlement clients**

In the following sell order example, the order value equals €100, no taxes were paid, and the fee amount was €10. For post-trade settlement clients, the delta equals just the net order value. In this example, the delta value equals €100.

Order value: €100 | Fee: €10 | Net proceeds credited: €100

```json
{
  "id": "398278e2-8835-11ed-97e3-2eabd0c03f8a",
  "created_at": "2023-01-01",
  "type": "CASH_TRANSACTION.EXECUTED",
  "object": {
    "account_group_id": "6409e3f2-8835-11ed-96a4-2eabd0c03f8a",
    "booking_date": "2023-01-01",
    "created_at": "2023-01-01",
    "delta": {
      "amount": "100",
      "currency": "EUR"
    },
    "id": "6dc9fbca-8835-11ed-a217-2eabd0c03f8a",
    "references": [
      { "id": "7579a672-8835-11ed-9455-2eabd0c03f8a", "type": "ORDER_EXECUTION" },
      { "id": "1f5758d3-1ef7-4b4c-96ec-6b3da2bf1a8a", "type": "ORDER" }
    ],
    "taxes": [],
    "fees": [
      {
        "amount": "10",
        "currency": "EUR",
        "type": "TOTAL",
        "charge_method": "CHARGED_BY_CLIENT"
      }
    ],
    "type": "ORDER_EXECUTION",
    "updated_at": "2023-01-01",
    "value_date": "2023-01-01"
  },
  "webhook_id": "35701970-effb-11ed-a05b-0242ac120003"
}
```