> ## 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.

# Gateway Cost: Track Payment Processing Fees

> Track total payment gateway processing fees in Upstack. Includes flat fees and percentage-based charges from Stripe, PayPal, and other processors.

<Tip>
  Gateway Cost measures the total payment gateway processing fees charged by payment processors like Stripe, PayPal, or Shopify Payments.
</Tip>

## Formula

<Info>
  **Gateway Cost** = **SUM** ( Payment Gateway Fees )
</Info>

### Formula Components

| Metric                   | Definition                                                                      |
| ------------------------ | ------------------------------------------------------------------------------- |
| **Payment Gateway Fees** | Flat fees + percentage-based fees charged per transaction by payment processors |

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

***

## Example

Your store processed **\$125,000** in revenue across **1,247 orders** in January. With a 2.9% + \$0.30 fee structure:

| Component              | Calculation      | Amount      |
| ---------------------- | ---------------- | ----------- |
| Percentage fees        | \$125,000 × 2.9% | \$3,625     |
| Flat fees              | 1,247 × \$0.30   | \$374       |
| **Total Gateway Cost** |                  | **\$3,999** |

***

## How It Works

Gateway Cost aggregates all payment processing fees from your payment processor. This includes both the percentage-based fee (typically 2.4-3.5% of transaction value) and any flat per-transaction fees (\$0.30 is common). The metric pulls from Shopify's transaction data.

***

## When to Use

| Scenario                        | Action                                                                  |
| ------------------------------- | ----------------------------------------------------------------------- |
| Evaluating payment processors   | Compare Gateway Cost across different processors to find the best rates |
| Calculating contribution margin | Deduct from revenue at CM2 level for accurate profitability             |
| Benchmarking processing costs   | Target 2-3% of revenue for typical e-commerce                           |
| Analyzing per-order economics   | Combine with per-order metrics to understand unit costs                 |

***

## Related Metrics

| Metric                                                                                 | Relationship                              |
| -------------------------------------------------------------------------------------- | ----------------------------------------- |
| [Gateway Cost Per Order](/reference/metrics/orders/transaction/gateway-cost-per-order) | Average gateway fee per order             |
| [Gateway Cost %](/reference/metrics/orders/transaction/gateway-cost-percent)           | Gateway fees as percentage of net revenue |
| [Total Transaction Cost](/reference/metrics/orders/transaction/total-transaction-cost) | Gateway Cost + Other Transaction costs    |

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