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

# Returning Customer Gateway Cost: Payment Processing for Repeat Buyers

> Track payment gateway fees from returning customer orders. Analyze repeat buyer processing costs and compare transaction expenses across customer segments.

<Tip>
  Total payment gateway fees for orders placed by returning customers.
</Tip>

## Formula

<Info>
  **Returning Customer Gateway Cost** = **SUM** ( [**Gateway Cost**](/reference/metrics/orders/transaction/gateway-cost) ) **WHERE** [customer\_type = returning\_customer](/data-dictionary/measures-and-dimensions)
</Info>

### Formula Components

| Metric                                                                               | Definition                                                                    |
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| [**Gateway Cost**](/reference/metrics/orders/transaction/gateway-cost)               | Payment gateway processing fees including flat fees and percentage-based fees |
| [**customer\_type = returning\_customer**](/data-dictionary/measures-and-dimensions) | Filter to include only repeat purchasers                                      |

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

***

## Example

Your store processed **\$2,089** in gateway fees from returning customers in January:

| Customer Type       | Orders | Gateway Cost | Avg per Order |
| ------------------- | ------ | ------------ | ------------- |
| Returning Customers | 835    | \$2,089      | \$2.50        |
| New Customers       | 412    | \$1,247      | \$3.03        |

Returning customers have lower per-order gateway costs due to higher average order values and repeat purchase patterns.

***

## How It Works

This metric sums all payment gateway processing fees—including percentage-based fees and flat per-transaction charges—for orders placed by returning customers. Shopify identifies returning customers as those who have at least one prior order in your store history.

***

## When to Use

| Scenario            | Action                                                                |
| ------------------- | --------------------------------------------------------------------- |
| Retention economics | Evaluate profitability of repeat buyers including transaction costs   |
| LTV refinement      | Include returning customer transaction costs in lifetime value models |
| Segment comparison  | Compare gateway costs between new and returning customers             |
| CM2 calculation     | Factor transaction costs into contribution margin by segment          |

***

## Related Metrics

| Metric                                                                                           | Relationship                                 |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------- |
| [Gateway Cost](/reference/metrics/orders/transaction/gateway-cost)                               | Parent metric (all customers combined)       |
| [New Customer Gateway Cost](/reference/metrics/orders/transaction/new-customer-gateway-cost)     | Same metric for first-time buyers            |
| [Total Transaction Cost](/reference/metrics/orders/transaction/total-transaction-cost)           | Includes gateway plus other transaction fees |
| [Returning Customer Revenue](/reference/metrics/orders/revenue/returning-customer-total-revenue) | Revenue side of returning customer economics |

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