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

# Total Transaction Cost: Combined Payment Processing Fees

> Track total transaction costs including gateway fees and user-defined transaction costs. Understand payment processing impact on contribution margin.

<Tip>
  The total cost of processing payments, combining gateway fees and any additional user-defined transaction costs.
</Tip>

## Formula

<Info>
  **Total Transaction Cost** = [**Gateway Cost**](/reference/metrics/orders/transaction/gateway-cost) + [**Other Transaction Cost**](/reference/metrics/orders/transaction/other-transaction-cost)
</Info>

### Formula Components

| Metric                                                                                     | Definition                                                               |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| [**Gateway Cost**](/reference/metrics/orders/transaction/gateway-cost)                     | Payment gateway processing fees including flat and percentage-based fees |
| [**Other Transaction Cost**](/reference/metrics/orders/transaction/other-transaction-cost) | User-defined transaction costs from order cost entries                   |

| Metadata        |                             |
| --------------- | --------------------------- |
| **Type**        | Currency                    |
| **Data Source** | [Shopify](/sources/shopify) |
| **Aggregation** | Sum                         |

***

## Example

Your store processed **\$125,000** in orders this month with **\$4,875** in total transaction costs:

| Component                  | Amount      | % of Revenue |
| -------------------------- | ----------- | ------------ |
| Gateway Cost               | \$3,750     | 3.0%         |
| Other Transaction Cost     | \$1,125     | 0.9%         |
| **Total Transaction Cost** | **\$4,875** | **3.9%**     |

***

## How It Works

Total Transaction Cost aggregates all payment-related fees from your orders. Gateway costs are pulled from Shopify's transaction data, while Other Transaction costs come from user-defined order cost entries with the "Transaction" category. This metric is deducted from CM1 to calculate CM2.

***

## When to Use

| Scenario                        | Action                                         |
| ------------------------------- | ---------------------------------------------- |
| Calculating contribution margin | Deduct from CM1 alongside fulfillment costs    |
| Evaluating payment processors   | Compare total processing costs across gateways |
| Pricing strategy                | Factor transaction costs into product margins  |
| Profitability analysis          | Track how payment fees impact net margins      |

***

## Related Metrics

| Metric                                                                                 | Relationship                                    |
| -------------------------------------------------------------------------------------- | ----------------------------------------------- |
| [Gateway Cost](/reference/metrics/orders/transaction/gateway-cost)                     | Component: payment processor fees               |
| [Other Transaction Cost](/reference/metrics/orders/transaction/other-transaction-cost) | Component: user-defined transaction costs       |
| [Gateway Cost %](/reference/metrics/orders/transaction/gateway-cost-percent)           | Gateway fees as percentage of revenue           |
| [CM1](/reference/metrics/orders/contribution-margin/cm1)                               | Margin before transaction and fulfillment costs |
| [CM2](/reference/metrics/orders/contribution-margin/cm2)                               | Margin after deducting this cost                |

[See all Transaction Cost metrics →](/reference/metrics/orders/transaction)
